summaryrefslogtreecommitdiffstats
path: root/Wrappers/Python/setup-regularizers.py.in
diff options
context:
space:
mode:
authorEdoardo Pasca <edo.paskino@gmail.com>2018-01-29 15:46:04 +0000
committerEdoardo Pasca <edo.paskino@gmail.com>2018-01-29 15:46:04 +0000
commit4338380a8b540345096052ee30d8bbf668ce3c57 (patch)
tree4ffc8f08d9dcdfbceb068ca4c2a1fc19527610cd /Wrappers/Python/setup-regularizers.py.in
parent5df7f2f5c18913f83b64bab12f6bf17df0bc4b01 (diff)
downloadregularization-4338380a8b540345096052ee30d8bbf668ce3c57.tar.gz
regularization-4338380a8b540345096052ee30d8bbf668ce3c57.tar.bz2
regularization-4338380a8b540345096052ee30d8bbf668ce3c57.tar.xz
regularization-4338380a8b540345096052ee30d8bbf668ce3c57.zip
finds boost libraries during wrappers build (win)
finds and set the correct name for the boost libraries. Builds GPU wrapper if CUDA is found.
Diffstat (limited to 'Wrappers/Python/setup-regularizers.py.in')
-rw-r--r--Wrappers/Python/setup-regularizers.py.in84
1 files changed, 84 insertions, 0 deletions
diff --git a/Wrappers/Python/setup-regularizers.py.in b/Wrappers/Python/setup-regularizers.py.in
new file mode 100644
index 0000000..3f4d2d7
--- /dev/null
+++ b/Wrappers/Python/setup-regularizers.py.in
@@ -0,0 +1,84 @@
+#!/usr/bin/env python
+
+import setuptools
+from distutils.core import setup
+from distutils.extension import Extension
+from Cython.Distutils import build_ext
+
+import os
+import sys
+import numpy
+import platform
+
+cil_version=os.environ['CIL_VERSION']
+if cil_version == '':
+ print("Please set the environmental variable CIL_VERSION")
+ sys.exit(1)
+
+library_include_path = ""
+library_lib_path = ""
+try:
+ library_include_path = os.environ['LIBRARY_INC']
+ library_lib_path = os.environ['LIBRARY_LIB']
+except:
+ library_include_path = os.environ['PREFIX']+'/include'
+ pass
+
+extra_include_dirs = [numpy.get_include(), library_include_path]
+#extra_library_dirs = [os.path.join(library_include_path, "..", "lib")]
+extra_compile_args = []
+extra_library_dirs = []
+extra_compile_args = []
+extra_link_args = []
+extra_libraries = ['cilreg']
+
+extra_include_dirs += [os.path.join(".." , ".." , "Core"),
+ os.path.join(".." , ".." , "Core", "regularizers_CPU"),
+ os.path.join(".." , ".." , "Core", "regularizers_GPU") ,
+ "."]
+
+if platform.system() == 'Windows':
+ extra_compile_args[0:] = ['/DWIN32','/EHsc','/DBOOST_ALL_NO_LIB' , '/openmp' ]
+else:
+ extra_compile_args = ['-fopenmp','-O2', '-funsigned-char', '-Wall', '-std=c++0x']
+ extra_libraries += [@EXTRA_OMP_LIB@]
+
+extra_libraries += ["@BOOST_PYTHON_LIB@", "@BOOST_NUMPY_LIB@"]
+
+
+setup(
+ name='ccpi',
+ description='CCPi Core Imaging Library - Image Regularizers',
+ version=cil_version,
+ cmdclass = {'build_ext': build_ext},
+ ext_modules = [Extension("ccpi.filters.cpu_regularizers_boost",
+ sources=[os.path.join("." , "src", "fista_module.cpp" )],
+ include_dirs=extra_include_dirs,
+ library_dirs=extra_library_dirs,
+ extra_compile_args=extra_compile_args,
+ libraries=extra_libraries ),
+
+ ],
+ zip_safe = False,
+ packages = {'ccpi','ccpi.filters'},
+)
+
+setup(
+ name='ccpi',
+ description='CCPi Core Imaging Library - Image Regularizers',
+ version=cil_version,
+ cmdclass = {'build_ext': build_ext},
+ ext_modules = [Extension("ccpi.filters.cpu_regularizers_cython",
+ sources=[os.path.join("." , "src", "cpu_regularizers.pyx" ) ],
+ include_dirs=extra_include_dirs,
+ library_dirs=extra_library_dirs,
+ extra_compile_args=extra_compile_args,
+ libraries=extra_libraries ),
+
+ ],
+ zip_safe = False,
+ packages = {'ccpi','ccpi.filters'},
+)
+
+
+@SETUP_GPU_WRAPPERS@ \ No newline at end of file