1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-11-03 12:43:57 +01:00
qmckl/python/setup.py

78 lines
2.9 KiB
Python
Raw Normal View History

2022-05-03 13:44:44 +02:00
#!/usr/bin/env python3
"""
setup.py file for qmckl package
2022-05-03 13:44:44 +02:00
"""
import os, sys
2022-05-03 13:44:44 +02:00
from setuptools import setup, Extension
from os.path import join
# Read the long description
2022-05-03 13:44:44 +02:00
with open("README.md", "r") as fh:
long_description = fh.read()
# this was recommended to solve the problem of the missing numpy header files
try:
import numpy
except ImportError:
raise Exception("numpy Python package cannot be imported.")
numpy_includedir = numpy.get_include()
# Define the name of the Python package
MODULE_NAME = "qmckl"
2022-05-03 13:44:44 +02:00
# derive the QMCkl libdir and includedir
QMCKL_LIBDIR = os.environ.get("QMCKL_LIBDIR", None)
QMCKL_INCLUDEDIR = os.environ.get("QMCKL_INCLUDEDIR", None)
libdir_undefined = QMCKL_LIBDIR is None or QMCKL_LIBDIR==""
includedir_undefined = QMCKL_INCLUDEDIR is None or QMCKL_INCLUDEDIR==""
2022-05-04 16:41:16 +02:00
# Define qmckl extension module based on SWIG interface file (requires qmckl.h)
qmckl_module = Extension(name = "._" + MODULE_NAME,
sources = [ join("src", MODULE_NAME + "_wrap.c") ],
include_dirs = [numpy_includedir, QMCKL_INCLUDEDIR],
#library_dirs = [QMCKL_LIBDIR],
runtime_library_dirs = [QMCKL_LIBDIR],
libraries = ["qmckl"],
extra_compile_args = ["-Wall"],
extra_link_args = ["-L" + QMCKL_LIBDIR],
depends = [ join("src", "qmckl.h") ],
language = "c"
2022-05-03 13:44:44 +02:00
)
setup(name = MODULE_NAME,
2023-10-06 11:35:02 +02:00
version = "0.5.4",
2022-05-03 13:44:44 +02:00
author = "TREX-CoE",
author_email = "posenitskiy@irsamc.ups-tlse.fr",
description = """Python API of the QMCkl library""",
long_description = long_description,
long_description_content_type = "text/markdown",
2022-05-04 16:41:16 +02:00
ext_modules = [qmckl_module],
py_modules = [MODULE_NAME],
url = "https://github.com/TREX-CoE/qmckl",
license = "BSD",
2022-05-03 13:44:44 +02:00
classifiers=[
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Topic :: Scientific/Engineering",
"Programming Language :: C",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"License :: OSI Approved :: BSD License",
"Operating System :: POSIX",
"Operating System :: Unix",
"Operating System :: MacOS"
],
python_requires = ">=3.0",
# The ABI incompatibility of numpy is a pain, for now set the
# min numpy version such that we have wheels for CPython 3.5 & 3.6
install_requires = ["numpy>=1.13.3"]
2022-05-03 13:44:44 +02:00
)