forked from grimme-lab/xtb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
379 lines (336 loc) · 12 KB
/
meson.build
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
# extended tight binding program package
project('xtb',
'fortran', 'c', 'cpp',
version: '6.2',
license: 'GPL',
meson_version: '>=0.49')
fc = meson.get_compiler('fortran')
cc = meson.get_compiler('c')
cxx= meson.get_compiler('cpp')
if fc.get_id() == 'intel'
add_project_arguments('-axAVX2', language: 'fortran')
add_project_arguments('-r8', language: 'fortran')
add_project_arguments('-traceback', language: 'fortran')
endif
## ========================================== ##
## LIBRARIES
## ========================================== ##
dependencies = []
dependencies_exe = []
dependencies_sha = []
if get_option('la_backend') == 'mkl'
libmkl = [fc.find_library('pthread')]
libmkl += fc.find_library('m')
libmkl += fc.find_library('dl')
libmkl_exe = [fc.find_library('mkl_intel_lp64')]
libmkl_exe += fc.find_library('mkl_intel_thread')
libmkl_exe += fc.find_library('mkl_core')
libmkl_exe += fc.find_library('iomp5')
libmkl_sha = [fc.find_library('mkl_rt')]
dependencies += libmkl
dependencies_sha += libmkl_sha
dependencies_exe += libmkl_exe
else
dependencies += fc.find_library('blas', required: true)
dependencies += fc.find_library('lapack', required: true)
endif
if fc.get_id() == 'intel'
add_project_arguments('-qopenmp', language: 'fortran')
add_project_link_arguments('-qopenmp', language: 'fortran')
else
add_project_arguments('-fopenmp', language: 'fortran')
add_project_link_arguments('-fopenmp', language: 'fortran')
endif
dependencies += dependency('threads')
# distribute dependencies for shared object and static executable
dependencies_sha += dependencies
dependencies_exe += dependencies
## ========================================== ##
## SOURCE
## ========================================== ##
mctc_srcs = []
xtb_srcs = []
xtb_main = 'xtb/program_main.f90'
# MCTC library
mctc_srcs += 'mctc/mctc_global.f90'
mctc_srcs += 'mctc/mctc_systools.f90'
mctc_srcs += 'mctc/mctc_strings.f90'
mctc_srcs += 'mctc/mctc_constants.f90'
mctc_srcs += 'mctc/mctc_econv.f90'
mctc_srcs += 'mctc/mctc_param.f90'
mctc_srcs += 'mctc/mctc_timings.f90'
mctc_srcs += 'mctc/mctc_filetools.f90'
mctc_srcs += 'mctc/mctc_la.f90'
mctc_srcs += 'mctc/mctc_init.f90'
mctc_srcs += 'mctc/error.f90'
mctc_srcs += 'mctc/signal.c'
# class definitions
xtb_srcs += 'xtb/tbdef_setvar.f90'
xtb_srcs += 'xtb/tbdef_wavefunction.f90'
xtb_srcs += 'xtb/tbdef_basisset.f90'
xtb_srcs += 'xtb/tbdef_molecule.f90'
xtb_srcs += 'xtb/tbdef_solvent.f90'
xtb_srcs += 'xtb/tbdef_param.f90'
xtb_srcs += 'xtb/tbdef_data.f90'
xtb_srcs += 'xtb/tbdef_anc.f90'
xtb_srcs += 'xtb/tbdef_timer.f90'
xtb_srcs += 'xtb/tbdef_pcem.f90'
xtb_srcs += 'xtb/tbdef_wsc.f90'
xtb_srcs += 'xtb/tbdef_options.f90'
# global data
xtb_srcs += 'xtb/gfn0param.f90'
xtb_srcs += 'xtb/sphereparam.f90'
xtb_srcs += 'xtb/scanparam.f90'
xtb_srcs += 'xtb/splitparam.f90'
xtb_srcs += 'xtb/symparam.f90'
xtb_srcs += 'xtb/fixparam.f90'
xtb_srcs += 'xtb/d3param.f90'
xtb_srcs += 'xtb/ehtparam.f90'
xtb_srcs += 'xtb/aoparam.f90'
xtb_srcs += 'xtb/setparam.f90'
# header and I/O
xtb_srcs += 'xtb/readin.f90'
xtb_srcs += 'xtb/filetools.f90'
xtb_srcs += 'xtb/set_module.f90'
xtb_srcs += 'xtb/constrain_param.f90'
xtb_srcs += 'xtb/argparser.f90'
xtb_srcs += 'xtb/header.f90'
xtb_srcs += 'xtb/printout.f90'
xtb_srcs += 'xtb/xhelp.f90'
xtb_srcs += 'xtb/expire.f90'
xtb_srcs += 'xtb/define.f90'
xtb_srcs += 'xtb/readl.f90'
xtb_srcs += 'xtb/readl2.f90'
xtb_srcs += 'xtb/rdcoord2.f90'
xtb_srcs += 'xtb/geometry_reader.f90'
xtb_srcs += 'xtb/wrbas.f90'
xtb_srcs += 'xtb/wrmo.f90'
xtb_srcs += 'xtb/main_property.f90'
xtb_srcs += 'xtb/main_json.f90'
xtb_srcs += 'xtb/main_geometry.f90'
xtb_srcs += 'xtb/gfn_prparam.f90'
xtb_srcs += 'xtb/wrgbw.f90'
xtb_srcs += 'xtb/enso_printout.f90'
xtb_srcs += 'xtb/read_gfn_param.f90'
# parameters
xtb_srcs += 'xtb/gfn_paramset.f90'
xtb_srcs += 'xtb/copyc6.f'
xtb_srcs += 'xtb/setwll.f'
xtb_srcs += 'xtb/charge_model.f90'
# initial guess
xtb_srcs += 'xtb/iniq.f90'
xtb_srcs += 'xtb/eeq_model.f90'
# basis set
xtb_srcs += 'xtb/xbasis.f90'
xtb_srcs += 'xtb/printbas.f90'
xtb_srcs += 'xtb/gauss.f90'
# dispersion
xtb_srcs += 'xtb/ncoord.f90'
xtb_srcs += 'xtb/dftd3.f'
xtb_srcs += 'xtb/dftd4.f90'
xtb_srcs += 'xtb/dispplot.f90'
# continuum solvation
xtb_srcs += 'xtb/gbobc.f90'
xtb_srcs += 'xtb/cm5.f'
# SCC
# integrals and electrostatics
xtb_srcs += 'xtb/intpack.f90'
xtb_srcs += 'xtb/intgrad.f90'
xtb_srcs += 'xtb/aespot.f90'
# iterator + gradient
xtb_srcs += 'xtb/scc_core.f90'
xtb_srcs += 'xtb/grad_core.f90'
xtb_srcs += 'xtb/scf_module.f90'
# driver
xtb_srcs += 'xtb/single.f90'
# convergence accelerator
xtb_srcs += 'xtb/broyden.f'
# misc
xtb_srcs += 'xtb/pseudodiag.f90'
xtb_srcs += 'xtb/embedding.f90'
# vTB + EHT/GFN0/PEEQ
xtb_srcs += 'xtb/peeq_module.f90'
# periodic boundary conditions
xtb_srcs += 'xtb/pbc_tools.f90'
xtb_srcs += 'xtb/generate_wsc.f90'
xtb_srcs += 'xtb/lidep.f90'
# misc/unsorted
xtb_srcs += 'xtb/elem.f90'
xtb_srcs += 'xtb/asym.f90'
xtb_srcs += 'xtb/pqn.f90'
xtb_srcs += 'xtb/lin_mod.f90'
xtb_srcs += 'xtb/lin.f90'
xtb_srcs += 'xtb/printmold.f'
xtb_srcs += 'xtb/surfac.f'
xtb_srcs += 'xtb/esp.f'
xtb_srcs += 'xtb/shiftlp.f'
xtb_srcs += 'xtb/blowsy.f90'
xtb_srcs += 'xtb/onetri.f'
xtb_srcs += 'xtb/exchange.f'
xtb_srcs += 'xtb/local.f90'
xtb_srcs += 'xtb/makel.f90'
xtb_srcs += 'xtb/foden.f90'
xtb_srcs += 'xtb/hlex.f90'
xtb_srcs += 'xtb/cube.f90'
xtb_srcs += 'xtb/pbc.f90'
xtb_srcs += 'xtb/qpot.f90'
xtb_srcs += 'xtb/metadynamic.f90'
xtb_srcs += 'xtb/ls_rmsd.f90'
xtb_srcs += 'xtb/drsp.f'
xtb_srcs += 'xtb/stm.f'
xtb_srcs += 'xtb/axis_trafo.f90'
xtb_srcs += 'xtb/coffee.f90'
xtb_srcs += 'xtb/write_geometry.f90'
xtb_srcs += 'xtb/tmgrad.f90'
xtb_srcs += 'xtb/thermo.f90'
xtb_srcs += 'xtb/constr.f'
xtb_srcs += 'xtb/getsymnum.f90'
xtb_srcs += 'xtb/grid_module.f90'
xtb_srcs += 'xtb/qmdff.f90'
xtb_srcs += 'xtb/qmexternal.f90'
xtb_srcs += 'xtb/qcextern.f90'
xtb_srcs += 'xtb/neighbor.f'
xtb_srcs += 'xtb/zmatpr.f'
xtb_srcs += 'xtb/fragment.f'
xtb_srcs += 'xtb/restart.f90'
xtb_srcs += 'xtb/lopt.f90'
xtb_srcs += 'xtb/qsort.f90'
xtb_srcs += 'xtb/locmode.f'
xtb_srcs += 'xtb/intmodes.f'
xtb_srcs += 'xtb/wrmodef.f'
xtb_srcs += 'xtb/hessian.f90'
xtb_srcs += 'xtb/xbond.f90'
xtb_srcs += 'xtb/timing.f90'
xtb_srcs += 'xtb/prmat.f'
xtb_srcs += 'xtb/dipole.f90'
xtb_srcs += 'xtb/dtrafo.f90'
xtb_srcs += 'xtb/constrain_pot.f90'
xtb_srcs += 'xtb/basic_geo.f90'
xtb_srcs += 'xtb/approxrab.f90'
# ancopt
xtb_srcs += 'xtb/geoopt_driver.f90'
xtb_srcs += 'xtb/optimizer.f90'
xtb_srcs += 'xtb/relaxation_engine.f90'
xtb_srcs += 'xtb/bfgs.f90'
xtb_srcs += 'xtb/david.f'
xtb_srcs += 'xtb/david2.f90'
xtb_srcs += 'xtb/bias_path.f90'
xtb_srcs += 'xtb/geosum.f'
xtb_srcs += 'xtb/model_hessian.f90'
xtb_srcs += 'xtb/lindh.f'
xtb_srcs += 'xtb/scan_driver.f90'
xtb_srcs += 'xtb/symtranslib.f'
# dynamic
xtb_srcs += 'xtb/getname.f'
xtb_srcs += 'xtb/rmrottr.f'
xtb_srcs += 'xtb/matinv.f'
xtb_srcs += 'xtb/eqrot.f'
xtb_srcs += 'xtb/rmsd.f'
xtb_srcs += 'xtb/dynamic.f90'
xtb_srcs += 'xtb/shake_module.f90'
# scan
xtb_srcs += 'xtb/ifind.f'
xtb_srcs += 'xtb/spline2.f90'
xtb_srcs += 'xtb/spline3.f90'
xtb_srcs += 'xtb/anharmlib.f'
xtb_srcs += 'xtb/pocketscan.f'
xtb_srcs += 'xtb/screening.f90'
xtb_srcs += 'xtb/modef.f90'
xtb_srcs += 'xtb/mdoptim.f90'
xtb_srcs += 'xtb/cqpath.f90'
xtb_srcs += 'symmetry/symmetry.f90'
xtb_srcs += 'symmetry/symmetry_i.c'
# API
xtb_srcs += 'xtb/calculator.f90'
xtb_srcs += 'xtb/api.f90'
xtb_test = ['TESTSUITE/tests_peeq.f90']
xtb_test += 'TESTSUITE/assertion.f90'
xtb_test += 'TESTSUITE/tbdef_molecule.f90'
xtb_test += 'TESTSUITE/geometry_reader.f90'
xtb_test += 'TESTSUITE/eeq_model.f90'
xtb_test += 'TESTSUITE/pbc_tools.f90'
xtb_test += 'TESTSUITE/dftd4.f90'
xtb_test += 'TESTSUITE/gfn2.f90'
xtb_test += 'TESTSUITE/gfn1.f90'
xtb_test += 'TESTSUITE/gfn0.f90'
xtb_test += 'TESTSUITE/peeq.f90'
incdir = include_directories('include')
xtb_srcs += mctc_srcs
## ========================================== ##
## TARGETS
## ========================================== ##
# create a static library from all sources
xtb_lib_static = static_library(meson.project_name(), xtb_srcs,
include_directories: incdir, pic: true)
xtb_exe = executable(meson.project_name(), xtb_main,
dependencies: dependencies_exe,
include_directories: incdir,
link_with: xtb_lib_static,
link_args: '-static' )
xtb_lib_shared = shared_library(meson.project_name(),
version: meson.project_version(),
dependencies: dependencies_sha,
include_directories: incdir,
link_whole: xtb_lib_static,
link_args: '-fopenmp')
## ========================================== ##
## TESTSUITE
## ========================================== ##
xtb_test = executable('xtb_test', xtb_test,
dependencies: dependencies_exe,
include_directories: incdir,
link_with: xtb_lib_static,
link_args: '-static' )
# some very basic checks to see if the executable reacts at all
test('Argparser: print version',xtb_exe, args: '--version')
test('Argparser: print help', xtb_exe, args: '--help')
test('Argparser: print license',xtb_exe, args: '--license')
test('Argparser: no arguments', xtb_exe, should_fail: true)
test('Runtyp: singlepoint',
xtb_exe, args: ['--coffee','--strict','--norestart'])
test('Runtyp: geometry opt.',
xtb_exe, args: ['--coffee','--opt','--strict','--norestart'])
test('Runtyp: IP/EA',
xtb_exe, args: ['--coffee','--gfn','2','--vipea','--strict','--norestart'])
test('Method: GFN0-xTB',
xtb_exe, args: ['--coffee','--gfn','0','--strict','--norestart'])
test('Method: GFN1-xTB',
xtb_exe, args: ['--coffee','--gfn','1','--strict','--norestart'])
test('Method: GFN2-xTB/GBSA' ,
xtb_exe, args: ['--coffee','--gfn','2','--strict','--gbsa','h2o','--norestart'])
# more specific tests are implemented by the tester binary
test('Molecule Class: axis',xtb_test,args: ['tbdef_molecule','axis'])
test('Molecule Class: MIC', xtb_test,args: ['tbdef_molecule','mic'])
test('Geometry Reader: coord 3D',xtb_test,args: ['geometry_reader','coord_3d_a'])
test('Geometry Reader: coord 3D',xtb_test,args: ['geometry_reader','coord_3d_b'])
test('Geometry Reader: coord 2D',xtb_test,args: ['geometry_reader','coord_2d'])
test('Geometry Reader: coord 1D',xtb_test,args: ['geometry_reader','coord_1d'])
test('Geometry Reader: coord 0D',xtb_test,args: ['geometry_reader','coord_0d'])
test('Geometry Reader: Xmol 0D',xtb_test,args: ['geometry_reader','xmol_0d'])
test('Geometry Reader: POSCAR', xtb_test,args: ['geometry_reader','poscar_3d'])
test('PBC tools: convert',xtb_test,args: ['pbc_tools','convert'])
test('PBC tools: cutoff', xtb_test,args: ['pbc_tools','cutoff'])
test('EEQ model: water', xtb_test,args: ['eeq_model','water'])
test('EEQ model: 3D Ewald',xtb_test,args: ['eeq_model','ewald'])
test('EEQ model: GBSA', xtb_test,args: ['eeq_model','gbsa'])
test('EEQ model: GBSA (salt)', xtb_test,args: ['eeq_model','salt'])
test('EEQ model: GBSA (H-bond)', xtb_test,args: ['eeq_model','hbond'])
test('Dispersion: properties', xtb_test,args: ['dftd4','properties'])
test('Dispersion: energies', xtb_test,args: ['dftd4','energies'])
test('Dispersion: energies (PBC)',xtb_test,args: ['dftd4','pbc_disp'])
#test('Dispersion: cell gradients',xtb_test,args: ['dftd4','cell_gradient'])
test('Dispersion: API', xtb_test,args: ['dftd4','api'])
#test('Dispersion: API (PBC)', xtb_test,args: ['dftd4','pbc_api'])
test('GFN2-xTB: SCC',xtb_test,args: ['gfn2','scc'])
test('GFN2-xTB: API',xtb_test,args: ['gfn2','api'])
test('GFN2-xTB: API (GBSA)',xtb_test,args: ['gfn2','gbsa'])
test('GFN2-xTB: API (GBSA+salt)',xtb_test,args: ['gfn2','salt'])
test('GFN2-xTB: API (PCEM)',xtb_test,args: ['gfn2','pcem'])
test('GFN1-xTB: SCC',xtb_test,args: ['gfn1','scc'])
test('GFN1-xTB: API',xtb_test,args: ['gfn1','api'])
test('GFN1-xTB: API (GBSA)',xtb_test,args: ['gfn1','gbsa'])
test('GFN1-xTB: API (PCEM)',xtb_test,args: ['gfn1','pcem'])
test('GFN0-xTB: SP', xtb_test,args: ['gfn0','sp'])
test('GFN0-xTB: API',xtb_test,args: ['gfn0','api'])
test('PEEQ: SP', xtb_test,args: ['peeq','sp'])
test('PEEQ: API',xtb_test,args: ['peeq','api'])