2022-05-03 13:44:44 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
"""
|
2022-05-04 15:06:37 +02:00
|
|
|
setup.py file for qmckl package
|
2022-05-03 13:44:44 +02:00
|
|
|
"""
|
|
|
|
|
2022-05-04 17:26:38 +02:00
|
|
|
import os, sys
|
2022-05-03 13:44:44 +02:00
|
|
|
from setuptools import setup, Extension
|
|
|
|
from os.path import join
|
|
|
|
|
2022-05-03 15:07:38 +02:00
|
|
|
|
|
|
|
# Read the long description
|
2022-05-03 13:44:44 +02:00
|
|
|
with open("README.md", "r") as fh:
|
|
|
|
long_description = fh.read()
|
|
|
|
|
2022-05-04 17:26:38 +02:00
|
|
|
# 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()
|
|
|
|
|
2022-05-03 15:07:38 +02:00
|
|
|
# Define the name of the Python package
|
2022-05-04 15:06:37 +02:00
|
|
|
MODULE_NAME = "qmckl"
|
2022-05-03 13:44:44 +02:00
|
|
|
|
2022-05-04 17:26:38 +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)
|
2022-05-04 17:26:38 +02:00
|
|
|
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
|
|
|
)
|
|
|
|
|
|
|
|
|
2022-05-04 15:06:37 +02:00
|
|
|
setup(name = MODULE_NAME,
|
2024-04-10 16:38:10 +02:00
|
|
|
version = "1.0.0",
|
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],
|
2022-05-04 15:06:37 +02:00
|
|
|
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",
|
2022-08-22 10:13:01 +02:00
|
|
|
# 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
|
|
|
)
|