-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
76 lines (67 loc) · 1.82 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
project('pypotlib', 'cpp',
version: '0.0.13',
default_options : ['warning_level=2', 'cpp_std=c++17'])
# IMPORTANT!! warning_level=3 passes -fimplicit-none
# Many of the older Fortran codes need implicit typing
host_system = host_machine.system()
# Add C++ compiler options
cpp_args = ['-Wall', '-Wextra', '-Wpedantic']
_args = [cpp_args] # Extra arguments
_deps = [] # Dependencies
_linkto = [] # All the sub-libraries (potentials)
# Languages
add_languages('c', required: true)
add_languages('fortran', required: true)
cc = meson.get_compiler('c')
cppc = meson.get_compiler('cpp')
# ---------------------- Library Dependencies
potlib_dep = declare_dependency(link_with: subproject('potlib', version: '0.1').get_variable('_linkto'),
dependencies: subproject('potlib', version: '0.1').get_variable('_deps'),
)
_deps += potlib_dep
# ---------------------- Bindings
py_mod = import('python')
py = py_mod.find_installation(pure: false)
pyb11_dep = [
py.dependency(),
dependency('pybind11')
]
_deps += [pyb11_dep]
# cpot, for the bindings to potlib
py.extension_module(
'cpot',
sources : [
'pyb11_srcs/py_wrapper.cc',
'pyb11_srcs/py_pottypes.cc',
'pyb11_srcs/py_potential.cc',
'pyb11_srcs/LennardJones/py_ljpot.cc',
'pyb11_srcs/CuH2/py_cuh2pot.cc',
],
dependencies: _deps,
link_with: _linkto,
cpp_args : _args,
install: true,
subdir: 'pypotlib/'
)
# pypotlib, main package
py.install_sources([
'pypotlib/__init__.py',
],
pure: false, # install next to compiled extension
subdir: 'pypotlib'
)
# Adapters
py.install_sources([
'pypotlib/ase_adapters.py',
'pypotlib/aux.py',
],
pure: false,
subdir: 'pypotlib'
)
# Systems
py.install_sources([
'pypotlib/systems/cu_slab_h2.py',
],
pure: false,
subdir: 'pypotlib/systems'
)