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/Python') 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 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/Python') 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/Python') 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/Python/CMakeLists.txt | 52 ++++++++++++++++++------------------ Wrappers/Python/conda-recipe/bld.bat | 2 +- 2 files changed, 27 insertions(+), 27 deletions(-) (limited to 'Wrappers/Python') 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/Python') 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/Python/CMakeLists.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'Wrappers/Python') 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 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/Python') 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/Python') 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/Python') 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/Python') 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/Python') 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/Python') 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 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/Python') 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/Python') 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/Python/CMakeLists.txt | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'Wrappers/Python') 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