From bd874abcebae787ea1f1fddc138fb67a8abf9c9b Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Sat, 4 Aug 2018 23:06:25 +0100 Subject: working CMake project for Win and conda/no-conda --- Wrappers/Python/CMakeLists.txt | 58 +++++++++++++++++++++++++++++++- Wrappers/Python/conda-recipe/bld.bat | 15 +++++---- Wrappers/Python/conda-recipe/meta.yaml | 4 +-- Wrappers/Python/setup-regularisers.py.in | 4 ++- 4 files changed, 71 insertions(+), 10 deletions(-) (limited to 'Wrappers') diff --git a/Wrappers/Python/CMakeLists.txt b/Wrappers/Python/CMakeLists.txt index fa1a30b..464c916 100644 --- a/Wrappers/Python/CMakeLists.txt +++ b/Wrappers/Python/CMakeLists.txt @@ -68,4 +68,60 @@ else() set(SETUP_GPU_WRAPPERS "#CUDA NOT FOUND") endif() -configure_file("setup-regularisers.py.in" "setup-regularisers.py") +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/setup-regularisers.py.in" "${CMAKE_CURRENT_BINARY_DIR}/setup-regularisers.py") + + +find_package(PythonInterp) +find_package(PythonLibs) +if (PYTHONINTERP_FOUND) + message(STATUS "Found PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}") + message(STATUS "Python version ${PYTHON_VERSION_STRING}") +endif() +if (PYTHONLIBS_FOUND) + message(STATUS "Found PYTHON_INCLUDE_DIRS=${PYTHON_INCLUDE_DIRS}") + message(STATUS "Found PYTHON_LIBRARIES=${PYTHON_LIBRARIES}") +endif() + +if (PYTHONINTERP_FOUND) + message("Python found " ${PYTHON_EXECUTABLE}) + set(SETUP_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/setup-regularisers.py.in") + set(SETUP_PY "${CMAKE_CURRENT_BINARY_DIR}/setup-regularisers.py") + #set(DEPS "${CMAKE_CURRENT_SOURCE_DIR}/module/__init__.py") + set (DEPS "${CMAKE_BINARY_DIR}/Core/") + set(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/build/timestamp") + + configure_file(${SETUP_PY_IN} ${SETUP_PY}) + + message("Core binary dir " ${CMAKE_BINARY_DIR}/Core/${CMAKE_BUILD_TYPE}) + + if (CONDA_BUILD) + add_custom_command(OUTPUT ${OUTPUT} + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/src + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/ccpi ${CMAKE_CURRENT_BINARY_DIR}/ccpi + COMMAND ${CMAKE_COMMAND} -E env CIL_VERSION=${CIL_VERSION} + PREFIX=${CMAKE_SOURCE_DIR}/Core + LIBRARY_INC=${CMAKE_SOURCE_DIR}/Core + LIBRARY_LIB=${CMAKE_BINARY_DIR}/Core + ${PYTHON_EXECUTABLE} ${SETUP_PY} install + COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT} + DEPENDS cilreg) + + else() + add_custom_command(OUTPUT ${OUTPUT} + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/src + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/ccpi ${CMAKE_CURRENT_BINARY_DIR}/ccpi + COMMAND ${CMAKE_COMMAND} -E env CIL_VERSION=${CIL_VERSION} + PREFIX=${CMAKE_SOURCE_DIR}/Core + LIBRARY_INC=${CMAKE_SOURCE_DIR}/Core + LIBRARY_LIB=${CMAKE_BINARY_DIR}/Core/${CMAKE_BUILD_TYPE} + ${PYTHON_EXECUTABLE} ${SETUP_PY} build_ext --inplace + COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT} + DEPENDS cilreg) + + endif() + + + add_custom_target(PythonWrapper ALL DEPENDS ${OUTPUT}) + + #install(CODE "execute_process(COMMAND ${PYTHON} ${SETUP_PY} install)") +endif() \ No newline at end of file diff --git a/Wrappers/Python/conda-recipe/bld.bat b/Wrappers/Python/conda-recipe/bld.bat index e47f8d9..e58808b 100644 --- a/Wrappers/Python/conda-recipe/bld.bat +++ b/Wrappers/Python/conda-recipe/bld.bat @@ -6,12 +6,15 @@ exit 1 mkdir "%SRC_DIR%\ccpi" ROBOCOPY /E "%RECIPE_DIR%\..\.." "%SRC_DIR%\ccpi" ROBOCOPY /E "%RECIPE_DIR%\..\..\..\Core" "%SRC_DIR%\Core" -cd %SRC_DIR%\ccpi\Python +::cd %SRC_DIR%\ccpi\Python +cd %SRC_DIR% :: issue cmake to create setup.py -cmake . +cmake -G "NMake Makefiles" %RECIPE_DIR%\..\..\..\ -DBUILD_WRAPPERS=ON -DCONDA_BUILD=ON -DCMAKE_BUILD_TYPE="Release" -DLIBRARY_LIB="%CONDA_PREFIX%\lib" -DLIBRARY_INC="%CONDA_PREFIX%" -DCMAKE_INSTALL_PREFIX="%PREFIX%\Library" -%PYTHON% setup-regularisers.py build_ext -if errorlevel 1 exit 1 -%PYTHON% setup-regularisers.py install -if errorlevel 1 exit 1 +::%PYTHON% setup-regularisers.py build_ext +::if errorlevel 1 exit 1 +::%PYTHON% setup-regularisers.py install +::if errorlevel 1 exit 1 +nmake install +if errorlevel 1 exit 1 \ No newline at end of file diff --git a/Wrappers/Python/conda-recipe/meta.yaml b/Wrappers/Python/conda-recipe/meta.yaml index ca28bae..115fcf5 100644 --- a/Wrappers/Python/conda-recipe/meta.yaml +++ b/Wrappers/Python/conda-recipe/meta.yaml @@ -21,7 +21,7 @@ requirements: - numpy x.x - setuptools - cython - - cil_regulariser =={{ environ['CIL_VERSION'] }} + # - cil_regulariser =={{ environ['CIL_VERSION'] }} - vc 14 # [win and py36] - vc 14 # [win and py35] - vc 9 # [win and py27] @@ -30,7 +30,7 @@ requirements: run: - python - numpy x.x - - cil_regulariser =={{ environ['CIL_VERSION'] }} + # - cil_regulariser =={{ environ['CIL_VERSION'] }} - vc 14 # [win and py36] - vc 14 # [win and py35] - vc 9 # [win and py27] diff --git a/Wrappers/Python/setup-regularisers.py.in b/Wrappers/Python/setup-regularisers.py.in index 7108683..542dcb4 100644 --- a/Wrappers/Python/setup-regularisers.py.in +++ b/Wrappers/Python/setup-regularisers.py.in @@ -27,11 +27,13 @@ except: 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_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"), -- cgit v1.2.3 From a73d878e3f444316a2bb92b851f790d93992c46d Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Sat, 4 Aug 2018 23:07:29 +0100 Subject: beginning of CMake compiled Matlab binding --- Wrappers/CMakeLists.txt | 9 +++++++++ Wrappers/Matlab/CMakeLists.txt | 29 +++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100755 Wrappers/Matlab/CMakeLists.txt (limited to 'Wrappers') diff --git a/Wrappers/CMakeLists.txt b/Wrappers/CMakeLists.txt index cbe2fec..9ae1be1 100644 --- a/Wrappers/CMakeLists.txt +++ b/Wrappers/CMakeLists.txt @@ -11,4 +11,13 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + +find_package(Matlab) +if (MATLAB_FOUND) + message(Matlab) + add_subdirectory(Matlab) +else() + message("Matlab not found") +endif() + add_subdirectory(Python) \ No newline at end of file diff --git a/Wrappers/Matlab/CMakeLists.txt b/Wrappers/Matlab/CMakeLists.txt new file mode 100755 index 0000000..349baf6 --- /dev/null +++ b/Wrappers/Matlab/CMakeLists.txt @@ -0,0 +1,29 @@ +project(regulariserMatlab) + +message('<<<<<<<<<<>>>>>>>>>>>>') + +message('Compiling ROF-TV...') +#mex ROF_TV.c ROF_TV_core.c utils.c COMPFLAGS="\$COMPFLAGS -fopenmp -Wall -std=c99" +#movefile('ROF_TV.mex*',Pathmove); + + +find_package(Matlab COMPONENTS MAIN_PROGRAM MX_LIBRARY ENG_LIBRARY ) +message ("Matlab mex library " ${Matlab_LIBRARIES}) + + + +#C:\Users\ofn77899\Documents\Projects\CCPi\GitHub\CCPi-FISTA_Reconstruction\Core\regularisers_CPU +matlab_add_mex( + NAME MatlabWrapper + SRC + #${CMAKE_SOURCE_DIR}/Wrappers/Matlab/mex_compile/regularisers_CPU/ROF_TV.c + ${CMAKE_SOURCE_DIR}/Wrappers/Matlab/mex_compile/regularisers_CPU/TNV.c + LINK_TO cilreg ${Matlab_LIBRARIES} + ) + +target_include_directories(MatlabWrapper + PUBLIC ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU + ${CMAKE_SOURCE_DIR}/Core/regularisers_GPU + ${CMAKE_SOURCE_DIR}/Core/inpainters_CPU + ${CMAKE_SOURCE_DIR}/Core/ + ${MATLAB_INCLUDE_DIR}) \ No newline at end of file -- cgit v1.2.3 From e6cb12cc6603cff6e8837f7a922a740fb2ee3b02 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Sun, 5 Aug 2018 13:25:46 +0100 Subject: add all CPU Matlab wrappers --- Wrappers/Matlab/CMakeLists.txt | 112 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 99 insertions(+), 13 deletions(-) (limited to 'Wrappers') diff --git a/Wrappers/Matlab/CMakeLists.txt b/Wrappers/Matlab/CMakeLists.txt index 349baf6..012bf96 100755 --- a/Wrappers/Matlab/CMakeLists.txt +++ b/Wrappers/Matlab/CMakeLists.txt @@ -1,29 +1,115 @@ project(regulariserMatlab) -message('<<<<<<<<<<>>>>>>>>>>>>') -message('Compiling ROF-TV...') -#mex ROF_TV.c ROF_TV_core.c utils.c COMPFLAGS="\$COMPFLAGS -fopenmp -Wall -std=c99" -#movefile('ROF_TV.mex*',Pathmove); +find_package(Matlab REQUIRED COMPONENTS MAIN_PROGRAM MX_LIBRARY ENG_LIBRARY ) -find_package(Matlab COMPONENTS MAIN_PROGRAM MX_LIBRARY ENG_LIBRARY ) -message ("Matlab mex library " ${Matlab_LIBRARIES}) +#C:\Users\ofn77899\Documents\Projects\CCPi\GitHub\CCPi-FISTA_Reconstruction\Core\regularisers_CPU +# matlab_add_mex( + # NAME CPU_ROF + # SRC + # ${CMAKE_SOURCE_DIR}/Wrappers/Matlab/mex_compile/regularisers_CPU/ROF_TV.c + # LINK_TO cilreg ${Matlab_LIBRARIES} + # ) + +# target_include_directories(CPU_ROF + # PUBLIC ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU + # ${CMAKE_SOURCE_DIR}/Core/regularisers_GPU + # ${CMAKE_SOURCE_DIR}/Core/inpainters_CPU + # ${CMAKE_SOURCE_DIR}/Core/ + # ${MATLAB_INCLUDE_DIR}) + + # matlab_add_mex( + # NAME CPU_TNV + # SRC + # ${CMAKE_SOURCE_DIR}/Wrappers/Matlab/mex_compile/regularisers_CPU/TNV.c + # LINK_TO cilreg ${Matlab_LIBRARIES} + # ) + +# target_include_directories(CPU_TNV + # PUBLIC ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU + # ${CMAKE_SOURCE_DIR}/Core/regularisers_GPU + # ${CMAKE_SOURCE_DIR}/Core/inpainters_CPU + # ${CMAKE_SOURCE_DIR}/Core/ + # ${MATLAB_INCLUDE_DIR}) + +#set (CPU_MEX_FILES "regularisers_CPU/TNV.c;regularisers_CPU/ROF_TV.c") +#set (MEX_TARGETS "CPU_TNV;CPU_ROF") +#list(APPEND MEX_TARGETS "CPU_TNV") +#list(APPEND MEX_TARGETS "CPU_ROF") +set (CPU_TARGETS "CPU_TNV;CPU_ROF") +file(GLOB CPU_MEX_FILES + "${CMAKE_SOURCE_DIR}/Wrappers/Matlab/mex_compile/regularisers_CPU/*.c" + "${CMAKE_SOURCE_DIR}/Wrappers/Matlab/mex_compile/inpainters_CPU/*.c" +) +list(LENGTH CPU_MEX_FILES num) -#C:\Users\ofn77899\Documents\Projects\CCPi\GitHub\CCPi-FISTA_Reconstruction\Core\regularisers_CPU -matlab_add_mex( - NAME MatlabWrapper + +MATH(EXPR num "${num}-1") +#set(num "-1") + +foreach(tgt RANGE ${num}) + message("number " ${tgt}) + #list(GET CPU_TARGETS ${tgt} current_target) + list(GET CPU_MEX_FILES ${tgt} current_file) + get_filename_component(current_target ${current_file} NAME) + message("matlab_add_mex " ${current_target}) + matlab_add_mex( + NAME ${current_target} SRC - #${CMAKE_SOURCE_DIR}/Wrappers/Matlab/mex_compile/regularisers_CPU/ROF_TV.c - ${CMAKE_SOURCE_DIR}/Wrappers/Matlab/mex_compile/regularisers_CPU/TNV.c + ${current_file} LINK_TO cilreg ${Matlab_LIBRARIES} ) -target_include_directories(MatlabWrapper +target_include_directories(${current_target} PUBLIC ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU ${CMAKE_SOURCE_DIR}/Core/regularisers_GPU ${CMAKE_SOURCE_DIR}/Core/inpainters_CPU ${CMAKE_SOURCE_DIR}/Core/ - ${MATLAB_INCLUDE_DIR}) \ No newline at end of file + ${MATLAB_INCLUDE_DIR}) + + list(APPEND CPU_MEX_TARGETS ${current_target}) +endforeach() + +add_custom_target(MatlabWrapper DEPENDS ${CPU_MEX_TARGETS}) + +find_package(CUDA) +if (CUDA_FOUND) + file(GLOB GPU_MEX_FILES + "${CMAKE_SOURCE_DIR}/Wrappers/Matlab/mex_compile/regularisers_GPU/*.c" + ) + + list(LENGTH GPU_MEX_FILES num) + + + MATH(EXPR num "${num}-1") +#set(num "-1") + + foreach(tgt RANGE ${num}) + message("number " ${tgt}) + #list(GET CPU_TARGETS ${tgt} current_target) + list(GET GPU_MEX_FILES ${tgt} current_file) + get_filename_component(current_target ${current_file} NAME) + message("matlab_add_mex " ${current_target}) + matlab_add_mex( + NAME ${current_target} + SRC + ${current_file} + LINK_TO cilreg ${Matlab_LIBRARIES} + ) + + target_include_directories(${current_target} + PUBLIC ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU + ${CMAKE_SOURCE_DIR}/Core/regularisers_GPU + ${CMAKE_SOURCE_DIR}/Core/inpainters_CPU + ${CMAKE_SOURCE_DIR}/Core/ + ${MATLAB_INCLUDE_DIR}) + + list(APPEND CPU_MEX_TARGETS ${current_target}) + endforeach() + + add_custom_target(MatlabWrapperGPU DEPENDS ${GPU_MEX_TARGETS}) + +endif() -- cgit v1.2.3 From 2a2eb0e083991753a8d9247b63fea8f37559a6d7 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Sun, 5 Aug 2018 15:25:41 +0100 Subject: updated conda recipe build.sh --- Wrappers/Python/conda-recipe/build.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'Wrappers') diff --git a/Wrappers/Python/conda-recipe/build.sh b/Wrappers/Python/conda-recipe/build.sh index 8b05663..ff6583a 100644 --- a/Wrappers/Python/conda-recipe/build.sh +++ b/Wrappers/Python/conda-recipe/build.sh @@ -7,13 +7,14 @@ mkdir "$SRC_DIR/ccpi" cp -rv "$RECIPE_DIR/../.." "$SRC_DIR/ccpi" cp -rv "$RECIPE_DIR/../../../Core" "$SRC_DIR/Core" -cd $SRC_DIR/ccpi/Python +cd $SRC_DIR -echo "$SRC_DIR/ccpi/Python" +cmake -G "NMake Makefiles" $RECIPE_DIR/../../../ -DBUILD_WRAPPERS=ON -DCONDA_BUILD=ON -DCMAKE_BUILD_TYPE="Release" -DLIBRARY_LIB=$CONDA_PREFIX/lib -DLIBRARY_INC=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$PREFIX/Library" -cmake . -$PYTHON setup-regularisers.py build_ext -$PYTHON setup-regularisers.py install +make install + +#$PYTHON setup-regularisers.py build_ext +#$PYTHON setup-regularisers.py install -- cgit v1.2.3 From 31fc2679552704c90887025f069264b7d9904f7f Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Sun, 5 Aug 2018 15:49:10 +0100 Subject: fix conda linux build script --- Wrappers/Python/conda-recipe/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Wrappers') diff --git a/Wrappers/Python/conda-recipe/build.sh b/Wrappers/Python/conda-recipe/build.sh index ff6583a..9706301 100644 --- a/Wrappers/Python/conda-recipe/build.sh +++ b/Wrappers/Python/conda-recipe/build.sh @@ -9,7 +9,7 @@ cp -rv "$RECIPE_DIR/../../../Core" "$SRC_DIR/Core" cd $SRC_DIR -cmake -G "NMake Makefiles" $RECIPE_DIR/../../../ -DBUILD_WRAPPERS=ON -DCONDA_BUILD=ON -DCMAKE_BUILD_TYPE="Release" -DLIBRARY_LIB=$CONDA_PREFIX/lib -DLIBRARY_INC=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$PREFIX/Library" +cmake -G "Unix Makefiles" $RECIPE_DIR/../../../ -DBUILD_WRAPPERS=ON -DCONDA_BUILD=ON -DCMAKE_BUILD_TYPE="Release" -DLIBRARY_LIB=$CONDA_PREFIX/lib -DLIBRARY_INC=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$PREFIX make install -- cgit v1.2.3 From a490e0a75e810591f87c73e41965fad9187f6cd1 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Sun, 5 Aug 2018 15:56:52 +0100 Subject: added BUILD_PYTHON_WRAPPERS BUILD_MATLAB_WRAPPERS BUILD_CUDA options --- Wrappers/CMakeLists.txt | 14 +++----- Wrappers/Matlab/CMakeLists.txt | 68 +++++++++++++++++++----------------- Wrappers/Python/CMakeLists.txt | 52 +++++++++++++-------------- Wrappers/Python/conda-recipe/bld.bat | 2 +- 4 files changed, 67 insertions(+), 69 deletions(-) (limited to 'Wrappers') diff --git a/Wrappers/CMakeLists.txt b/Wrappers/CMakeLists.txt index 9ae1be1..8d02df6 100644 --- a/Wrappers/CMakeLists.txt +++ b/Wrappers/CMakeLists.txt @@ -11,13 +11,9 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -find_package(Matlab) -if (MATLAB_FOUND) - message(Matlab) - add_subdirectory(Matlab) -else() - message("Matlab not found") +if (BUILD_MATLAB_WRAPPERS) + add_subdirectory(Matlab) endif() - -add_subdirectory(Python) \ No newline at end of file +if (BUILD_PYTHON_WRAPPERS) + add_subdirectory(Python) +endif() \ No newline at end of file diff --git a/Wrappers/Matlab/CMakeLists.txt b/Wrappers/Matlab/CMakeLists.txt index 012bf96..e9cc6a8 100755 --- a/Wrappers/Matlab/CMakeLists.txt +++ b/Wrappers/Matlab/CMakeLists.txt @@ -75,41 +75,43 @@ endforeach() add_custom_target(MatlabWrapper DEPENDS ${CPU_MEX_TARGETS}) -find_package(CUDA) -if (CUDA_FOUND) - file(GLOB GPU_MEX_FILES - "${CMAKE_SOURCE_DIR}/Wrappers/Matlab/mex_compile/regularisers_GPU/*.c" - ) +if (BUILD_CUDA) + find_package(CUDA) + if (CUDA_FOUND) + file(GLOB GPU_MEX_FILES + "${CMAKE_SOURCE_DIR}/Wrappers/Matlab/mex_compile/regularisers_GPU/*.c" + ) - list(LENGTH GPU_MEX_FILES num) + list(LENGTH GPU_MEX_FILES num) - MATH(EXPR num "${num}-1") -#set(num "-1") + MATH(EXPR num "${num}-1") + #set(num "-1") - foreach(tgt RANGE ${num}) - message("number " ${tgt}) - #list(GET CPU_TARGETS ${tgt} current_target) - list(GET GPU_MEX_FILES ${tgt} current_file) - get_filename_component(current_target ${current_file} NAME) - message("matlab_add_mex " ${current_target}) - matlab_add_mex( - NAME ${current_target} - SRC - ${current_file} - LINK_TO cilreg ${Matlab_LIBRARIES} - ) - - target_include_directories(${current_target} - PUBLIC ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU - ${CMAKE_SOURCE_DIR}/Core/regularisers_GPU - ${CMAKE_SOURCE_DIR}/Core/inpainters_CPU - ${CMAKE_SOURCE_DIR}/Core/ - ${MATLAB_INCLUDE_DIR}) - - list(APPEND CPU_MEX_TARGETS ${current_target}) - endforeach() - - add_custom_target(MatlabWrapperGPU DEPENDS ${GPU_MEX_TARGETS}) + foreach(tgt RANGE ${num}) + message("number " ${tgt}) + #list(GET CPU_TARGETS ${tgt} current_target) + list(GET GPU_MEX_FILES ${tgt} current_file) + get_filename_component(current_target ${current_file} NAME) + message("matlab_add_mex " ${current_target}) + matlab_add_mex( + NAME ${current_target} + SRC + ${current_file} + LINK_TO cilreg ${Matlab_LIBRARIES} + ) + + target_include_directories(${current_target} + PUBLIC ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU + ${CMAKE_SOURCE_DIR}/Core/regularisers_GPU + ${CMAKE_SOURCE_DIR}/Core/inpainters_CPU + ${CMAKE_SOURCE_DIR}/Core/ + ${MATLAB_INCLUDE_DIR}) + + list(APPEND CPU_MEX_TARGETS ${current_target}) + endforeach() + + add_custom_target(MatlabWrapperGPU DEPENDS ${GPU_MEX_TARGETS}) -endif() + endif() +endif() \ No newline at end of file diff --git a/Wrappers/Python/CMakeLists.txt b/Wrappers/Python/CMakeLists.txt index 464c916..52f3f39 100644 --- a/Wrappers/Python/CMakeLists.txt +++ b/Wrappers/Python/CMakeLists.txt @@ -41,33 +41,33 @@ elseif(UNIX) endif() # GPU regularisers - -find_package(CUDA) -if (CUDA_FOUND) - message("CUDA FOUND") - set (SETUP_GPU_WRAPPERS "extra_libraries += ['cilregcuda']\n\ -setup( \n\ - name='ccpi', \n\ - description='CCPi Core Imaging Library - Image regularisers GPU',\n\ - version=cil_version,\n\ - cmdclass = {'build_ext': build_ext},\n\ - ext_modules = [Extension('ccpi.filters.gpu_regularisers',\n\ - sources=[ \n\ - os.path.join('.' , 'src', 'gpu_regularisers.pyx' ),\n\ - ],\n\ - include_dirs=extra_include_dirs, \n\ - library_dirs=extra_library_dirs, \n\ - extra_compile_args=extra_compile_args, \n\ - libraries=extra_libraries ), \n\ - ],\n\ - zip_safe = False, \n\ - packages = {'ccpi','ccpi.filters'},\n\ -)") -else() - message("CUDA NOT FOUND") - set(SETUP_GPU_WRAPPERS "#CUDA NOT FOUND") +if (BUILD_CUDA) + find_package(CUDA) + if (CUDA_FOUND) + message("CUDA FOUND") + set (SETUP_GPU_WRAPPERS "extra_libraries += ['cilregcuda']\n\ + setup( \n\ + name='ccpi', \n\ + description='CCPi Core Imaging Library - Image regularisers GPU',\n\ + version=cil_version,\n\ + cmdclass = {'build_ext': build_ext},\n\ + ext_modules = [Extension('ccpi.filters.gpu_regularisers',\n\ + sources=[ \n\ + os.path.join('.' , 'src', 'gpu_regularisers.pyx' ),\n\ + ],\n\ + include_dirs=extra_include_dirs, \n\ + library_dirs=extra_library_dirs, \n\ + extra_compile_args=extra_compile_args, \n\ + libraries=extra_libraries ), \n\ + ],\n\ + zip_safe = False, \n\ + packages = {'ccpi','ccpi.filters'},\n\ + )") + else() + message("CUDA NOT FOUND") + set(SETUP_GPU_WRAPPERS "#CUDA NOT FOUND") + endif() endif() - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/setup-regularisers.py.in" "${CMAKE_CURRENT_BINARY_DIR}/setup-regularisers.py") diff --git a/Wrappers/Python/conda-recipe/bld.bat b/Wrappers/Python/conda-recipe/bld.bat index e58808b..6c84355 100644 --- a/Wrappers/Python/conda-recipe/bld.bat +++ b/Wrappers/Python/conda-recipe/bld.bat @@ -10,7 +10,7 @@ ROBOCOPY /E "%RECIPE_DIR%\..\..\..\Core" "%SRC_DIR%\Core" cd %SRC_DIR% :: issue cmake to create setup.py -cmake -G "NMake Makefiles" %RECIPE_DIR%\..\..\..\ -DBUILD_WRAPPERS=ON -DCONDA_BUILD=ON -DCMAKE_BUILD_TYPE="Release" -DLIBRARY_LIB="%CONDA_PREFIX%\lib" -DLIBRARY_INC="%CONDA_PREFIX%" -DCMAKE_INSTALL_PREFIX="%PREFIX%\Library" +cmake -G "NMake Makefiles" %RECIPE_DIR%\..\..\..\ -DBUILD_PYTHON_WRAPPERS=ON -DCONDA_BUILD=ON -DBUILD_CUDA=OFF -DCMAKE_BUILD_TYPE="Release" -DLIBRARY_LIB="%CONDA_PREFIX%\lib" -DLIBRARY_INC="%CONDA_PREFIX%" -DCMAKE_INSTALL_PREFIX="%PREFIX%\Library" ::%PYTHON% setup-regularisers.py build_ext ::if errorlevel 1 exit 1 -- cgit v1.2.3 From c025620ae1d6f4bfcf823de716336277a2ecb621 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Sun, 5 Aug 2018 16:28:39 +0100 Subject: working recipe for Linux GPU. Needs test --- Wrappers/Python/CMakeLists.txt | 4 ++-- Wrappers/Python/conda-recipe/build.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'Wrappers') diff --git a/Wrappers/Python/CMakeLists.txt b/Wrappers/Python/CMakeLists.txt index 52f3f39..b4d334f 100644 --- a/Wrappers/Python/CMakeLists.txt +++ b/Wrappers/Python/CMakeLists.txt @@ -46,7 +46,7 @@ if (BUILD_CUDA) if (CUDA_FOUND) message("CUDA FOUND") set (SETUP_GPU_WRAPPERS "extra_libraries += ['cilregcuda']\n\ - setup( \n\ +setup( \n\ name='ccpi', \n\ description='CCPi Core Imaging Library - Image regularisers GPU',\n\ version=cil_version,\n\ @@ -124,4 +124,4 @@ if (PYTHONINTERP_FOUND) add_custom_target(PythonWrapper ALL DEPENDS ${OUTPUT}) #install(CODE "execute_process(COMMAND ${PYTHON} ${SETUP_PY} install)") -endif() \ No newline at end of file +endif() diff --git a/Wrappers/Python/conda-recipe/build.sh b/Wrappers/Python/conda-recipe/build.sh index 9706301..1247707 100644 --- a/Wrappers/Python/conda-recipe/build.sh +++ b/Wrappers/Python/conda-recipe/build.sh @@ -9,7 +9,7 @@ cp -rv "$RECIPE_DIR/../../../Core" "$SRC_DIR/Core" cd $SRC_DIR -cmake -G "Unix Makefiles" $RECIPE_DIR/../../../ -DBUILD_WRAPPERS=ON -DCONDA_BUILD=ON -DCMAKE_BUILD_TYPE="Release" -DLIBRARY_LIB=$CONDA_PREFIX/lib -DLIBRARY_INC=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$PREFIX +cmake -G "Unix Makefiles" $RECIPE_DIR/../../../ -DBUILD_PYTHON_WRAPPERS=ON -DCONDA_BUILD=ON -DBUILD_CUDA=ON -DCMAKE_BUILD_TYPE="Release" -DLIBRARY_LIB=$CONDA_PREFIX/lib -DLIBRARY_INC=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$PREFIX make install -- cgit v1.2.3 From 4fa0c5bcd9e362cbdf2211edc85f30ec1dafee3b Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Mon, 6 Aug 2018 21:38:06 +0100 Subject: add destination for wrapper --- Wrappers/Matlab/CMakeLists.txt | 24 ++++++++++++++++++------ Wrappers/Python/CMakeLists.txt | 13 +++++++++++-- 2 files changed, 29 insertions(+), 8 deletions(-) (limited to 'Wrappers') diff --git a/Wrappers/Matlab/CMakeLists.txt b/Wrappers/Matlab/CMakeLists.txt index e9cc6a8..9cbade9 100755 --- a/Wrappers/Matlab/CMakeLists.txt +++ b/Wrappers/Matlab/CMakeLists.txt @@ -2,6 +2,13 @@ project(regulariserMatlab) find_package(Matlab REQUIRED COMPONENTS MAIN_PROGRAM MX_LIBRARY ENG_LIBRARY ) +set(MATLAB_DEST_DIR "" CACHE PATH "Directory of the Matlab wrappers") +if (MATLAB_DEST_DIR) +set(MATLAB_DEST "${MATLAB_DEST_DIR}") +else() +set(MATLAB_DEST "${CMAKE_INSTALL_PREFIX}/matlab") +endif() +message(STATUS "Matlab wrappers will be installed in " ${MATLAB_DEST}) #C:\Users\ofn77899\Documents\Projects\CCPi\GitHub\CCPi-FISTA_Reconstruction\Core\regularisers_CPU @@ -38,7 +45,6 @@ find_package(Matlab REQUIRED COMPONENTS MAIN_PROGRAM MX_LIBRARY ENG_LIBRARY ) #list(APPEND MEX_TARGETS "CPU_TNV") #list(APPEND MEX_TARGETS "CPU_ROF") -set (CPU_TARGETS "CPU_TNV;CPU_ROF") file(GLOB CPU_MEX_FILES "${CMAKE_SOURCE_DIR}/Wrappers/Matlab/mex_compile/regularisers_CPU/*.c" "${CMAKE_SOURCE_DIR}/Wrappers/Matlab/mex_compile/inpainters_CPU/*.c" @@ -53,13 +59,17 @@ MATH(EXPR num "${num}-1") foreach(tgt RANGE ${num}) message("number " ${tgt}) #list(GET CPU_TARGETS ${tgt} current_target) - list(GET CPU_MEX_FILES ${tgt} current_file) - get_filename_component(current_target ${current_file} NAME) - message("matlab_add_mex " ${current_target}) + list(GET CPU_MEX_FILES ${tgt} current_file_name) + get_filename_component(current_file ${current_file_name} NAME) + string(REGEX MATCH "(.+).c" match ${current_file}) + if (NOT ${match} EQUAL "" ) + set (current_target ${CMAKE_MATCH_1}) + endif() + message("matlab_add_mex target " ${current_file} " and " ${current_target}) matlab_add_mex( NAME ${current_target} SRC - ${current_file} + ${current_file_name} LINK_TO cilreg ${Matlab_LIBRARIES} ) @@ -71,6 +81,7 @@ target_include_directories(${current_target} ${MATLAB_INCLUDE_DIR}) list(APPEND CPU_MEX_TARGETS ${current_target}) + INSTALL(TARGETS ${current_target} DESTINATION "${MATLAB_DEST}") endforeach() add_custom_target(MatlabWrapper DEPENDS ${CPU_MEX_TARGETS}) @@ -108,7 +119,8 @@ if (BUILD_CUDA) ${CMAKE_SOURCE_DIR}/Core/ ${MATLAB_INCLUDE_DIR}) - list(APPEND CPU_MEX_TARGETS ${current_target}) + list(APPEND GPU_MEX_TARGETS ${current_target}) + INSTALL(TARGETS ${current_target} DESTINATION "${MATLAB_DEST}") endforeach() add_custom_target(MatlabWrapperGPU DEPENDS ${GPU_MEX_TARGETS}) diff --git a/Wrappers/Python/CMakeLists.txt b/Wrappers/Python/CMakeLists.txt index 52f3f39..2ab8f86 100644 --- a/Wrappers/Python/CMakeLists.txt +++ b/Wrappers/Python/CMakeLists.txt @@ -16,7 +16,16 @@ find_package(PythonInterp REQUIRED) if (PYTHONINTERP_FOUND) message ("Current Python " ${PYTHON_VERSION_STRING} " found " ${PYTHON_EXECUTABLE}) endif() - +if (CONDA_BUILD) +else() +set(PYTHON_DEST_DIR "" CACHE PATH "Directory of the Matlab wrappers") + if (PYTHON_DEST_DIR) + set(PYTHON_DEST "${PYTHON_DEST_DIR}") + else() + set(PYTHON_DEST "${CMAKE_INSTALL_PREFIX}/python") + endif() + message(STATUS "Python wrappers will be installed in " ${PYTHON_DEST}) +endif() ## Build the regularisers package as a library message("Creating Regularisers as shared library") @@ -46,7 +55,7 @@ if (BUILD_CUDA) if (CUDA_FOUND) message("CUDA FOUND") set (SETUP_GPU_WRAPPERS "extra_libraries += ['cilregcuda']\n\ - setup( \n\ +setup( \n\ name='ccpi', \n\ description='CCPi Core Imaging Library - Image regularisers GPU',\n\ version=cil_version,\n\ -- cgit v1.2.3 From ff5cb4f35609b0b02698978fb8210dc7d09f0190 Mon Sep 17 00:00:00 2001 From: algol Date: Fri, 10 Aug 2018 15:03:34 +0100 Subject: bugfix initialisation of array --- Wrappers/Matlab/CMakeLists.txt | 25 +++++++++++++++++---- .../Matlab/mex_compile/regularisers_CPU/ROF_TV.c | 26 ++++++++++++++++------ 2 files changed, 40 insertions(+), 11 deletions(-) (limited to 'Wrappers') diff --git a/Wrappers/Matlab/CMakeLists.txt b/Wrappers/Matlab/CMakeLists.txt index 9cbade9..cd46051 100755 --- a/Wrappers/Matlab/CMakeLists.txt +++ b/Wrappers/Matlab/CMakeLists.txt @@ -47,17 +47,22 @@ message(STATUS "Matlab wrappers will be installed in " ${MATLAB_DEST}) file(GLOB CPU_MEX_FILES "${CMAKE_SOURCE_DIR}/Wrappers/Matlab/mex_compile/regularisers_CPU/*.c" - "${CMAKE_SOURCE_DIR}/Wrappers/Matlab/mex_compile/inpainters_CPU/*.c" + #"${CMAKE_SOURCE_DIR}/Wrappers/Matlab/mex_compile/regularisers_GPU/*.c" ) +#message("CPU_MEX_FILES " ${CPU_MEX_FILES}) + list(LENGTH CPU_MEX_FILES num) MATH(EXPR num "${num}-1") #set(num "-1") +message("found ${num} files") -foreach(tgt RANGE ${num}) +foreach(tgt RANGE 0 ${num}) message("number " ${tgt}) + list(LENGTH CPU_MEX_FILES num2) + message("the list is ${num2}") #list(GET CPU_TARGETS ${tgt} current_target) list(GET CPU_MEX_FILES ${tgt} current_file_name) get_filename_component(current_file ${current_file_name} NAME) @@ -70,6 +75,18 @@ foreach(tgt RANGE ${num}) NAME ${current_target} SRC ${current_file_name} + ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/FGP_TV_core.c + ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/SB_TV_core.c + ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/TGV_core.c + ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/Diffusion_core.c + ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/Diffus4th_order_core.c + ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/LLT_ROF_core.c + ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/ROF_TV_core.c + ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/FGP_dTV_core.c + ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/TNV_core.c + ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/utils.c + ${CMAKE_SOURCE_DIR}/Core/inpainters_CPU/Diffusion_Inpaint_core.c + ${CMAKE_SOURCE_DIR}/Core/inpainters_CPU/NonlocalMarching_Inpaint_core.c LINK_TO cilreg ${Matlab_LIBRARIES} ) @@ -79,7 +96,7 @@ target_include_directories(${current_target} ${CMAKE_SOURCE_DIR}/Core/inpainters_CPU ${CMAKE_SOURCE_DIR}/Core/ ${MATLAB_INCLUDE_DIR}) - + set_property(TARGET ${current_target} PROPERTY C_STANDARD 99) list(APPEND CPU_MEX_TARGETS ${current_target}) INSTALL(TARGETS ${current_target} DESTINATION "${MATLAB_DEST}") endforeach() @@ -126,4 +143,4 @@ if (BUILD_CUDA) add_custom_target(MatlabWrapperGPU DEPENDS ${GPU_MEX_TARGETS}) endif() -endif() \ No newline at end of file +endif() diff --git a/Wrappers/Matlab/mex_compile/regularisers_CPU/ROF_TV.c b/Wrappers/Matlab/mex_compile/regularisers_CPU/ROF_TV.c index 6b9e1ea..ca484ba 100644 --- a/Wrappers/Matlab/mex_compile/regularisers_CPU/ROF_TV.c +++ b/Wrappers/Matlab/mex_compile/regularisers_CPU/ROF_TV.c @@ -1,3 +1,4 @@ + /* * This work is part of the Core Imaging Library developed by * Visual Analytics and Imaging System Group of the Science Technology @@ -43,11 +44,12 @@ void mexFunction( int nrhs, const mxArray *prhs[]) { - int number_of_dims, iter_numb, dimX, dimY, dimZ; - const int *dim_array; - float *Input, *Output=NULL, lambda, tau; + int number_of_dims, iter_numb, j; + mwSize dimX, dimY, dimZ; + const mwSize *dim_array_i; + float *Input, *Output=NULL, lambda, tau; - dim_array = mxGetDimensions(prhs[0]); + dim_array_i = mxGetDimensions(prhs[0]); number_of_dims = mxGetNumberOfDimensions(prhs[0]); /*Handling Matlab input data*/ @@ -59,15 +61,25 @@ void mexFunction( if (mxGetClassID(prhs[0]) != mxSINGLE_CLASS) {mexErrMsgTxt("The input image must be in a single precision"); } if(nrhs != 4) mexErrMsgTxt("Four inputs reqired: Image(2D,3D), regularization parameter, iterations number, marching step constant"); /*Handling Matlab output data*/ - dimX = dim_array[0]; dimY = dim_array[1]; dimZ = dim_array[2]; + dimX = dim_array_i[0]; dimY = dim_array_i[1]; dimZ = dim_array_i[2]; + /* output arrays*/ if (number_of_dims == 2) { + //const mwSize dim_array[2] = {dimX, dimY}; dimZ = 1; /*2D case*/ /* output image/volume */ - Output = (float*)mxGetPr(plhs[0] = mxCreateNumericArray(2, dim_array, mxSINGLE_CLASS, mxREAL)); + Output = (float*)mxGetPr(plhs[0] = mxCreateNumericArray(2, dim_array_i, mxSINGLE_CLASS, mxREAL)); + //mexErrMsgTxt("Call me 72"); } - if (number_of_dims == 3) Output = (float*)mxGetPr(plhs[0] = mxCreateNumericArray(3, dim_array, mxSINGLE_CLASS, mxREAL)); + if (number_of_dims == 3) { + //const mwSize dim_array[3] = {dimX, dimY, dimZ}; + Output = (float*)mxGetPr(plhs[0] = mxCreateNumericArray(3, dim_array_i, mxSINGLE_CLASS, mxREAL)); + } + +// for(j=0; j<(int)(dimX*dimY*dimZ); j++) { +// if (j%10 == 0) mexErrMsgTxt("WHAT???"); +// Output[j] = 2;} TV_ROF_CPU_main(Input, Output, lambda, iter_numb, tau, dimX, dimY, dimZ); } \ No newline at end of file -- cgit v1.2.3 From 5483927af925b3892f2f48ef4eb12c07e3ce862a Mon Sep 17 00:00:00 2001 From: algol Date: Fri, 10 Aug 2018 16:24:48 +0100 Subject: MWsize CPU fix --- .../Matlab/mex_compile/regularisers_CPU/Diffusion_4thO.c | 5 +++-- Wrappers/Matlab/mex_compile/regularisers_CPU/FGP_TV.c | 5 +++-- Wrappers/Matlab/mex_compile/regularisers_CPU/FGP_dTV.c | 7 ++++--- Wrappers/Matlab/mex_compile/regularisers_CPU/LLT_ROF.c | 5 +++-- Wrappers/Matlab/mex_compile/regularisers_CPU/NonlDiff.c | 6 ++++-- .../Matlab/mex_compile/regularisers_CPU/NonlDiff_Inp.c | 10 ++++++---- .../regularisers_CPU/NonlocalMarching_Inpaint.c | 8 +++++--- Wrappers/Matlab/mex_compile/regularisers_CPU/ROF_TV.c | 14 +++----------- Wrappers/Matlab/mex_compile/regularisers_CPU/SB_TV.c | 6 ++++-- Wrappers/Matlab/mex_compile/regularisers_CPU/TGV.c | 6 ++++-- Wrappers/Matlab/mex_compile/regularisers_CPU/TNV.c | 5 +++-- Wrappers/Matlab/mex_compile/regularisers_CPU/TV_energy.c | 6 ++++-- 12 files changed, 46 insertions(+), 37 deletions(-) (limited to 'Wrappers') diff --git a/Wrappers/Matlab/mex_compile/regularisers_CPU/Diffusion_4thO.c b/Wrappers/Matlab/mex_compile/regularisers_CPU/Diffusion_4thO.c index 81c0600..66ea9be 100644 --- a/Wrappers/Matlab/mex_compile/regularisers_CPU/Diffusion_4thO.c +++ b/Wrappers/Matlab/mex_compile/regularisers_CPU/Diffusion_4thO.c @@ -42,8 +42,9 @@ void mexFunction( int nrhs, const mxArray *prhs[]) { - int number_of_dims, iter_numb, dimX, dimY, dimZ; - const int *dim_array; + int number_of_dims, iter_numb; + mwSize dimX, dimY, dimZ; + const mwSize *dim_array; float *Input, *Output=NULL, lambda, tau, sigma; dim_array = mxGetDimensions(prhs[0]); diff --git a/Wrappers/Matlab/mex_compile/regularisers_CPU/FGP_TV.c b/Wrappers/Matlab/mex_compile/regularisers_CPU/FGP_TV.c index aae1cb7..642362f 100644 --- a/Wrappers/Matlab/mex_compile/regularisers_CPU/FGP_TV.c +++ b/Wrappers/Matlab/mex_compile/regularisers_CPU/FGP_TV.c @@ -44,8 +44,9 @@ void mexFunction( int nrhs, const mxArray *prhs[]) { - int number_of_dims, iter, dimX, dimY, dimZ, methTV, printswitch, nonneg; - const int *dim_array; + int number_of_dims, iter, methTV, printswitch, nonneg; + mwSize dimX, dimY, dimZ; + const mwSize *dim_array; float *Input, *Output=NULL, lambda, epsil; number_of_dims = mxGetNumberOfDimensions(prhs[0]); diff --git a/Wrappers/Matlab/mex_compile/regularisers_CPU/FGP_dTV.c b/Wrappers/Matlab/mex_compile/regularisers_CPU/FGP_dTV.c index bb868c7..1a0c070 100644 --- a/Wrappers/Matlab/mex_compile/regularisers_CPU/FGP_dTV.c +++ b/Wrappers/Matlab/mex_compile/regularisers_CPU/FGP_dTV.c @@ -49,9 +49,10 @@ void mexFunction( int nrhs, const mxArray *prhs[]) { - int number_of_dims, iter, dimX, dimY, dimZ, methTV, printswitch, nonneg; - const int *dim_array; - const int *dim_array2; + int number_of_dims, iter, methTV, printswitch, nonneg; + mwSize dimX, dimY, dimZ; + const mwSize *dim_array; + const mwSize *dim_array2; float *Input, *InputRef, *Output=NULL, lambda, epsil, eta; number_of_dims = mxGetNumberOfDimensions(prhs[0]); diff --git a/Wrappers/Matlab/mex_compile/regularisers_CPU/LLT_ROF.c b/Wrappers/Matlab/mex_compile/regularisers_CPU/LLT_ROF.c index 81b717d..ab45446 100644 --- a/Wrappers/Matlab/mex_compile/regularisers_CPU/LLT_ROF.c +++ b/Wrappers/Matlab/mex_compile/regularisers_CPU/LLT_ROF.c @@ -46,8 +46,9 @@ void mexFunction( int nrhs, const mxArray *prhs[]) { - int number_of_dims, iterationsNumb, dimX, dimY, dimZ; - const int *dim_array; + int number_of_dims, iterationsNumb; + mwSize dimX, dimY, dimZ; + const mwSize *dim_array; float *Input, *Output=NULL, lambdaROF, lambdaLLT, tau; dim_array = mxGetDimensions(prhs[0]); diff --git a/Wrappers/Matlab/mex_compile/regularisers_CPU/NonlDiff.c b/Wrappers/Matlab/mex_compile/regularisers_CPU/NonlDiff.c index e05f5d4..ec35b8b 100644 --- a/Wrappers/Matlab/mex_compile/regularisers_CPU/NonlDiff.c +++ b/Wrappers/Matlab/mex_compile/regularisers_CPU/NonlDiff.c @@ -43,8 +43,10 @@ void mexFunction( int nrhs, const mxArray *prhs[]) { - int number_of_dims, iter_numb, dimX, dimY, dimZ, penaltytype; - const int *dim_array; + int number_of_dims, iter_numb, penaltytype; + mwSize dimX, dimY, dimZ; + const mwSize *dim_array; + float *Input, *Output=NULL, lambda, tau, sigma; dim_array = mxGetDimensions(prhs[0]); diff --git a/Wrappers/Matlab/mex_compile/regularisers_CPU/NonlDiff_Inp.c b/Wrappers/Matlab/mex_compile/regularisers_CPU/NonlDiff_Inp.c index eaab4a7..9833392 100644 --- a/Wrappers/Matlab/mex_compile/regularisers_CPU/NonlDiff_Inp.c +++ b/Wrappers/Matlab/mex_compile/regularisers_CPU/NonlDiff_Inp.c @@ -45,9 +45,11 @@ void mexFunction( int nrhs, const mxArray *prhs[]) { - int number_of_dims, iter_numb, dimX, dimY, dimZ, penaltytype, i, inpaint_elements; - const int *dim_array; - const int *dim_array2; + int number_of_dims, iter_numb, penaltytype, i, inpaint_elements; + mwSize dimX, dimY, dimZ; + const mwSize *dim_array; + const mwSize *dim_array2; + float *Input, *Output=NULL, lambda, tau, sigma; unsigned char *Mask; @@ -95,7 +97,7 @@ void mexFunction( } inpaint_elements = 0; - for (i=0; i Date: Sat, 11 Aug 2018 13:21:06 +0100 Subject: MWsize GPU fix --- .../Matlab/mex_compile/regularisers_GPU/Diffusion_4thO_GPU.cpp | 5 +++-- Wrappers/Matlab/mex_compile/regularisers_GPU/FGP_TV_GPU.cpp | 6 ++++-- Wrappers/Matlab/mex_compile/regularisers_GPU/FGP_dTV_GPU.cpp | 8 +++++--- Wrappers/Matlab/mex_compile/regularisers_GPU/LLT_ROF_GPU.cpp | 6 ++++-- Wrappers/Matlab/mex_compile/regularisers_GPU/NonlDiff_GPU.cpp | 6 ++++-- Wrappers/Matlab/mex_compile/regularisers_GPU/ROF_TV_GPU.cpp | 6 ++++-- Wrappers/Matlab/mex_compile/regularisers_GPU/SB_TV_GPU.cpp | 6 ++++-- Wrappers/Matlab/mex_compile/regularisers_GPU/TGV_GPU.cpp | 5 +++-- 8 files changed, 31 insertions(+), 17 deletions(-) (limited to 'Wrappers') diff --git a/Wrappers/Matlab/mex_compile/regularisers_GPU/Diffusion_4thO_GPU.cpp b/Wrappers/Matlab/mex_compile/regularisers_GPU/Diffusion_4thO_GPU.cpp index 0edc067..0cc042b 100644 --- a/Wrappers/Matlab/mex_compile/regularisers_GPU/Diffusion_4thO_GPU.cpp +++ b/Wrappers/Matlab/mex_compile/regularisers_GPU/Diffusion_4thO_GPU.cpp @@ -42,8 +42,9 @@ void mexFunction( int nrhs, const mxArray *prhs[]) { - int number_of_dims, iter_numb, dimX, dimY, dimZ; - const int *dim_array; + int number_of_dims, iter_numb; + mwSize dimX, dimY, dimZ; + const mwSize *dim_array; float *Input, *Output=NULL, lambda, tau, sigma; dim_array = mxGetDimensions(prhs[0]); diff --git a/Wrappers/Matlab/mex_compile/regularisers_GPU/FGP_TV_GPU.cpp b/Wrappers/Matlab/mex_compile/regularisers_GPU/FGP_TV_GPU.cpp index 9ed9ae0..c174e75 100644 --- a/Wrappers/Matlab/mex_compile/regularisers_GPU/FGP_TV_GPU.cpp +++ b/Wrappers/Matlab/mex_compile/regularisers_GPU/FGP_TV_GPU.cpp @@ -43,8 +43,10 @@ void mexFunction( int nrhs, const mxArray *prhs[]) { - int number_of_dims, iter, dimX, dimY, dimZ, methTV, printswitch, nonneg; - const int *dim_array; + int number_of_dims, iter, methTV, printswitch, nonneg; + mwSize dimX, dimY, dimZ; + const mwSize *dim_array; + float *Input, *Output=NULL, lambda, epsil; number_of_dims = mxGetNumberOfDimensions(prhs[0]); diff --git a/Wrappers/Matlab/mex_compile/regularisers_GPU/FGP_dTV_GPU.cpp b/Wrappers/Matlab/mex_compile/regularisers_GPU/FGP_dTV_GPU.cpp index 5b80616..3f5a4b3 100644 --- a/Wrappers/Matlab/mex_compile/regularisers_GPU/FGP_dTV_GPU.cpp +++ b/Wrappers/Matlab/mex_compile/regularisers_GPU/FGP_dTV_GPU.cpp @@ -47,9 +47,11 @@ void mexFunction( int nrhs, const mxArray *prhs[]) { - int number_of_dims, iter, dimX, dimY, dimZ, methTV, printswitch, nonneg; - const int *dim_array; - const int *dim_array2; + int number_of_dims, iter, methTV, printswitch, nonneg; + mwSize dimX, dimY, dimZ; + const mwSize *dim_array; + const mwSize *dim_array2; + float *Input, *InputRef, *Output=NULL, lambda, epsil, eta; number_of_dims = mxGetNumberOfDimensions(prhs[0]); diff --git a/Wrappers/Matlab/mex_compile/regularisers_GPU/LLT_ROF_GPU.cpp b/Wrappers/Matlab/mex_compile/regularisers_GPU/LLT_ROF_GPU.cpp index 37563b0..e8da4ce 100644 --- a/Wrappers/Matlab/mex_compile/regularisers_GPU/LLT_ROF_GPU.cpp +++ b/Wrappers/Matlab/mex_compile/regularisers_GPU/LLT_ROF_GPU.cpp @@ -46,8 +46,10 @@ void mexFunction( int nrhs, const mxArray *prhs[]) { - int number_of_dims, iterationsNumb, dimX, dimY, dimZ; - const int *dim_array; + int number_of_dims, iterationsNumb; + mwSize dimX, dimY, dimZ; + const mwSize *dim_array; + float *Input, *Output=NULL, lambdaROF, lambdaLLT, tau; dim_array = mxGetDimensions(prhs[0]); diff --git a/Wrappers/Matlab/mex_compile/regularisers_GPU/NonlDiff_GPU.cpp b/Wrappers/Matlab/mex_compile/regularisers_GPU/NonlDiff_GPU.cpp index bfba9ea..1cd0cdc 100644 --- a/Wrappers/Matlab/mex_compile/regularisers_GPU/NonlDiff_GPU.cpp +++ b/Wrappers/Matlab/mex_compile/regularisers_GPU/NonlDiff_GPU.cpp @@ -46,8 +46,10 @@ void mexFunction( int nrhs, const mxArray *prhs[]) { - int number_of_dims, iter_numb, dimX, dimY, dimZ, penaltytype; - const int *dim_array; + int number_of_dims, iter_numb, penaltytype; + mwSize dimX, dimY, dimZ; + const mwSize *dim_array; + float *Input, *Output=NULL, lambda, tau, sigma; dim_array = mxGetDimensions(prhs[0]); diff --git a/Wrappers/Matlab/mex_compile/regularisers_GPU/ROF_TV_GPU.cpp b/Wrappers/Matlab/mex_compile/regularisers_GPU/ROF_TV_GPU.cpp index f60ba7b..bd01d55 100644 --- a/Wrappers/Matlab/mex_compile/regularisers_GPU/ROF_TV_GPU.cpp +++ b/Wrappers/Matlab/mex_compile/regularisers_GPU/ROF_TV_GPU.cpp @@ -42,8 +42,10 @@ void mexFunction( int nrhs, const mxArray *prhs[]) { - int number_of_dims, iter_numb, dimX, dimY, dimZ; - const int *dim_array; + int number_of_dims, iter_numb; + mwSize dimX, dimY, dimZ; + const mwSize *dim_array; + float *Input, *Output=NULL, lambda, tau; dim_array = mxGetDimensions(prhs[0]); diff --git a/Wrappers/Matlab/mex_compile/regularisers_GPU/SB_TV_GPU.cpp b/Wrappers/Matlab/mex_compile/regularisers_GPU/SB_TV_GPU.cpp index 60847d9..9d1328f 100644 --- a/Wrappers/Matlab/mex_compile/regularisers_GPU/SB_TV_GPU.cpp +++ b/Wrappers/Matlab/mex_compile/regularisers_GPU/SB_TV_GPU.cpp @@ -42,8 +42,10 @@ void mexFunction( int nrhs, const mxArray *prhs[]) { - int number_of_dims, iter, dimX, dimY, dimZ, methTV, printswitch; - const int *dim_array; + int number_of_dims, iter, methTV, printswitch; + mwSize dimX, dimY, dimZ; + const mwSize *dim_array; + float *Input, *Output=NULL, lambda, epsil; number_of_dims = mxGetNumberOfDimensions(prhs[0]); diff --git a/Wrappers/Matlab/mex_compile/regularisers_GPU/TGV_GPU.cpp b/Wrappers/Matlab/mex_compile/regularisers_GPU/TGV_GPU.cpp index 5a0df5b..edb551d 100644 --- a/Wrappers/Matlab/mex_compile/regularisers_GPU/TGV_GPU.cpp +++ b/Wrappers/Matlab/mex_compile/regularisers_GPU/TGV_GPU.cpp @@ -43,8 +43,9 @@ void mexFunction( int nrhs, const mxArray *prhs[]) { - int number_of_dims, iter, dimX, dimY; - const int *dim_array; + int number_of_dims, iter; + mwSize dimX, dimY; + const mwSize *dim_array; float *Input, *Output=NULL, lambda, alpha0, alpha1, L2; number_of_dims = mxGetNumberOfDimensions(prhs[0]); -- cgit v1.2.3 From 135015685959c6168930951fcb50d46bc9aeddd7 Mon Sep 17 00:00:00 2001 From: algol Date: Mon, 13 Aug 2018 16:39:25 +0100 Subject: fixed matlab wrappers compilation GPU --- Wrappers/Matlab/CMakeLists.txt | 45 ++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 19 deletions(-) (limited to 'Wrappers') diff --git a/Wrappers/Matlab/CMakeLists.txt b/Wrappers/Matlab/CMakeLists.txt index cd46051..837993d 100755 --- a/Wrappers/Matlab/CMakeLists.txt +++ b/Wrappers/Matlab/CMakeLists.txt @@ -75,18 +75,18 @@ foreach(tgt RANGE 0 ${num}) NAME ${current_target} SRC ${current_file_name} - ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/FGP_TV_core.c - ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/SB_TV_core.c - ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/TGV_core.c - ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/Diffusion_core.c - ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/Diffus4th_order_core.c - ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/LLT_ROF_core.c - ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/ROF_TV_core.c - ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/FGP_dTV_core.c - ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/TNV_core.c - ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/utils.c - ${CMAKE_SOURCE_DIR}/Core/inpainters_CPU/Diffusion_Inpaint_core.c - ${CMAKE_SOURCE_DIR}/Core/inpainters_CPU/NonlocalMarching_Inpaint_core.c + #${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/FGP_TV_core.c + #${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/SB_TV_core.c + #${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/TGV_core.c + #${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/Diffusion_core.c + #${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/Diffus4th_order_core.c + #${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/LLT_ROF_core.c + #${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/ROF_TV_core.c + #${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/FGP_dTV_core.c + #${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/TNV_core.c + #${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/utils.c + #${CMAKE_SOURCE_DIR}/Core/inpainters_CPU/Diffusion_Inpaint_core.c + #${CMAKE_SOURCE_DIR}/Core/inpainters_CPU/NonlocalMarching_Inpaint_core.c LINK_TO cilreg ${Matlab_LIBRARIES} ) @@ -107,26 +107,33 @@ if (BUILD_CUDA) find_package(CUDA) if (CUDA_FOUND) file(GLOB GPU_MEX_FILES - "${CMAKE_SOURCE_DIR}/Wrappers/Matlab/mex_compile/regularisers_GPU/*.c" + "${CMAKE_SOURCE_DIR}/Wrappers/Matlab/mex_compile/regularisers_GPU/*.cpp" ) list(LENGTH GPU_MEX_FILES num) - +message("number of GPU files " ${num}) MATH(EXPR num "${num}-1") #set(num "-1") foreach(tgt RANGE ${num}) message("number " ${tgt}) - #list(GET CPU_TARGETS ${tgt} current_target) - list(GET GPU_MEX_FILES ${tgt} current_file) - get_filename_component(current_target ${current_file} NAME) + list(LENGTH GPU_MEX_FILES num2) + message("the list is ${num2}") + #list(GET CPU_TARGETS ${tgt} current_target) + list(GET GPU_MEX_FILES ${tgt} current_file_name) + get_filename_component(current_file ${current_file_name} NAME) + string(REGEX MATCH "(.+).c" match ${current_file}) + if (NOT ${match} EQUAL "" ) + set (current_target ${CMAKE_MATCH_1}) + endif() + message("matlab_add_mex target " ${current_file} " and " ${current_target}) message("matlab_add_mex " ${current_target}) matlab_add_mex( NAME ${current_target} SRC - ${current_file} - LINK_TO cilreg ${Matlab_LIBRARIES} + ${current_file_name} + LINK_TO cilregcuda ${Matlab_LIBRARIES} ) target_include_directories(${current_target} -- cgit v1.2.3 From 2879372e7f2ba878214c5bef237ccbc01f3846af Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Tue, 14 Aug 2018 13:56:05 +0100 Subject: add install step for PythonWrapper --- Wrappers/Python/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Wrappers') diff --git a/Wrappers/Python/CMakeLists.txt b/Wrappers/Python/CMakeLists.txt index 01b5208..4ca500e 100644 --- a/Wrappers/Python/CMakeLists.txt +++ b/Wrappers/Python/CMakeLists.txt @@ -132,5 +132,7 @@ if (PYTHONINTERP_FOUND) add_custom_target(PythonWrapper ALL DEPENDS ${OUTPUT}) + install(PythonWrapper DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ccpi + DESTINATION ${PYTHON_DEST}) #install(CODE "execute_process(COMMAND ${PYTHON} ${SETUP_PY} install)") endif() -- cgit v1.2.3 From 909a59411750bdc1ffd91d945a479f5cb8b94ea8 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Tue, 14 Aug 2018 14:14:08 +0100 Subject: bugfix install step for PythonWrapper --- Wrappers/Python/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Wrappers') diff --git a/Wrappers/Python/CMakeLists.txt b/Wrappers/Python/CMakeLists.txt index 4ca500e..42f6b8c 100644 --- a/Wrappers/Python/CMakeLists.txt +++ b/Wrappers/Python/CMakeLists.txt @@ -132,7 +132,7 @@ if (PYTHONINTERP_FOUND) add_custom_target(PythonWrapper ALL DEPENDS ${OUTPUT}) - install(PythonWrapper DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ccpi + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ccpi DESTINATION ${PYTHON_DEST}) #install(CODE "execute_process(COMMAND ${PYTHON} ${SETUP_PY} install)") endif() -- cgit v1.2.3 From 7fd01c558905d18960cc65168a3ae4844c1f8e38 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Tue, 14 Aug 2018 14:17:30 +0100 Subject: remove useless ENV{CIL_VERSION} --- Wrappers/Python/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Wrappers') diff --git a/Wrappers/Python/CMakeLists.txt b/Wrappers/Python/CMakeLists.txt index 42f6b8c..7679e68 100644 --- a/Wrappers/Python/CMakeLists.txt +++ b/Wrappers/Python/CMakeLists.txt @@ -6,7 +6,7 @@ project(regulariserPython) # The version number. -set (CIL_VERSION $ENV{CIL_VERSION} CACHE INTERNAL "Core Imaging Library version" FORCE) +#set (CIL_VERSION $ENV{CIL_VERSION} CACHE INTERNAL "Core Imaging Library version" FORCE) # conda orchestrated build message("CIL_VERSION ${CIL_VERSION}") -- cgit v1.2.3 From 92794fd76d9b5274a7b9c48f4aa34c60d774f32a Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Tue, 14 Aug 2018 14:24:16 +0100 Subject: use generator expression for location of built targets --- Wrappers/Python/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Wrappers') diff --git a/Wrappers/Python/CMakeLists.txt b/Wrappers/Python/CMakeLists.txt index 7679e68..eee4db9 100644 --- a/Wrappers/Python/CMakeLists.txt +++ b/Wrappers/Python/CMakeLists.txt @@ -122,11 +122,10 @@ if (PYTHONINTERP_FOUND) COMMAND ${CMAKE_COMMAND} -E env CIL_VERSION=${CIL_VERSION} PREFIX=${CMAKE_SOURCE_DIR}/Core LIBRARY_INC=${CMAKE_SOURCE_DIR}/Core - LIBRARY_LIB=${CMAKE_BINARY_DIR}/Core/${CMAKE_BUILD_TYPE} + LIBRARY_LIB=$ ${PYTHON_EXECUTABLE} ${SETUP_PY} build_ext --inplace COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT} DEPENDS cilreg) - endif() -- cgit v1.2.3 From 0cc3dc22d3627ff044d96850144b874696b9ae2b Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Tue, 14 Aug 2018 14:29:04 +0100 Subject: removed generator --- Wrappers/Python/CMakeLists.txt | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'Wrappers') diff --git a/Wrappers/Python/CMakeLists.txt b/Wrappers/Python/CMakeLists.txt index eee4db9..59d2436 100644 --- a/Wrappers/Python/CMakeLists.txt +++ b/Wrappers/Python/CMakeLists.txt @@ -116,16 +116,29 @@ if (PYTHONINTERP_FOUND) DEPENDS cilreg) else() - add_custom_command(OUTPUT ${OUTPUT} + if (WIN32) + add_custom_command(OUTPUT ${OUTPUT} + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/src + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/ccpi ${CMAKE_CURRENT_BINARY_DIR}/ccpi + COMMAND ${CMAKE_COMMAND} -E env CIL_VERSION=${CIL_VERSION} + PREFIX=${CMAKE_SOURCE_DIR}/Core + LIBRARY_INC=${CMAKE_SOURCE_DIR}/Core + LIBRARY_LIB=${CMAKE_BINARY_DIR}/Core/${CMAKE_BUILD_TYPE} + ${PYTHON_EXECUTABLE} ${SETUP_PY} build_ext --inplace + COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT} + DEPENDS cilreg) + else() + add_custom_command(OUTPUT ${OUTPUT} COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/src COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/ccpi ${CMAKE_CURRENT_BINARY_DIR}/ccpi COMMAND ${CMAKE_COMMAND} -E env CIL_VERSION=${CIL_VERSION} PREFIX=${CMAKE_SOURCE_DIR}/Core LIBRARY_INC=${CMAKE_SOURCE_DIR}/Core - LIBRARY_LIB=$ + LIBRARY_LIB=${CMAKE_BINARY_DIR}/Core ${PYTHON_EXECUTABLE} ${SETUP_PY} build_ext --inplace COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT} DEPENDS cilreg) + endif() endif() -- cgit v1.2.3 From 35d0d326c7c5a294dfc847a8c4015e86ebe1b84b Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Tue, 14 Aug 2018 15:34:27 +0100 Subject: fix conda build --- Wrappers/Python/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Wrappers') diff --git a/Wrappers/Python/CMakeLists.txt b/Wrappers/Python/CMakeLists.txt index 59d2436..68768bc 100644 --- a/Wrappers/Python/CMakeLists.txt +++ b/Wrappers/Python/CMakeLists.txt @@ -139,12 +139,12 @@ if (PYTHONINTERP_FOUND) COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT} DEPENDS cilreg) endif() + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ccpi + DESTINATION ${PYTHON_DEST}) endif() add_custom_target(PythonWrapper ALL DEPENDS ${OUTPUT}) - install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ccpi - DESTINATION ${PYTHON_DEST}) #install(CODE "execute_process(COMMAND ${PYTHON} ${SETUP_PY} install)") endif() -- cgit v1.2.3 From a02acdfb1aefa9cfe49ac844707d32d8140f94f0 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Tue, 14 Aug 2018 16:06:26 +0100 Subject: removed S from BUILD_PYTHON_WRAPPERS --- Wrappers/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Wrappers') diff --git a/Wrappers/CMakeLists.txt b/Wrappers/CMakeLists.txt index 8d02df6..bdcb8f4 100644 --- a/Wrappers/CMakeLists.txt +++ b/Wrappers/CMakeLists.txt @@ -11,9 +11,9 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -if (BUILD_MATLAB_WRAPPERS) +if (BUILD_MATLAB_WRAPPER) add_subdirectory(Matlab) endif() -if (BUILD_PYTHON_WRAPPERS) +if (BUILD_PYTHON_WRAPPER) add_subdirectory(Python) endif() \ No newline at end of file -- cgit v1.2.3 From 9c0df7185bc9ba0dee53fdb4d6a3ecc12e2f1294 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Tue, 14 Aug 2018 17:17:20 +0100 Subject: removed s in wrappers in conda recipe --- Wrappers/Python/conda-recipe/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Wrappers') diff --git a/Wrappers/Python/conda-recipe/build.sh b/Wrappers/Python/conda-recipe/build.sh index 1247707..2031342 100644 --- a/Wrappers/Python/conda-recipe/build.sh +++ b/Wrappers/Python/conda-recipe/build.sh @@ -9,7 +9,7 @@ cp -rv "$RECIPE_DIR/../../../Core" "$SRC_DIR/Core" cd $SRC_DIR -cmake -G "Unix Makefiles" $RECIPE_DIR/../../../ -DBUILD_PYTHON_WRAPPERS=ON -DCONDA_BUILD=ON -DBUILD_CUDA=ON -DCMAKE_BUILD_TYPE="Release" -DLIBRARY_LIB=$CONDA_PREFIX/lib -DLIBRARY_INC=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$PREFIX +cmake -G "Unix Makefiles" $RECIPE_DIR/../../../ -DBUILD_PYTHON_WRAPPER=ON -DCONDA_BUILD=ON -DBUILD_CUDA=ON -DCMAKE_BUILD_TYPE="Release" -DLIBRARY_LIB=$CONDA_PREFIX/lib -DLIBRARY_INC=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$PREFIX make install -- cgit v1.2.3 From 20f82364390ed7a9cdd544ac2e9ad42779abbe70 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Wed, 15 Aug 2018 08:50:50 +0100 Subject: removed CIL_VERSION env variable from conda build --- Wrappers/Python/conda-recipe/build.sh | 4 ---- Wrappers/Python/conda-recipe/meta.yaml | 6 +----- 2 files changed, 1 insertion(+), 9 deletions(-) (limited to 'Wrappers') diff --git a/Wrappers/Python/conda-recipe/build.sh b/Wrappers/Python/conda-recipe/build.sh index 2031342..54bc8e2 100644 --- a/Wrappers/Python/conda-recipe/build.sh +++ b/Wrappers/Python/conda-recipe/build.sh @@ -1,8 +1,4 @@ -if [ -z "$CIL_VERSION" ]; then - echo "Need to set CIL_VERSION" - exit 1 -fi mkdir "$SRC_DIR/ccpi" cp -rv "$RECIPE_DIR/../.." "$SRC_DIR/ccpi" cp -rv "$RECIPE_DIR/../../../Core" "$SRC_DIR/Core" diff --git a/Wrappers/Python/conda-recipe/meta.yaml b/Wrappers/Python/conda-recipe/meta.yaml index 115fcf5..9286cc4 100644 --- a/Wrappers/Python/conda-recipe/meta.yaml +++ b/Wrappers/Python/conda-recipe/meta.yaml @@ -1,12 +1,10 @@ package: name: ccpi-regulariser - version: {{ environ['CIL_VERSION'] }} + version: 0.10.1 build: preserve_egg_dir: False - script_env: - - CIL_VERSION # number: 0 test: @@ -21,7 +19,6 @@ requirements: - numpy x.x - setuptools - cython - # - cil_regulariser =={{ environ['CIL_VERSION'] }} - vc 14 # [win and py36] - vc 14 # [win and py35] - vc 9 # [win and py27] @@ -30,7 +27,6 @@ requirements: run: - python - numpy x.x - # - cil_regulariser =={{ environ['CIL_VERSION'] }} - vc 14 # [win and py36] - vc 14 # [win and py35] - vc 9 # [win and py27] -- cgit v1.2.3 From 50739856921f8aeb980f790724b5117308bf9b0e Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Wed, 15 Aug 2018 09:10:52 +0100 Subject: install into MATLAB_DEST dir if WIN32 --- Wrappers/Matlab/CMakeLists.txt | 10 ++-------- Wrappers/Python/CMakeLists.txt | 11 +---------- 2 files changed, 3 insertions(+), 18 deletions(-) (limited to 'Wrappers') diff --git a/Wrappers/Matlab/CMakeLists.txt b/Wrappers/Matlab/CMakeLists.txt index 837993d..0c26148 100755 --- a/Wrappers/Matlab/CMakeLists.txt +++ b/Wrappers/Matlab/CMakeLists.txt @@ -2,13 +2,7 @@ project(regulariserMatlab) find_package(Matlab REQUIRED COMPONENTS MAIN_PROGRAM MX_LIBRARY ENG_LIBRARY ) -set(MATLAB_DEST_DIR "" CACHE PATH "Directory of the Matlab wrappers") -if (MATLAB_DEST_DIR) -set(MATLAB_DEST "${MATLAB_DEST_DIR}") -else() -set(MATLAB_DEST "${CMAKE_INSTALL_PREFIX}/matlab") -endif() -message(STATUS "Matlab wrappers will be installed in " ${MATLAB_DEST}) + #C:\Users\ofn77899\Documents\Projects\CCPi\GitHub\CCPi-FISTA_Reconstruction\Core\regularisers_CPU @@ -148,6 +142,6 @@ message("number of GPU files " ${num}) endforeach() add_custom_target(MatlabWrapperGPU DEPENDS ${GPU_MEX_TARGETS}) - + endif() endif() diff --git a/Wrappers/Python/CMakeLists.txt b/Wrappers/Python/CMakeLists.txt index 68768bc..d86d0ea 100644 --- a/Wrappers/Python/CMakeLists.txt +++ b/Wrappers/Python/CMakeLists.txt @@ -16,16 +16,7 @@ find_package(PythonInterp REQUIRED) if (PYTHONINTERP_FOUND) message ("Current Python " ${PYTHON_VERSION_STRING} " found " ${PYTHON_EXECUTABLE}) endif() -if (CONDA_BUILD) -else() -set(PYTHON_DEST_DIR "" CACHE PATH "Directory of the Matlab wrappers") - if (PYTHON_DEST_DIR) - set(PYTHON_DEST "${PYTHON_DEST_DIR}") - else() - set(PYTHON_DEST "${CMAKE_INSTALL_PREFIX}/python") - endif() - message(STATUS "Python wrappers will be installed in " ${PYTHON_DEST}) -endif() + ## Build the regularisers package as a library message("Creating Regularisers as shared library") -- cgit v1.2.3