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 --- CMakeLists.txt | 4 ++-- Readme.md | 19 +++++++++++++++++-- recipe/build.sh | 8 ++++---- recipe/meta.yaml | 2 +- src/CMakeLists.txt | 1 + src/Python/CMakeLists.txt | 24 ++++++++++++------------ src/Python/setup-regularisers.py.in | 24 ++++++++++++------------ 7 files changed, 49 insertions(+), 33 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d3bbbd..043f13c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,7 @@ set(MATLAB_DEST "${CMAKE_INSTALL_PREFIX}/matlab") endif() message(STATUS "Matlab wrappers will be installed in " ${MATLAB_DEST}) -set(PYTHON_DEST_DIR "" CACHE PATH "Directory of the Matlab wrappers") +set(PYTHON_DEST_DIR "" CACHE PATH "Directory of the Python wrappers") if (PYTHON_DEST_DIR) set(PYTHON_DEST "${PYTHON_DEST_DIR}") else() @@ -55,5 +55,5 @@ endif() message(STATUS "Python wrappers will be installed in " ${PYTHON_DEST}) -add_subdirectory(src/Core) +#add_subdirectory(src/Core) add_subdirectory(src) diff --git a/Readme.md b/Readme.md index ebd4d20..a9433d2 100644 --- a/Readme.md +++ b/Readme.md @@ -50,13 +50,28 @@ ## Installation: -The package comes as a [CMake](https://cmake.org) project so you will need CMake (v.>=3) to configure it. Additionally you will need a C compiler, `make` (on linux) and CUDA SDK where available. The toolkit may be used directly from C/C++ as it is compiled as a shared library (check-out the include files in `Core` for this). We provide wrappers for Python and Matlab. +The package comes as a [CMake](https://cmake.org) project +and additional wrappers for Python and Matlab. +To install precompiled binaries, you need `conda` and install from `ccpi` channel using : +``` +conda install ccpi-regulariser -c ccpi -c conda-forge +``` + +In order to compile C/C++ sources and additional wrappers from source code, the recommended way is: +``` +git clone https://github.com/vais-ral/CCPi-Regularisation-Toolkit +cd CCPi-Regularisation-Toolkit +build/jenkins-build.sh +``` +this will install `conda build` environment and compiles C/C++ and Python wrappers and performs basic tests. + +### CMake +If you want to build directly using cmake, install CMake (v.>=3) to configure it. Additionally you will need a C compiler, `make` (on linux) and CUDA SDK where available. The toolkit may be used directly from C/C++ as it is compiled as a shared library (check-out the include files in `Core` for this) 1. Clone this repository to a directory, i.e. `CCPi-Regularisation-Toolkit`, 2. create a build directory. 3. Issue `cmake` to configure (or `cmake-gui`, or `ccmake`, or `cmake3`). Use additional flags to fine tune the configuration. -### CMake flags Flags used during configuration | CMake flag | type | meaning | diff --git a/recipe/build.sh b/recipe/build.sh index 1d54b6f..a156193 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -1,8 +1,8 @@ -mkdir "$SRC_DIR/ccpi" -cp -rv "$RECIPE_DIR/../src/Matlab" "$SRC_DIR/ccpi" -cp -rv "$RECIPE_DIR/../src/Python" "$SRC_DIR/ccpi" -cp -rv "$RECIPE_DIR/../src/Core" "$SRC_DIR/Core" +#mkdir "$SRC_DIR/ccpi" +#cp -rv "$RECIPE_DIR/../src/Matlab" "$SRC_DIR/ccpi" +#cp -rv "$RECIPE_DIR/../src/Python" "$SRC_DIR/ccpi" +#cp -rv "$RECIPE_DIR/../src/Core" "$SRC_DIR/Core" cd $SRC_DIR ##cuda=off diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 7435b2b..61d17bd 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -10,7 +10,7 @@ build: test: files: - - lena_gray_512.tif + - ../test/lena_gray_512.tif requires: - pillow=4.1.1 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bdcb8f4..5fe1a57 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -11,6 +11,7 @@ # 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. +add_subdirectory(Core) if (BUILD_MATLAB_WRAPPER) add_subdirectory(Matlab) endif() diff --git a/src/Python/CMakeLists.txt b/src/Python/CMakeLists.txt index c2ef855..ab95ecc 100644 --- a/src/Python/CMakeLists.txt +++ b/src/Python/CMakeLists.txt @@ -7,7 +7,7 @@ project(regulariserPython) # The version number. #set (CIL_VERSION $ENV{CIL_VERSION} CACHE INTERNAL "Core Imaging Library version" FORCE) - +message("Creating Python Wrapper") # conda orchestrated build message("CIL_VERSION: ${CIL_VERSION}") #include (GenerateExportHeader) @@ -19,7 +19,7 @@ endif() ## Build the regularisers package as a library -message("Creating Regularisers as shared library") +#TODO message("Creating Regularisers as shared library") message("CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}") @@ -87,7 +87,7 @@ if (PYTHONINTERP_FOUND) 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 (DEPS "${CMAKE_BINARY_DIR}/src/Core/") set(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/build/timestamp") configure_file(${SETUP_PY_IN} ${SETUP_PY}) @@ -99,9 +99,9 @@ if (PYTHONINTERP_FOUND) 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 + PREFIX=${CMAKE_SOURCE_DIR}/src/Core + LIBRARY_INC=${CMAKE_SOURCE_DIR}/src/Core + LIBRARY_LIB=${CMAKE_BINARY_DIR}/src/Core ${PYTHON_EXECUTABLE} ${SETUP_PY} install COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT} DEPENDS cilreg) @@ -112,9 +112,9 @@ if (PYTHONINTERP_FOUND) 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} + PREFIX=${CMAKE_SOURCE_DIR}/src/Core + LIBRARY_INC=${CMAKE_SOURCE_DIR}/src/Core + LIBRARY_LIB=${CMAKE_BINARY_DIR}/src/Core/${CMAKE_BUILD_TYPE} ${PYTHON_EXECUTABLE} ${SETUP_PY} build_ext --inplace COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT} DEPENDS cilreg) @@ -123,9 +123,9 @@ if (PYTHONINTERP_FOUND) 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 + PREFIX=${CMAKE_SOURCE_DIR}/src/Core + LIBRARY_INC=${CMAKE_SOURCE_DIR}/src/Core + LIBRARY_LIB=${CMAKE_BINARY_DIR}/src/Core ${PYTHON_EXECUTABLE} ${SETUP_PY} build_ext --inplace COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT} DEPENDS cilreg) 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