From 61bfe1f57fbda958e24e227e567676fafd7f6d3e Mon Sep 17 00:00:00 2001 From: Tomas Kulhanek Date: Thu, 21 Feb 2019 02:11:13 -0500 Subject: restructured sources --- src/Python/setup-regularisers.py.in | 75 +++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 src/Python/setup-regularisers.py.in (limited to 'src/Python/setup-regularisers.py.in') diff --git a/src/Python/setup-regularisers.py.in b/src/Python/setup-regularisers.py.in new file mode 100644 index 0000000..462edda --- /dev/null +++ b/src/Python/setup-regularisers.py.in @@ -0,0 +1,75 @@ +#!/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 = [library_lib_path] +extra_compile_args = [] +extra_link_args = [] +extra_libraries = ['cilreg'] + +print ("extra_library_dirs " , extra_library_dirs) + +extra_include_dirs += [os.path.join(".." , ".." , "Core"), + os.path.join(".." , ".." , "Core", "regularisers_CPU"), + os.path.join(".." , ".." , "Core", "inpainters_CPU"), + os.path.join(".." , ".." , "Core", "regularisers_GPU" , "TV_FGP" ) , + os.path.join(".." , ".." , "Core", "regularisers_GPU" , "TV_ROF" ) , + os.path.join(".." , ".." , "Core", "regularisers_GPU" , "TV_SB" ) , + os.path.join(".." , ".." , "Core", "regularisers_GPU" , "TGV" ) , + os.path.join(".." , ".." , "Core", "regularisers_GPU" , "LLTROF" ) , + os.path.join(".." , ".." , "Core", "regularisers_GPU" , "NDF" ) , + os.path.join(".." , ".." , "Core", "regularisers_GPU" , "dTV_FGP" ) , + os.path.join(".." , ".." , "Core", "regularisers_GPU" , "DIFF4th" ) , + os.path.join(".." , ".." , "Core", "regularisers_GPU" , "PatchSelect" ) , + "."] + +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@] + +setup( + name='ccpi', + description='CCPi Core Imaging Library - Image regularisers', + version=cil_version, + cmdclass = {'build_ext': build_ext}, + ext_modules = [Extension("ccpi.filters.cpu_regularisers", + sources=[os.path.join("." , "src", "cpu_regularisers.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@ -- cgit v1.2.3 From b9dc6d0b947a2287d6761e0b0a35525dd0fe7e7f Mon Sep 17 00:00:00 2001 From: Tomas Kulhanek Date: Thu, 21 Feb 2019 04:09:41 -0500 Subject: FIX: directory links, install instructions --- src/Python/setup-regularisers.py.in | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/Python/setup-regularisers.py.in') diff --git a/src/Python/setup-regularisers.py.in b/src/Python/setup-regularisers.py.in index 462edda..59be768 100644 --- a/src/Python/setup-regularisers.py.in +++ b/src/Python/setup-regularisers.py.in @@ -34,18 +34,18 @@ extra_libraries = ['cilreg'] print ("extra_library_dirs " , extra_library_dirs) -extra_include_dirs += [os.path.join(".." , ".." , "Core"), - os.path.join(".." , ".." , "Core", "regularisers_CPU"), - os.path.join(".." , ".." , "Core", "inpainters_CPU"), - os.path.join(".." , ".." , "Core", "regularisers_GPU" , "TV_FGP" ) , - os.path.join(".." , ".." , "Core", "regularisers_GPU" , "TV_ROF" ) , - os.path.join(".." , ".." , "Core", "regularisers_GPU" , "TV_SB" ) , - os.path.join(".." , ".." , "Core", "regularisers_GPU" , "TGV" ) , - os.path.join(".." , ".." , "Core", "regularisers_GPU" , "LLTROF" ) , - os.path.join(".." , ".." , "Core", "regularisers_GPU" , "NDF" ) , - os.path.join(".." , ".." , "Core", "regularisers_GPU" , "dTV_FGP" ) , - os.path.join(".." , ".." , "Core", "regularisers_GPU" , "DIFF4th" ) , - os.path.join(".." , ".." , "Core", "regularisers_GPU" , "PatchSelect" ) , +extra_include_dirs += [os.path.join(".." , "Core"), + os.path.join(".." , "Core", "regularisers_CPU"), + os.path.join(".." , "Core", "inpainters_CPU"), + os.path.join(".." , "Core", "regularisers_GPU" , "TV_FGP" ) , + os.path.join(".." , "Core", "regularisers_GPU" , "TV_ROF" ) , + os.path.join(".." , "Core", "regularisers_GPU" , "TV_SB" ) , + os.path.join(".." , "Core", "regularisers_GPU" , "TGV" ) , + os.path.join(".." , "Core", "regularisers_GPU" , "LLTROF" ) , + os.path.join(".." , "Core", "regularisers_GPU" , "NDF" ) , + os.path.join(".." , "Core", "regularisers_GPU" , "dTV_FGP" ) , + os.path.join(".." , "Core", "regularisers_GPU" , "DIFF4th" ) , + os.path.join(".." , "Core", "regularisers_GPU" , "PatchSelect" ) , "."] if platform.system() == 'Windows': -- cgit v1.2.3