Initial commit

This commit is contained in:
Christian Zimmermann 2023-02-21 19:31:14 +01:00
commit 7a53982fdd

61
setup.py Normal file
View file

@ -0,0 +1,61 @@
#!/usr/bin/env python
import Cython.Build
import setuptools
import sysconfig
libname = "cnorxz"
author = "Christian Zimmermann"
author_email = "chizeta@f3l.de"
inc_dirs = list()
#inc_dirs.append( "@INSTALL_PATH@/include" )
# ^ specify cnorxz path in command line by typing 'pip install --install-option="--library-dirs=..."'
lib_dirs = list()
lib_dirs.append( "/usr/lib" )
lib_dirs.append( "/usr/local/lib" )
#lib_dirs.append( "@INSTALL_PATH@/lib" )
extra_compile_args = sysconfig.get_config_var('CFLAGS').split()
extra_compile_args += ["-std=c++17", "-Wall", "-Wextra", "-Wpedantic"] # get this automatically from cnorxz itself??
default_extension_args = dict(
language = "c++",
include_dirs = inc_dirs,
libraries = [libname],
library_dirs = lib_dirs,
extra_compile_args = extra_compile_args,
)
if __name__ == "__main__":
print("Include directories:")
for d in inc_dirs:
print("\t",d)
print("Library directories:")
for d in lib_dirs:
print("\t",d)
extensions = list()
extensions.append(
setuptools.Extension(
name = libname + ".base",
sources = [
"base/ranges.pys",
"base/array.pys",
],
**default_extension_args
)
)
# append further extensions (cereal, hdf5, mpi ...) here
setuptools.setup(
name = libname,
packages = setuptools.find_packages(),
version_format='{tag}.dev{commitcount}+{gitsha}',
setup_requires=['setuptools-git-version']
include_dirs = inc_dirs,
ext_modules = Cython.Build.cythonize(extensions),
author = author,
author_email = author_email,
)