2016-03-27 12:56:54 +03:00
|
|
|
from setuptools import setup#, Extension
|
|
|
|
from Cython.Distutils import build_ext
|
|
|
|
from distutils.extension import Extension
|
|
|
|
# setuptools DWIM monkey-patch madness
|
|
|
|
# http://mail.python.org/pipermail/distutils-sig/2007-September/thread.html#8204
|
|
|
|
#import sys
|
|
|
|
#if 'setuptools.extension' in sys.modules:
|
|
|
|
# m = sys.modules['setuptools.extension']
|
|
|
|
# m.Extension.__dict__ = m._Extension.__dict__
|
|
|
|
|
2017-04-19 17:43:24 +03:00
|
|
|
# TODO CHECK THIS OUT http://stackoverflow.com/questions/4056657/what-is-the-easiest-way-to-make-an-optional-c-extension-for-a-python-package
|
|
|
|
# also this: https://docs.python.org/2/extending/building.html
|
|
|
|
import os
|
|
|
|
|
|
|
|
print("You might want to add additional library path to LD_LIBRARY_PATH (especially if you are not using"
|
|
|
|
" GNU GSL in your system library path) and if import fails. ")
|
2017-05-03 08:32:06 +03:00
|
|
|
if("LD_LIBRARY_PATH" in os.environ):
|
2017-05-03 08:30:05 +03:00
|
|
|
print(os.environ['LD_LIBRARY_PATH'].split(':'))
|
2017-04-19 17:43:24 +03:00
|
|
|
|
2016-03-27 12:56:54 +03:00
|
|
|
qpms_c = Extension('qpms_c',
|
2017-05-11 04:38:46 +03:00
|
|
|
sources = ['qpms/qpms_c.pyx', #'qpms/hexpoints_c.pyx',
|
|
|
|
'qpms/gaunt.c',#'qpms/gaunt.h','qpms/vectors.h','qpms/translations.h',
|
2017-04-19 17:43:24 +03:00
|
|
|
# FIXME http://stackoverflow.com/questions/4259170/python-setup-script-extensions-how-do-you-include-a-h-file
|
|
|
|
'qpms/translations.c'],
|
2017-04-26 14:12:29 +03:00
|
|
|
extra_compile_args=['-std=c99','-ggdb','-O3',
|
2017-05-03 08:30:05 +03:00
|
|
|
'-DQPMS_COMPILE_PYTHON_EXTENSIONS', # this is required
|
|
|
|
#'-DQPMS_USE_OMP',
|
2017-04-26 14:12:29 +03:00
|
|
|
'-DDISABLE_NDEBUG', # uncomment to enable assertions in the modules
|
2017-05-03 08:30:05 +03:00
|
|
|
#'-fopenmp',
|
2017-04-26 14:12:29 +03:00
|
|
|
],
|
2017-05-08 19:45:16 +03:00
|
|
|
libraries=['gsl', 'blas', 'gslcblas', #'omp'
|
2017-05-03 08:43:29 +03:00
|
|
|
],
|
2017-05-03 08:32:06 +03:00
|
|
|
runtime_library_dirs=os.environ['LD_LIBRARY_PATH'].split(':') if 'LD_LIBRARY_PATH' in os.environ else []
|
2017-04-19 17:43:24 +03:00
|
|
|
)
|
2016-03-27 12:56:54 +03:00
|
|
|
|
|
|
|
setup(name='qpms',
|
2017-05-11 06:31:43 +03:00
|
|
|
version = "0.2.11",
|
2016-03-27 12:56:54 +03:00
|
|
|
packages=['qpms'],
|
|
|
|
# setup_requires=['setuptools_cython'],
|
2016-07-12 03:24:15 +03:00
|
|
|
install_requires=['cython>=0.21','quaternion','spherical_functions','py_gmm'],
|
|
|
|
dependency_links=['https://github.com/texnokrates/py_gmm','https://github.com/moble/quaternion','https://github.com/moble/spherical_functions'],
|
2016-03-27 12:56:54 +03:00
|
|
|
ext_modules=[qpms_c],
|
|
|
|
cmdclass = {'build_ext': build_ext},
|
|
|
|
)
|
|
|
|
|
|
|
|
|