From 0f40ee8ad7d6e0b3b7059e5e1242d8ab97cd3caf Mon Sep 17 00:00:00 2001
From: Edoardo Pasca <edo.paskino@gmail.com>
Date: Thu, 3 Aug 2017 15:26:29 +0100
Subject: Added Python modules

Matlab2Python_utils.cpp contains utilities for handling numpy arrays.
Together with setup_test.py it creates a functional module for testing.

fista_module.cpp and setup.py are meant for the real fista module.
---
 src/Python/setup.py | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)
 create mode 100644 src/Python/setup.py

(limited to 'src/Python/setup.py')

diff --git a/src/Python/setup.py b/src/Python/setup.py
new file mode 100644
index 0000000..ffb9c02
--- /dev/null
+++ b/src/Python/setup.py
@@ -0,0 +1,58 @@
+#!/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 = [library_include_path+"/../lib", "C:\\Apps\\Miniconda2\\envs\\cil27\\Library\\lib"]
+extra_compile_args = ['-fopenmp','-O2', '-funsigned-char', '-Wall', '-std=c++0x']
+extra_libraries = []
+if platform.system() == 'Windows':
+    extra_compile_args[0:] = ['/DWIN32','/EHsc','/DBOOST_ALL_NO_LIB']   
+    extra_include_dirs += ["..\\ContourTree\\", "..\\win32\\" , "..\\Core\\","."]
+    if sys.version_info.major == 3 :   
+        extra_libraries += ['boost_python3-vc140-mt-1_64', 'boost_numpy3-vc140-mt-1_64']
+    else:
+        extra_libraries += ['boost_python-vc90-mt-1_64', 'boost_numpy-vc90-mt-1_64']
+else:
+    extra_include_dirs += ["../ContourTree/", "../Core/","."]
+    if sys.version_info.major == 3:
+        extra_libraries += ['boost_python3', 'boost_numpy3','gomp']
+    else:
+        extra_libraries += ['boost_python', 'boost_numpy','gomp']
+
+setup(
+    name='ccpi',
+	description='CCPi Core Imaging Library - FISTA Reconstruction Module',
+	version=cil_version,
+    cmdclass = {'build_ext': build_ext},
+    ext_modules = [Extension("fista",
+                             sources=[  "Matlab2Python_utils.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.reconstruction'},
+)
-- 
cgit v1.2.3