-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
36 lines (31 loc) · 1.11 KB
/
setup.py
File metadata and controls
36 lines (31 loc) · 1.11 KB
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
from setuptools import setup, Extension
import os
import platform
import numpy as np
openmm_dir = '@OPENMM_DIR@'
header_dir = '@PLUGIN_HEADER_DIR@'
library_dir = '@PLUGIN_HEADER_DIR@'
module_dir = '@MODULE_NAME@'
# setup extra compile and link arguments on Mac
extra_compile_args = ['-std=c++17']
extra_link_args = []
if platform.system() == 'Darwin':
extra_compile_args += ['-stdlib=libc++', '-mmacosx-version-min=10.7']
extra_link_args += [
'-stdlib=libc++', '-mmacosx-version-min=10.7', '-Wl', '-rpath', openmm_dir+'/lib'
]
os.environ['CC'] = '@CMAKE_C_COMPILER@'
os.environ['CXX'] = '@CMAKE_CXX_COMPILER@'
setup(
ext_modules=[
Extension(
name='@MODULE_NAME@._@MODULE_NAME@',
sources=[os.path.join(module_dir, '@WRAP_FILE@')],
libraries=['OpenMM', '@PLUGIN_LIBRARY_NAME@'],
include_dirs=[os.path.join(openmm_dir, 'include'), header_dir, np.get_include()],
library_dirs=[os.path.join(openmm_dir, 'lib'), library_dir],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
)
],
)