mirror of
https://github.com/nqrduck/LimeDriverBindings.git
synced 2024-11-16 23:41:02 +00:00
Merge branch 'main' of github.com:nqrduck/LimeDriverBindings
This commit is contained in:
commit
9d56c0b3ab
1 changed files with 1 additions and 28 deletions
29
setup.py
29
setup.py
|
@ -8,45 +8,18 @@ from Cython.Build import cythonize
|
||||||
|
|
||||||
os.environ['CXX'] = 'h5c++'
|
os.environ['CXX'] = 'h5c++'
|
||||||
|
|
||||||
class BuildExtCommand(build_ext):
|
|
||||||
"""Custom build_ext command to ensure that the submodule is retrieved and built."""
|
|
||||||
|
|
||||||
def build_extensions(self):
|
|
||||||
rpath_flags = ['-Wl,-rpath,/usr/lib/']
|
|
||||||
for ext in self.extensions:
|
|
||||||
ext.extra_compile_args = rpath_flags
|
|
||||||
ext.extra_link_args = rpath_flags
|
|
||||||
build_ext.build_extensions(self)
|
|
||||||
|
|
||||||
super().build_extensions()
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if not os.path.exists('extern/limedriver/src'):
|
|
||||||
self.clone_limedriver()
|
|
||||||
|
|
||||||
super().run()
|
|
||||||
|
|
||||||
def clone_limedriver(self):
|
|
||||||
subprocess.check_call(['git', 'submodule', 'init'], shell=True)
|
|
||||||
subprocess.check_call(['git', 'submodule', 'update'], shell=True)
|
|
||||||
|
|
||||||
ext_modules = [
|
ext_modules = [
|
||||||
Extension(
|
Extension(
|
||||||
'limedriver.binding',
|
'limedriver.binding',
|
||||||
sources=['src/limedriver/limedriver.pyx', 'extern/limedriver/src/limedriver.cpp'],
|
sources=['src/limedriver/limedriver.pyx', 'extern/limedriver/src/limedriver.cpp'],
|
||||||
include_dirs=["extern/limedriver/src/", "/usr/include/hdf5/serial/"], # TODO: This is REALLY ugly.
|
include_dirs=["extern/limedriver/src/", "/usr/include/hdf5/serial/"], # TODO: This is REALLY ugly.
|
||||||
library_dirs=["/usr/lib/"],
|
library_dirs=["/usr/lib/"],
|
||||||
libraries=["LimeSuite"],
|
libraries=["LimeSuite", "hdf5_cpp", "hdf5"],
|
||||||
language="c++",
|
language="c++",
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='limedriver',
|
name='limedriver',
|
||||||
|
|
||||||
cmdclass={
|
|
||||||
'build_ext': BuildExtCommand,
|
|
||||||
},
|
|
||||||
|
|
||||||
ext_modules=cythonize(ext_modules),
|
ext_modules=cythonize(ext_modules),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue