Skip to content
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

Conda #112

Draft
wants to merge 67 commits into
base: master
Choose a base branch
from
Draft

Conda #112

Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
1c2bd46
first working conda recipe
paskino Apr 5, 2018
a283c0c
use PYTHON_DEST to point to the site_packages
paskino Apr 10, 2018
7dbd1c8
do not overwrite the PYTHON_DEST?
paskino Apr 10, 2018
1585c6d
removed messages
paskino Apr 11, 2018
d2e1615
updated about, removed SIRF_VERSION env var
paskino Apr 11, 2018
cd54fe9
pulls the 1.0.0 tag
paskino Apr 11, 2018
234ab0e
removed SIRF_VERSION env var
paskino Apr 11, 2018
ed2c6a1
initial setup.py
casperdcl Apr 17, 2018
f4ccbf6
backward-compatible setup.py
casperdcl Apr 17, 2018
143c847
Merge remote-tracking branch 'origin/setup_py' into conda
paskino Apr 23, 2018
32b1332
missing packages
casperdcl Apr 24, 2018
9adb67d
added missing package
paskino Apr 24, 2018
a167583
bugfixes
paskino Apr 24, 2018
7057402
Merge remote-tracking branch 'origin/setup_py' into conda
paskino Apr 24, 2018
e84622f
bugfixes
paskino Apr 24, 2018
7495207
copies the .so into the site-packages
paskino Apr 24, 2018
011cc36
copies the .so into the site-packages
paskino Apr 24, 2018
1f74917
pip -> setup.py
casperdcl Apr 24, 2018
08a9712
missing docker devel cache
casperdcl Apr 24, 2018
9c32624
pyvenv -> miniconda
casperdcl Apr 24, 2018
6493243
added dependency
paskino Apr 25, 2018
3e060be
Merge remote-tracking branch 'origin/setup_py' into conda
paskino Apr 25, 2018
04f6d8f
removed boost dependency
paskino Apr 26, 2018
894ebb9
Added dependency
paskino May 3, 2018
fefe1f5
build latest SIRF, use pre-built boost
paskino May 3, 2018
e3ebd13
use PYTHON_DEST to point to the site_packages
paskino Apr 10, 2018
a34049f
first working conda recipe
paskino Apr 5, 2018
3c31770
updated about, removed SIRF_VERSION env var
paskino Apr 11, 2018
8c8b5ce
removed SIRF_VERSION env var
paskino Apr 11, 2018
0c96e87
bugfixes
paskino Apr 24, 2018
947c285
bugfixes
paskino Apr 24, 2018
021fef7
added dependency
paskino Apr 25, 2018
28fc8c9
removed boost dependency
paskino Apr 26, 2018
5acdcf3
Added dependency
paskino May 3, 2018
f9e7507
updated about, removed SIRF_VERSION env var
paskino Apr 11, 2018
cfe7573
removed SIRF_VERSION env var
paskino Apr 10, 2018
f205edc
bugfixes
paskino Apr 24, 2018
6469b60
added dependency
paskino Apr 25, 2018
d5d3306
removed boost dependency
paskino Apr 26, 2018
a06bd85
Added dependency
paskino May 3, 2018
b641d11
update SIRF tag to current master
casperdcl May 3, 2018
8f91cc8
build Boost, remove dependency on Boost in meta.yaml
paskino May 4, 2018
2184dac
Merge branch 'conda' of https://github.com/CCPPETMR/SIRF-SuperBuild i…
paskino Jun 25, 2018
f086303
Merge branch 'conda' of https://github.com/CCPPETMR/SIRF-SuperBuild i…
paskino Jun 25, 2018
04212a5
first working compilation of SIRF with conda
paskino Jan 30, 2019
fd94dce
Merge remote-tracking branch 'origin' into conda
paskino Jul 9, 2019
a97725b
fixed dependency
paskino Jul 12, 2019
50a83b6
changed SIRF version; add ITK
paskino Jul 12, 2019
8fc0f85
allows build of Zlib if not present on system
paskino Jul 31, 2019
ee5e5d8
updated gadgetron version
paskino Jul 31, 2019
3e7c6c5
added build variants file
paskino Jul 31, 2019
d5421d3
added hdf5
paskino Jul 31, 2019
63051ae
additional fixes
paskino Jul 31, 2019
9901082
updated recipe
paskino Jul 31, 2019
0ece523
added build variants for armadillo
paskino Jul 31, 2019
c60fffd
Merge tag 'v2.1.0' into conda
paskino Nov 27, 2019
eadc5f5
require Boost 1.68
paskino Nov 28, 2019
6499445
install in CONDA build environment
paskino Nov 28, 2019
d4b0c4b
fix run boost requirement
paskino Nov 28, 2019
c782334
updated version strings
paskino Nov 28, 2019
3770aaa
added niftyreg
paskino Nov 28, 2019
d0d3b74
updated meta
paskino Nov 29, 2019
e54fe60
Merge remote-tracking branch 'origin' into conda
paskino Feb 14, 2021
113fa93
work in progress
paskino Feb 15, 2021
3e3ec95
added missing_dso_whitelist
paskino Feb 15, 2021
e626863
add _openmp_mutex
paskino Feb 15, 2021
6ead04e
updated recipes
paskino Feb 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions SuperBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -336,5 +336,56 @@ endif()
configure_file(env_ccppetmr.sh.in ${CCPPETMR_INSTALL}/bin/env_ccppetmr.sh)
configure_file(env_ccppetmr.csh.in ${CCPPETMR_INSTALL}/bin/env_ccppetmr.csh)

# Install python packages via pip and setup.py
if(PYTHONINTERP_FOUND)
set(PYTHON_SETUP_PKGS "sirf" CACHE INTERNAL "list of provided python packages")

# alias sirf.p* -> p* for backward-compatibility
function(python_pkg_alias PY_PKG_NEW PY_PKG_OLD)
list(APPEND PYTHON_SETUP_PKGS ${PY_PKG_NEW})
set(PYTHON_SETUP_PKGS "${PYTHON_SETUP_PKGS}" PARENT_SCOPE)
set(SETUP_PY_INIT_IN "${CMAKE_CURRENT_SOURCE_DIR}/SuperBuild/__init__.py.in")
set(SETUP_PY_INIT "${PYTHON_DEST}/${PY_PKG_NEW}/__init__.py")
configure_file("${SETUP_PY_INIT_IN}" "${SETUP_PY_INIT}")
# message(STATUS "setup.py:${SETUP_PY_INIT}")
message(STATUS "setup.py:${PY_PKG_NEW}<-${PY_PKG_OLD}")
endfunction(python_pkg_alias)
python_pkg_alias(pGadgetron "sirf.pGadgetron")
python_pkg_alias(pSTIR "sirf.pSTIR")
python_pkg_alias(pUtilities "sirf.pUtilities")
python_pkg_alias(pygadgetron "sirf.pygadgetron")
python_pkg_alias(pystir "sirf.pystir")
python_pkg_alias(pyiutilities "sirf.pyiutilities")
# convert to python CSV tuple for setup.py configure_file
string(REPLACE ";" "', '" PYTHON_SETUP_PKGS_CSV "${PYTHON_SETUP_PKGS}")
set(PYTHON_SETUP_PKGS_CSV "'${PYTHON_SETUP_PKGS_CSV}'")
# message(STATUS "setup.py:pacakges:${PYTHON_SETUP_PKGS_CSV}")

# Create setup.py
set(SETUP_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/SuperBuild/setup.py.in")
set(SETUP_PY "${PYTHON_DEST}/setup.py")
set(SETUP_PY_INIT "${PYTHON_DEST}/sirf/__init__.py")
message(STATUS "setup.py:${SETUP_PY}")
configure_file("${SETUP_PY_IN}" "${SETUP_PY}")

# python setup.py build
add_custom_command(OUTPUT "${SETUP_PY_INIT}"
COMMAND "${CMAKE_COMMAND}" -E make_directory "${PYTHON_DEST}/sirf"
COMMAND "${CMAKE_COMMAND}" -E touch "${SETUP_PY_INIT}"
COMMAND "${PYTHON_EXECUTABLE}" setup.py build
DEPENDS "${SETUP_PY_IN}"
WORKING_DIRECTORY "${PYTHON_DEST}")

add_custom_target(pybuild_sirf ALL DEPENDS ${SETUP_PY_INIT})

if (NOT CONDA_BUILD)
# python setup.py install
install(CODE "execute_process(COMMAND\n\
\"${PYTHON_EXECUTABLE}\" setup.py install\n\
WORKING_DIRECTORY \"${PYTHON_DEST}\")")
endif()
endif(PYTHONINTERP_FOUND)


# add tests
enable_testing()
1 change: 1 addition & 0 deletions SuperBuild/External_GTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ if(NOT ( DEFINED "USE_SYSTEM_${externalProjName}" AND "${USE_SYSTEM_${externalPr
if(${USE_SYSTEM_${externalProjName}})
message(STATUS "USING the system ${externalProjName}, set GTEST_ROOT if needed.")
find_package(${proj} ${${externalProjName}_REQUIRED_VERSION} REQUIRED)
get_filename_component(GTEST_ROOT ${GTEST_LIBRARIES} DIRECTORY)
endif()
ExternalProject_Add_Empty(${proj} DEPENDS "${${proj}_DEPENDENCIES}"
SOURCE_DIR ${${proj}_SOURCE_DIR}
Expand Down
1 change: 1 addition & 0 deletions SuperBuild/__init__.py.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from ${PY_PKG_OLD} import *
40 changes: 40 additions & 0 deletions SuperBuild/setup.py.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup

__author__ = "Casper da Costa-Luis <[email protected]>"
__version__ = "1.0.0"


setup(
name='sirf',
version=__version__,
description='CCP PET-MR SIRF',
license='Apache 2.0',
author='CCP PET-MR',
author_email='[email protected]',
url='https://github.com/CCPPETMR/SIRF',
platforms=['any'],
package_data={'sirf': ['*.so']},
packages=[${PYTHON_SETUP_PKGS_CSV}],
long_description='',
classifiers=[
# Trove classifiers
# (https://pypi.python.org/pypi?%3Aaction=list_classifiers)
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7'
],
keywords='image reconstruction pet mr medical imaging',
)
72 changes: 72 additions & 0 deletions conda-recipe/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/bash
#
# Script to install/update the CCP-PETMR VM. It could also be used for any other system
# but will currently change your .sirfrc. This is to be avoided later on.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

incorrect comment

#
# Author: Edoardo Pasca
# Copyright 2016-2018 University College London
# Copyright 2016-2018 Rutherford Appleton Laboratory STFC
#
# This is software developed for the Collaborative Computational
# Project in Positron Emission Tomography and Magnetic Resonance imaging
# (http://www.ccppetmr.ac.uk/).

# 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.
#
#=========================================================================

#if [ -z "$SIRF_VERSION" ]; then
# echo "Need to set SIRF_VERSION"
# exit 1
#fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

until we fix this, will need to add it to the checklist


mkdir "$SRC_DIR/build"
mkdir "$SRC_DIR/SIRF-SuperBuild"
cp -rv "$RECIPE_DIR/../" "$SRC_DIR/SIRF-SuperBuild"

cd $SRC_DIR/build

echo "$SRC_DIR/ccpi/Python"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really what?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ccpi...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You know, I'm torn


#site-packages ${SP_DIR}/sirf
cmake ../SIRF-SuperBuild \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
-DPYTHON_DEST_DIR=${PREFIX}/python\
-USIRF_URL \
-USIRF_TAG \
-DSIRF_TAG=a9170557c0f883934033700c1dd312a3a74611d6\
-USTIR_URL \
-USTIR_TAG \
-UGadgetron_URL \
-UGadgetron_TAG \
-UISMRMRD_URL \
-UISMRMRD_TAG \
-DBUILD_GADGETRON=On \
-DUSE_SYSTEM_SWIG=On \
-DUSE_SYSTEM_Boost=Off \
-DUSE_SYSTEM_Armadillo=On \
-DUSE_SYSTEM_FFTW3=On \
-DUSE_SYSTEM_HDF5=ON \
-DBUILD_siemens_to_ismrmrd=On \
-DUSE_SYSTEM_GTEST=On\
-DCONDA_BUILD=On

make -j1
cp ${PREFIX}/share/gadgetron/config/gadgetron.xml.example ${PREFIX}/share/gadgetron/config/gadgetron.xml

cd ${PREFIX}/python
${PYTHON} setup.py install

# add to
#echo "${PREFIX}/python" > ${PREFIX}
#${PREFIX}/python
60 changes: 60 additions & 0 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package:
name: sirf
# version: {{ environ['SIRF_VERSION'] }}
version: 1.0.0


build:
preserve_egg_dir: False
# number: 0

requirements:
build:
#- boost ==1.64.0
#- boost-cpp ==1.64.0
# - boost
# - boost-cpp
- python 3.6 # [py36]
- python 2.7 # [py27]
- cmake >=3.1
- vc 14 # [win and py36]
- vc 9 # [win and py27]
- numpy
- scipy
- matplotlib
- docopt
- h5py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

99% sure we don't need this

- libxml2
- psutil
- nose
KrisThielemans marked this conversation as resolved.
Show resolved Hide resolved
- coverage
- fftw
- swig >=3
- libxslt
- armadillo
- gtest


run:
- vc 14 # [win and py35]
- vc 9 # [win and py27]
- python 3.6 # [py36]
- python 2.7 # [py27]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drop this of course

#- boost-dev ==1.63
- numpy
- scipy
- matplotlib
- docopt
- h5py
- psutil
- fftw
- libgcc-ng
- libstdcxx-ng
- openblas
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not for build?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like there's a difference between build, install (runtime), and test. I'd think nose and coverage fall into the last category, and things like h5py for install? Is there a way to specify these three categories for conda? I'm sure at least two are possible. At least split into sections with comments

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed there is. Currently The tricky bit is afaik that the install phase of the external packages is run during the make phase.

- armadillo
- gtest

about:
home: http://www.ccppetmr.ac.uk
license: Apache 2.0 license
summary: 'Synergistic Image Reconstruction Framework'
72 changes: 72 additions & 0 deletions conda/armadillo/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/bash
#
# Script to install/update the CCP-PETMR VM. It could also be used for any other system
# but will currently change your .sirfrc. This is to be avoided later on.
#
# Author: Edoardo Pasca
# Copyright 2016-2018 University College London
# Copyright 2016-2018 Rutherford Appleton Laboratory STFC
#
# This is software developed for the Collaborative Computational
# Project in Positron Emission Tomography and Magnetic Resonance imaging
# (http://www.ccppetmr.ac.uk/).

# 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.
#
#=========================================================================

#if [ -z "$SIRF_VERSION" ]; then
# echo "Need to set SIRF_VERSION"
# exit 1
#fi

mkdir "$SRC_DIR/build"
mkdir "$SRC_DIR/SIRF-SuperBuild"
cp -rv "$RECIPE_DIR/../../" "$SRC_DIR/SIRF-SuperBuild"

cd $SRC_DIR/build


#site-packages ${SP_DIR}/sirf
cmake ../SIRF-SuperBuild \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
-DPYTHON_DEST_DIR=${PREFIX}/python\
-USIRF_URL \
-USIRF_TAG \
-DSIRF_TAG=v2.0.0\
-USTIR_URL \
-USTIR_TAG \
-UGadgetron_URL \
-UGadgetron_TAG \
-UISMRMRD_URL \
-UISMRMRD_TAG \
-DBUILD_GADGETRON=On \
-DUSE_SYSTEM_SWIG=Off \
-DUSE_SYSTEM_Boost=On \
-DUSE_SYSTEM_Armadillo=Off \
-DUSE_SYSTEM_FFTW3=On \
-DUSE_SYSTEM_HDF5=ON \
-DBUILD_siemens_to_ismrmrd=Off \
-DUSE_SYSTEM_GTest=Off\
-DCONDA_BUILD=On

make -j1 Armadillo

#cp ${PREFIX}/share/gadgetron/config/gadgetron.xml.example ${PREFIX}/share/gadgetron/config/gadgetron.xml

#cd ${PREFIX}/python
#${PYTHON} setup.py install

# add to
#echo "${PREFIX}/python" > ${PREFIX}
#${PREFIX}/python
4 changes: 4 additions & 0 deletions conda/armadillo/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
python:
- 2.7
numpy:
- 1.11
59 changes: 59 additions & 0 deletions conda/armadillo/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package:
name: armadillo
version: 7.800.0


build:
preserve_egg_dir: False
# number: 0

requirements:
build:
#- boost ==1.64.0
- boost-cpp >=1.63.0
- boost >=1.63
# - boost-cpp
# - python 3.6 # [py36]
# - python 2.7 # [py27]
- cmake >=3.1
- vc 14 # [win and py36]
- vc 9 # [win and py27]
# - numpy
# - scipy
# - matplotlib
# - docopt
- h5py
# - libxml2
- psutil
- nose
- coverage
- fftw
# - swig >=3
# - libxslt
# - armadillo
# - gtest


run:
- boost >=1.63
- vc 14 # [win and py35]
- vc 9 # [win and py27]
# - python 3.6 # [py36]
# - python 2.7 # [py27]
# - numpy
# - scipy
# - matplotlib
# - docopt
- h5py
- psutil
- fftw
- libgcc-ng
- libstdcxx-ng
- openblas
# - armadillo
# - gtest

about:
home: http://www.ccppetmr.ac.uk
license: Apache 2.0 license
summary: 'Synergistic Image Reconstruction Framework'
Loading