forked from libAtoms/QUIP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.rules
206 lines (186 loc) · 5.61 KB
/
Makefile.rules
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# H0 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# H0 X
# H0 X libAtoms+QUIP: atomistic simulation library
# H0 X
# H0 X Portions of this code were written by
# H0 X Albert Bartok-Partay, Silvia Cereda, Gabor Csanyi, James Kermode,
# H0 X Ivan Solt, Wojciech Szlachta, Csilla Varnai, Steven Winfield.
# H0 X
# H0 X Copyright 2006-2010.
# H0 X
# H0 X These portions of the source code are released under the GNU General
# H0 X Public License, version 2, http://www.gnu.org/copyleft/gpl.html
# H0 X
# H0 X If you would like to license the source code under different terms,
# H0 X please contact Gabor Csanyi, [email protected]
# H0 X
# H0 X Portions of this code were written by Noam Bernstein as part of
# H0 X his employment for the U.S. Government, and are not subject
# H0 X to copyright in the USA.
# H0 X
# H0 X
# H0 X When using this software, please cite the following reference:
# H0 X
# H0 X http://www.libatoms.org
# H0 X
# H0 X Additional contributions by
# H0 X Alessio Comisso, Chiara Gattinoni, and Gianpietro Moras
# H0 X
# H0 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
.SUFFIXES: .c .h .f .f95 .f90 .fpp
FOX_LIBS = -lFoX_sax -lFoX_wxml -lFoX_utils -lFoX_common -lFoX_fsys
FX_LIB = -lfx
MDCORE_LIBS = -lmdcore
GIT_VERSION := -D'GIT_VERSION="$(shell ${QUIP_ROOT}/bin/gitversion)"'
ifeq (${HAVE_GAP},1)
GAP_VERSION := -D'GAP_VERSION=$(shell ${QUIP_ROOT}/src/GAP/gapversion)'
endif
ifndef AR
AR = ar
endif
RANLIB = ranlib
NM = nm --print-file-name --extern-only --defined-only --no-sort --portability
ifeq (${COPTIM},)
COPTIM=${OPTIM}
endif
ifeq (${CDEBUG},)
CDEBUG=${DEBUG}
endif
DEFINES += ${GIT_VERSION} ${GAP_VERSION} -D'QUIP_ARCH="${QUIP_ARCH}"' -D'SIZEOF_FORTRAN_T=${SIZEOF_FORTRAN_T}'
F95FLAGS += ${INCLUDES} ${OPTIM} ${DEBUG} ${DEFINES} ${CUSTOM_F95FLAGS}
F77FLAGS += ${INCLUDES} ${OPTIM} ${DEBUG} ${DEFINES} ${CUSTOM_F77FLAGS}
CPLUSPLUSFLAGS += ${INCLUDES} ${COPTIM} ${CDEBUG} ${DEFINES} ${CUSTOM_CPLUSPLUSFLAGS}
CFLAGS += ${INCLUDES} ${COPTIM} ${CDEBUG} ${DEFINES} ${CUSTOM_CFLAGS}
SYSLIBS += -L${FOX_LIBDIR} ${FOX_LIBS}
INCLUDES += -I${QUIP_ROOT}/src/libAtoms -I${FOX_INCDIR}
QUIPPY_LIBS=
ifeq (${HAVE_NETCDF4},1)
SYSLIBS += ${NETCDF4_LIBS}
INCLUDES += ${NETCDF4_FLAGS}
DEFINES += -DHAVE_NETCDF4
# for LAMMPS
NETCDF_SYSLIBS = ${NETCDF4_LIBS}
endif
ifeq (${HAVE_MDCORE},1)
SYSLIBS += -L${MDCORE_LIBDIR} ${MDCORE_LIBS}
INCLUDES += -I${MDCORE_INCDIR}
DEFINES += -DHAVE_MDCORE
endif
ifeq (${HAVE_ASAP},1)
SYSLIBS += -L${ASAP_LIBDIR} -lasap
INCLUDES += -I${ASAP_LIBDIR}
DEFINES += -DHAVE_ASAP
endif
ifeq (${HAVE_KIM},1)
SYSLIBS += `kim-api-v1-build-config --ldflags` `kim-api-v1-build-config --ldlibs`
INCLUDES += `kim-api-v1-build-config --includes`
DEFINES += -DHAVE_KIM
ifeq (${KIM_NO_AUTOGENERATE_TEST_KIM},1)
DEFINES += -DKIM_NO_AUTOGENERATE_TEST_KIM
endif
endif
ifeq (${HAVE_FX},1)
DEFINES += -DHAVE_FX
SYSLIBS += ${FX_LIB}
endif
ifeq (${HAVE_GAP},1)
DEFINES += -DHAVE_GAP
GAP_LIB += -lgap
GAP_LIBFILE += libgap.a
GAPFIT_LIB += -lgapfit
GAPFIT_LIBFILE += libgapfit.a
endif
ifeq (${HAVE_TURBOGAP},1)
DEFINES += -DHAVE_TURBOGAP
INCLUDES += $(addprefix -I,${TURBOGAP_DIR}/include)
SYSLIBS += $(addprefix -L,${TURBOGAP_DIR}/lib)
SYSLIBS += -lturbogap
QUIPPY_LIBS += $(addprefix -L,${TURBOGAP_DIR}/lib)
QUIPPY_LIBS += -lturbogap
endif
ifeq (${HAVE_TB},1)
DEFINES += -DHAVE_TB
endif
ifeq (${HAVE_PRECON},1)
DEFINES += -DHAVE_PRECON
endif
ifeq (${HAVE_QP_TEACH},1)
DEFINES += -DHAVE_QP -DHAVE_QP_TEACH
endif
ifeq (${HAVE_QP_PREDICT},1)
DEFINES += -DHAVE_QP -DHAVE_QP_PREDICT
endif
ifeq (${HAVE_QR},1)
DEFINES += -DHAVE_QR
endif
ifeq (${HAVE_LOTF},1)
DEFINES += -DHAVE_LOTF
endif
ifeq (${HAVE_CP2K},1)
DEFINES += -DHAVE_CP2K
endif
ifeq (${HAVE_ONIOM},1)
DEFINES += -DHAVE_ONIOM
endif
ifeq (${HAVE_LOCAL_E_MIX},1)
DEFINES += -DHAVE_LOCAL_E_MIX
endif
ifeq (${HAVE_CGAL},1)
DEFINES += -DHAVE_CGAL
CUSTOM_CPLUSPLUSFLAGS += -frounding-math -DCGAL_FPU_HAS_EXCESS_PRECISION
INCLUDES += $(addprefix -I,${CGAL_INCDIR})
SYSLIBS += $(addprefix -L,${CGAL_LIBDIR})
SYSLIBS += -lCGAL -lgmpxx -lmpfr -lgmp -lboost_thread-mt -lstdc++ #/usr/lib/libstdc++.6.dylib
endif
ifeq (${HAVE_THIRDPARTY},1)
DEFINES += -DHAVE_THIRDPARTY
endif
ifeq (${HAVE_METIS},1)
DEFINES += -DHAVE_METIS
SYSLIBS += $(addprefix -L,${METIS_LIBDIR})
SYSLIBS += -lmetis
endif
ifeq (${HAVE_SCME},1)
DEFINES += -DHAVE_SCME
SYSLIBS += -lscme -lstdc++
endif
ifeq (${HAVE_MTP},1)
DEFINES += -DHAVE_MTP
SYSLIBS += -lmtp -lstdc++
endif
ifeq (${HAVE_MBD},1)
DEFINES += -DHAVE_MBD
SYSLIBS += -lmbd
endif
ifeq (${HAVE_TTM_NF},1)
DEFINES += -DHAVE_TTM_NF
SYSLIBS += -lttm_nf -lstdc++
endif
ifeq (${HAVE_CH4},1)
DEFINES += -DHAVE_CH4
SYSLIBS += -lch4
endif
ifeq (${HAVE_LMTO_TBE},1)
DEFINES += -DHAVE_LMTO_TBE
INCLUDES += $(addprefix -I,${LMTO_TBE_LIBDIR}/mods)
SYSLIBS += -Wl,--start-group ${LMTO_TBE_LIBDIR}/tb/libtb.a ${LMTO_TBE_LIBDIR}/subs/liblm.a
SYSLIBS += ${LMTO_TBE_LIBDIR}/slatsm/libsl.a ${LMTO_TBE_LIBDIR}/v7input/libv7inp.a -Wl,--end-group
SYSLIBS += -lxcf90 -lxc
endif
SYSLIBS += ${MATH_LINKOPTS} ${EXTRA_LINKOPTS}
LINKOPTS += ${OPTIM} ${DEBUG} ${SYSLIBS} ${CUSTOM_LINKOPTS}
.f.o:
${F77} ${F77FLAGS} -c $< -o $@
.c.o:
${CC} ${CFLAGS} -c $< -o $@
.cpp.o:
${CPLUSPLUS} ${CPLUSPLUSFLAGS} -c $< -o $@
.f95.o:
${F95} ${F95FLAGS} -c ${F95_PRE_FILENAME_FLAG} $< -o $@
.f90.o:
${F95} ${F95FLAGS} -c ${F95_PRE_FILENAME_FLAG} $< -o $@
FPP_PRE_TARGET_STRING ?= >
.f95.fpp:
${FPP} ${F95FLAGS} ${F95_PRE_FILENAME_FLAG} $< ${FPP_PRE_TARGET_STRING} $@
%.o : %.mod
-include Makefiles/Makefile.rules.${QUIP_ARCH}