forked from grimme-lab/xtb4stda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
96 lines (86 loc) · 3.28 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
# This file is part of xtb4stda.
#
# Copyright (C) 2019 Sebastian Ehlert
#
# xtb4stda is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# xtb4stda is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with xtb4stda. If not, see <https://www.gnu.org/licenses/>.
project('xtb4stda', 'fortran',
version: '1.0',
license: 'LGPL3',
meson_version: '>=0.49')
fc = meson.get_compiler('fortran')
if fc.get_id() == 'gcc'
add_project_arguments('-ffree-line-length-none', language: 'fortran')
add_project_arguments('-fbacktrace', language: 'fortran')
elif fc.get_id() == 'intel'
add_project_arguments('-axAVX2', language: 'fortran')
add_project_arguments('-traceback', language: 'fortran')
add_project_link_arguments('-static', language: 'fortran')
endif
dependencies = []
la_backend = get_option('la_backend')
if la_backend == 'mkl'
libmkl = [fc.find_library('pthread')]
libmkl += fc.find_library('m')
libmkl += fc.find_library('dl')
if fc.get_id() == 'intel'
libmkl += [fc.find_library('mkl_intel_lp64')]
libmkl += fc.find_library('mkl_intel_thread')
else
libmkl += [fc.find_library('mkl_gf_lp64')]
libmkl += fc.find_library('mkl_gnu_thread')
endif
libmkl += fc.find_library('mkl_core')
libmkl += fc.find_library('iomp5')
dependencies += libmkl
elif la_backend == 'openblas'
dependencies += fc.find_library('openblas', required : true)
dependencies += fc.find_library('lapack', required : true)
elif la_backend == 'custom'
foreach lib: get_option('custom_libraries')
dependencies += fc.find_library(lib)
endforeach
else
dependencies += fc.find_library('blas', required : true)
dependencies += fc.find_library('lapack', required : true)
endif
if get_option('openmp')
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
endif
srcs = []
subdir('src')
xtb4stda_exe = executable(meson.project_name(), srcs,
dependencies: dependencies,
include_directories: include_directories('include'),
install: true)
parameter_files = ['.param_stda1.xtb',
'.param_stda2.xtb',
'.param_gbsa_acetone',
'.param_gbsa_acetonitrile',
'.param_gbsa_benzene',
'.param_gbsa_ch2cl2',
'.param_gbsa_chcl3',
'.param_gbsa_cs2',
'.param_gbsa_dmso',
'.param_gbsa_ether',
'.param_gbsa_h2o',
'.param_gbsa_methanol',
'.param_gbsa_thf',
'.param_gbsa_toluene']
install_data(parameter_files)