-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CCPi CIL to SuperBuild #1
base: master
Are you sure you want to change the base?
Changes from 5 commits
b26a35e
b965069
f6910a8
36217fd
7f6955b
e54712f
01b41ae
cc47c52
50830ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
#======================================================================== | ||
# Author: Benjamin A Thomas | ||
# Author: Kris Thielemans | ||
# Author: Edoardo Pasca | ||
# Copyright 2017 University College London | ||
# Copyright 2017 STFC | ||
# | ||
# This file is part of the CCP PETMR Synergistic Image Reconstruction Framework (SIRF) SuperBuild. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0.txt | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# 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. | ||
# | ||
#========================================================================= | ||
|
||
#This needs to be unique globally | ||
set(proj CCPi-Framework) | ||
|
||
# Set dependency list | ||
set(${proj}_DEPENDENCIES "") | ||
|
||
# Include dependent projects if any | ||
ExternalProject_Include_Dependencies(${proj} DEPENDS_VAR ${proj}_DEPENDENCIES) | ||
|
||
# Set external name (same as internal for now) | ||
set(externalProjName ${proj}) | ||
|
||
set(${proj}_SOURCE_DIR "${SOURCE_ROOT_DIR}/${proj}" ) | ||
set(${proj}_BINARY_DIR "${SUPERBUILD_WORK_DIR}/builds/${proj}/build" ) | ||
set(${proj}_DOWNLOAD_DIR "${SUPERBUILD_WORK_DIR}/downloads/${proj}" ) | ||
set(${proj}_STAMP_DIR "${SUPERBUILD_WORK_DIR}/builds/${proj}/stamp" ) | ||
set(${proj}_TMP_DIR "${SUPERBUILD_WORK_DIR}/builds/${proj}/tmp" ) | ||
|
||
if(NOT ( DEFINED "USE_SYSTEM_${externalProjName}" AND "${USE_SYSTEM_${externalProjName}}" ) ) | ||
message(STATUS "${__indent}Adding project ${proj}") | ||
|
||
### --- Project specific additions here | ||
set(libcilreg_Install_Dir ${SUPERBUILD_INSTALL_DIR}) | ||
|
||
#message(STATUS "HDF5_ROOT in External_SIRF: " ${HDF5_ROOT}) | ||
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${SUPERBUILD_INSTALL_DIR}) | ||
set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${SUPERBUILD_INSTALL_DIR}) | ||
|
||
set(ENV{CIL_VERSION} 0.10.1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure why an env variable. and shouldn't it be in version_config.cmake ? also some hard-wired 0.10.1 below There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is for a silly reason on the CCPi package. It should be removed from it, but it's needed for the time being. |
||
#set(CCPi-Framework_URL https://github.com/vais-ral/CCPi-Framework.git) | ||
#set(CCPi-Framework_TAG origin/master) | ||
message("CIL URL " ${${proj}_URL} ) | ||
message("CIL TAG " ${${proj}_TAG} ) | ||
|
||
# conda build should never get here | ||
if("${PYTHON_STRATEGY}" STREQUAL "PYTHONPATH") | ||
# in case of PYTHONPATH it is sufficient to copy the files to the | ||
# $PYTHONPATH directory | ||
ExternalProject_Add(${proj} | ||
${${proj}_EP_ARGS} | ||
GIT_REPOSITORY ${${proj}_URL} | ||
GIT_TAG ${${proj}_TAG} | ||
SOURCE_DIR ${${proj}_SOURCE_DIR} | ||
BINARY_DIR ${${proj}_BINARY_DIR} | ||
DOWNLOAD_DIR ${${proj}_DOWNLOAD_DIR} | ||
STAMP_DIR ${${proj}_STAMP_DIR} | ||
TMP_DIR ${${proj}_TMP_DIR} | ||
INSTALL_DIR ${libcilreg_Install_Dir} | ||
|
||
CONFIGURE_COMMAND "" | ||
BUILD_COMMAND "" | ||
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory ${${proj}_SOURCE_DIR}/Wrappers/Python/ccpi ${PYTHON_DEST}/ccpi | ||
CMAKE_ARGS | ||
-DCMAKE_INSTALL_PREFIX=${libcilreg_Install_Dir} | ||
DEPENDS | ||
${${proj}_DEPENDENCIES} | ||
) | ||
|
||
else() | ||
# if SETUP_PY one can launch the conda build.sh script setting | ||
# the appropriate variables. | ||
ExternalProject_Add(${proj} | ||
${${proj}_EP_ARGS} | ||
GIT_REPOSITORY ${${proj}_URL} | ||
GIT_TAG ${${proj}_TAG} | ||
SOURCE_DIR ${${proj}_SOURCE_DIR} | ||
BINARY_DIR ${${proj}_BINARY_DIR} | ||
DOWNLOAD_DIR ${${proj}_DOWNLOAD_DIR} | ||
STAMP_DIR ${${proj}_STAMP_DIR} | ||
TMP_DIR ${${proj}_TMP_DIR} | ||
INSTALL_DIR ${libcilreg_Install_Dir} | ||
|
||
CONFIGURE_COMMAND "" | ||
BUILD_COMMAND "" | ||
INSTALL_COMMAND ${CMAKE_COMMAND} -E env CIL_VERSION=0.10.0 SRC_DIR=${${proj}_BINARY_DIR} RECIPE_DIR=${${proj}_SOURCE_DIR}/Wrappers/Python/conda-recipe PYTHON=${PYTHON_EXECUTABLE} bash ${${proj}_SOURCE_DIR}/Wrappers/Python/conda-recipe/build.sh | ||
CMAKE_ARGS | ||
-DCMAKE_INSTALL_PREFIX=${libcilreg_Install_Dir} | ||
DEPENDS | ||
${${proj}_DEPENDENCIES} | ||
) | ||
endif() | ||
|
||
|
||
set(${proj}_ROOT ${${proj}_SOURCE_DIR}) | ||
set(${proj}_INCLUDE_DIR ${${proj}_SOURCE_DIR}) | ||
|
||
else() | ||
if(${USE_SYSTEM_${externalProjName}}) | ||
find_package(${proj} ${${externalProjName}_REQUIRED_VERSION} REQUIRED) | ||
message("USING the system ${externalProjName}, set ${externalProjName}_DIR=${${externalProjName}_DIR}") | ||
endif() | ||
ExternalProject_Add_Empty(${proj} DEPENDS "${${proj}_DEPENDENCIES}" | ||
SOURCE_DIR ${${proj}_SOURCE_DIR} | ||
BINARY_DIR ${${proj}_BINARY_DIR} | ||
DOWNLOAD_DIR ${${proj}_DOWNLOAD_DIR} | ||
STAMP_DIR ${${proj}_STAMP_DIR} | ||
TMP_DIR ${${proj}_TMP_DIR} | ||
) | ||
endif() | ||
|
||
mark_as_superbuild( | ||
VARS | ||
${externalProjName}_DIR:PATH | ||
LABELS | ||
"FIND_PACKAGE" | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
#======================================================================== | ||
# Author: Benjamin A Thomas | ||
# Author: Kris Thielemans | ||
# Author: Edoardo Pasca | ||
# Copyright 2017 University College London | ||
# Copyright 2017 STFC | ||
# | ||
# This file is part of the CCP PETMR Synergistic Image Reconstruction Framework (SIRF) SuperBuild. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0.txt | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# 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. | ||
# | ||
#========================================================================= | ||
|
||
#This needs to be unique globally | ||
set(proj CCPi-RGL) | ||
|
||
# Set dependency list | ||
set(${proj}_DEPENDENCIES "") | ||
|
||
# Include dependent projects if any | ||
ExternalProject_Include_Dependencies(${proj} DEPENDS_VAR ${proj}_DEPENDENCIES) | ||
|
||
# Set external name (same as internal for now) | ||
set(externalProjName ${proj}) | ||
|
||
set(${proj}_SOURCE_DIR "${SOURCE_ROOT_DIR}/${proj}" ) | ||
set(${proj}_BINARY_DIR "${SUPERBUILD_WORK_DIR}/builds/${proj}/build" ) | ||
set(${proj}_DOWNLOAD_DIR "${SUPERBUILD_WORK_DIR}/downloads/${proj}" ) | ||
set(${proj}_STAMP_DIR "${SUPERBUILD_WORK_DIR}/builds/${proj}/stamp" ) | ||
set(${proj}_TMP_DIR "${SUPERBUILD_WORK_DIR}/builds/${proj}/tmp" ) | ||
|
||
if(NOT ( DEFINED "USE_SYSTEM_${externalProjName}" AND "${USE_SYSTEM_${externalProjName}}" ) ) | ||
message(STATUS "${__indent}Adding project ${proj}") | ||
|
||
### --- Project specific additions here | ||
set(libcilreg_Install_Dir ${SUPERBUILD_INSTALL_DIR}) | ||
|
||
#message(STATUS "HDF5_ROOT in External_SIRF: " ${HDF5_ROOT}) | ||
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${SUPERBUILD_INSTALL_DIR}) | ||
set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${SUPERBUILD_INSTALL_DIR}) | ||
|
||
set(ENV{CIL_VERSION} 0.10.1) | ||
#set(CCPi-RGL_URL https://github.com/vais-ral/CCPi-Regularisation-Toolkit.git) | ||
#set(CCPi-RGL_TAG origin/windows_fix) | ||
message("CIL URL " ${${proj}_URL} ) | ||
message("CIL TAG " ${${proj}_TAG} ) | ||
|
||
# conda build should never get here | ||
if("${PYTHON_STRATEGY}" STREQUAL "PYTHONPATH") | ||
# in case of PYTHONPATH it is sufficient to copy the files to the | ||
# $PYTHONPATH directory | ||
ExternalProject_Add(${proj} | ||
${${proj}_EP_ARGS} | ||
GIT_REPOSITORY ${${proj}_URL} | ||
GIT_TAG ${${proj}_TAG} | ||
SOURCE_DIR ${${proj}_SOURCE_DIR} | ||
BINARY_DIR ${${proj}_BINARY_DIR} | ||
DOWNLOAD_DIR ${${proj}_DOWNLOAD_DIR} | ||
STAMP_DIR ${${proj}_STAMP_DIR} | ||
TMP_DIR ${${proj}_TMP_DIR} | ||
INSTALL_DIR ${libcilreg_Install_Dir} | ||
|
||
#CONFIGURE_COMMAND "" | ||
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy_directory ${${proj}_SOURCE_DIR} ${${proj}_BINARY_DIR} | ||
COMMAND grep -vx "make install" ${${proj}_SOURCE_DIR}/recipes/regularisers/build.sh > ${${proj}_BINARY_DIR}/recipes/regularisers/build.sh | ||
#COMMAND grep -vx "\$PYTHON setup-regularisers.py install" ${${proj}_SOURCE_DIR}/Wrappers/Python/conda-recipe/build.sh > ${${proj}_BINARY_DIR}/Wrappers/Python/conda-recipe/build.sh | ||
COMMAND sed -e "s/install/build_ext --inplace/" ${${proj}_SOURCE_DIR}/Wrappers/Python/conda-recipe/build.sh > ${${proj}_BINARY_DIR}/Wrappers/Python/conda-recipe/build.sh | ||
|
||
BUILD_COMMAND ${CMAKE_COMMAND} -E env CIL_VERSION=0.10.0 SRC_DIR=${${proj}_BINARY_DIR} RECIPE_DIR=${${proj}_SOURCE_DIR}/recipes/regularisers PYTHON=${PYTHON_EXECUTABLE} CONDA_PREFIX=${${proj}_BINARY_DIR} bash ${${proj}_BINARY_DIR}/recipes/regularisers/build.sh | ||
COMMAND ${CMAKE_COMMAND} -E env CIL_VERSION=0.10.0 SRC_DIR=${${proj}_BINARY_DIR} RECIPE_DIR=${${proj}_SOURCE_DIR}/Wrappers/Python/conda-recipe PYTHON=${PYTHON_EXECUTABLE} CONDA_PREFIX=${${proj}_BINARY_DIR} PREFIX=${libcilreg_Install_Dir} LIBRARY_PATH=${${proj}_BINARY_DIR}/build/build/:$ENV{LIBRARY_PATH} bash ${${proj}_BINARY_DIR}/Wrappers/Python/conda-recipe/build.sh | ||
|
||
#INSTALL_COMMAND "" | ||
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy ${${proj}_BINARY_DIR}/build/build/libcilreg.so ${libcilreg_Install_Dir}/lib | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${${proj}_BINARY_DIR}/ccpi/Python/ccpi ${PYTHON_DEST}/ccpi | ||
#BUILD_COMMAND ${CMAKE_COMMAND} -E env CIL_VERSION=0.10.0 SRC_DIR=${${proj}_BINARY_DIR} RECIPE_DIR=${${proj}_SOURCE_DIR}/Wrappers/Python/conda-recipe PYTHON=${PYTHON_EXECUTABLE} | ||
#INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory ${${proj}_SOURCE_DIR}/Wrappers/Python/ccpi ${PYTHON_DEST}/ccpi | ||
CMAKE_ARGS | ||
-DCMAKE_INSTALL_PREFIX=${libcilreg_Install_Dir} | ||
DEPENDS | ||
${${proj}_DEPENDENCIES} | ||
) | ||
|
||
else() | ||
# if SETUP_PY one can launch the conda build.sh script setting | ||
# the appropriate variables. | ||
ExternalProject_Add(${proj} | ||
${${proj}_EP_ARGS} | ||
GIT_REPOSITORY ${${proj}_URL} | ||
GIT_TAG ${${proj}_TAG} | ||
SOURCE_DIR ${${proj}_SOURCE_DIR} | ||
BINARY_DIR ${${proj}_BINARY_DIR} | ||
DOWNLOAD_DIR ${${proj}_DOWNLOAD_DIR} | ||
STAMP_DIR ${${proj}_STAMP_DIR} | ||
TMP_DIR ${${proj}_TMP_DIR} | ||
INSTALL_DIR ${libcilreg_Install_Dir} | ||
|
||
CONFIGURE_COMMAND "" | ||
BUILD_COMMAND "" | ||
INSTALL_COMMAND ${CMAKE_COMMAND} -E env CIL_VERSION=0.10.0 SRC_DIR=${${proj}_BINARY_DIR} RECIPE_DIR=${${proj}_SOURCE_DIR}/Wrappers/Python/conda-recipe PYTHON=${PYTHON_EXECUTABLE} bash ${${proj}_SOURCE_DIR}/Wrappers/Python/conda-recipe/build.sh | ||
CMAKE_ARGS | ||
-DCMAKE_INSTALL_PREFIX=${libcilreg_Install_Dir} | ||
DEPENDS | ||
${${proj}_DEPENDENCIES} | ||
) | ||
endif() | ||
|
||
|
||
set(${proj}_ROOT ${${proj}_SOURCE_DIR}) | ||
set(${proj}_INCLUDE_DIR ${${proj}_SOURCE_DIR}) | ||
|
||
else() | ||
if(${USE_SYSTEM_${externalProjName}}) | ||
find_package(${proj} ${${externalProjName}_REQUIRED_VERSION} REQUIRED) | ||
message("USING the system ${externalProjName}, set ${externalProjName}_DIR=${${externalProjName}_DIR}") | ||
endif() | ||
ExternalProject_Add_Empty(${proj} DEPENDS "${${proj}_DEPENDENCIES}" | ||
SOURCE_DIR ${${proj}_SOURCE_DIR} | ||
BINARY_DIR ${${proj}_BINARY_DIR} | ||
DOWNLOAD_DIR ${${proj}_DOWNLOAD_DIR} | ||
STAMP_DIR ${${proj}_STAMP_DIR} | ||
TMP_DIR ${${proj}_TMP_DIR} | ||
) | ||
endif() | ||
|
||
mark_as_superbuild( | ||
VARS | ||
${externalProjName}_DIR:PATH | ||
LABELS | ||
"FIND_PACKAGE" | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#======================================================================== | ||
# Author: Benjamin A Thomas | ||
# Author: Kris Thielemans | ||
# Author: Edoardo Pasca | ||
# Copyright 2017 University College London | ||
# Copyright 2017 STFC | ||
# | ||
# This file is part of the CCP PETMR Synergistic Image Reconstruction Framework (SIRF) SuperBuild. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0.txt | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# 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. | ||
# | ||
#========================================================================= | ||
|
||
#This needs to be unique globally | ||
set(proj CIL) | ||
|
||
# Set dependency list | ||
set(${proj}_DEPENDENCIES CCPi-Framework CCPi-RGL) | ||
|
||
# Include dependent projects if any | ||
ExternalProject_Include_Dependencies(${proj} DEPENDS_VAR ${proj}_DEPENDENCIES) | ||
|
||
# Set external name (same as internal for now) | ||
set(externalProjName ${proj}) | ||
|
||
set(${proj}_SOURCE_DIR "${SOURCE_ROOT_DIR}/${proj}" ) | ||
set(${proj}_BINARY_DIR "${SUPERBUILD_WORK_DIR}/builds/${proj}/build" ) | ||
set(${proj}_DOWNLOAD_DIR "${SUPERBUILD_WORK_DIR}/downloads/${proj}" ) | ||
set(${proj}_STAMP_DIR "${SUPERBUILD_WORK_DIR}/builds/${proj}/stamp" ) | ||
set(${proj}_TMP_DIR "${SUPERBUILD_WORK_DIR}/builds/${proj}/tmp" ) | ||
|
||
ExternalProject_Add_Empty(${proj} DEPENDS "${${proj}_DEPENDENCIES}" | ||
SOURCE_DIR ${${proj}_SOURCE_DIR} | ||
BINARY_DIR ${${proj}_BINARY_DIR} | ||
DOWNLOAD_DIR ${${proj}_DOWNLOAD_DIR} | ||
STAMP_DIR ${${proj}_STAMP_DIR} | ||
TMP_DIR ${${proj}_TMP_DIR} | ||
) | ||
|
||
mark_as_superbuild( | ||
VARS | ||
${externalProjName}_DIR:PATH | ||
LABELS | ||
"FIND_PACKAGE" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dates