LimeDriverBindings/setup.py
Kumi 0568a820af
Simplify build and link HDF5 libraries
Removed custom BuildExtCommand class from setup.py, simplifying the
build process by relying on standard build_ext behavior. The custom
command handling of submodule initialization and build extension
modifications were deemed unnecessary. Additionally, extended the
library dependencies to include 'hdf5_cpp' and 'hdf5' to ensure correct
linking for HDF5 support. This change makes the build process more
straightforward and maintainable.
2024-02-10 18:02:07 +01:00

26 lines
640 B
Python

from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
import subprocess
import os
from Cython.Build import cythonize
os.environ['CXX'] = 'h5c++'
ext_modules = [
Extension(
'limedriver.binding',
sources=['src/limedriver/limedriver.pyx', 'extern/limedriver/src/limedriver.cpp'],
include_dirs=["extern/limedriver/src/", "/usr/include/hdf5/serial/"], # TODO: This is REALLY ugly.
library_dirs=["/usr/lib/"],
libraries=["LimeSuite", "hdf5_cpp", "hdf5"],
language="c++",
),
]
setup(
name='limedriver',
ext_modules=cythonize(ext_modules),
)