forked from lingtikong/dump2phonon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
67 lines (56 loc) · 1.68 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
.SUFFIXES : .o .cpp
# compiler and flags
CC = /opt/intel/bin/icc
#CC = g++ -Wno-unused-result
LINK = $(CC) ${PARALIB}
CFLAGS = -O3 $(UFLAG) $(DEBUG)
#
OFLAGS = -O3 $(DEBUG)
INC = $(FFTINC) $(LPKINC) $(USRINC) $(VoroINC) $(GslINC)
LIB = $(FFTLIB) $(LPKLIB) $(USRLIB) $(VoroLIB) $(GslLIB)
#
# fftw 3 library; not needed by this code
FFTINC = -I/opt/libs/fftw/3.2.2/include
FFTLIB = -L/opt/libs/fftw/3.2.2/lib -lfftw3
# Lapack library; not needed by this code
#LPKINC = -I/opt/clapack/3.2.1/include
#LPKLIB = -L/opt/clapack/3.2.1/lib -lclapack -lblas -lf2c -lm
# Voro++, Needed.
# VoroINC = -I/opt/libs/voro_svn/src
# VoroLIB = -L/opt/libs/voro_svn/src -lvoro++
# GSL, needed
# GslINC = -I/opt/libs/gsl/include
# GslLIB = -L/opt/libs/gsl/lib -lgsl -lgslcblas
# Parallization related, can be switch off
# PARAINC = -DOMP -fopenmp
# PARALIB = -fopenmp
# User flag
#UFLAG =
# Debug flags
# DEBUG = -g -O1
#====================================================================
# executable name
BASE = d2p
EXE = ${BASE}
#================= Do not modify the following ======================
# source and rules
SRC = $(wildcard *.cpp)
OBJ = $(SRC:.cpp=.o)
#====================================================================
all: ${EXE}
${EXE}: $(OBJ)
$(LINK) $(OFLAGS) $(OBJ) $(LIB) -o $@
clean:
rm -f *.o *~ *.mod ${EXE}
tar:
rm -f ${BASE}.tar; tar -czvf ${BASE}.tar.gz *.cpp *.h Makefile README
ver:
@echo "#define VERSION `git log|grep commit|wc -l`" > version.h; cat version.h
.f.o:
$(FC) $(FFLAGS) $(FREE) $(PARAINC) ${INC} -c $<
.f90.o:
$(FC) $(FFLAGS) $(FREE) $(PARAINC) ${INC} -c $<
.c.o:
$(CC) $(CFLAGS) $(PARAINC) -c $<
.cpp.o:
$(CC) $(CFLAGS) $(PARAINC) $(INC) -c $<