From f972863712eb165e5a8bd79282b0bcfccefc5d7a Mon Sep 17 00:00:00 2001 From: Glenn Johnson Date: Tue, 2 Nov 2021 04:49:22 -0500 Subject: fsl: new version, updated constraints and patches (#27129) - add version 6.0.5 - add patch to allow fsl to use newer gcc versions - add patch to allow fsl to use newer cuda versions - remove constraints on gcc and cuda versions - add filters to prevent using system headers and libraries - clean up the installed tree --- .../packages/fsl/fslpython_install_v6.patch | 39 -------------------- .../packages/fsl/fslpython_install_v604.patch | 39 ++++++++++++++++++++ .../packages/fsl/fslpython_install_v605.patch | 42 ++++++++++++++++++++++ .../repos/builtin/packages/fsl/libxmlpp_bool.patch | 30 ++++++++++++++++ var/spack/repos/builtin/packages/fsl/package.py | 35 +++++++++++++++--- 5 files changed, 141 insertions(+), 44 deletions(-) delete mode 100644 var/spack/repos/builtin/packages/fsl/fslpython_install_v6.patch create mode 100644 var/spack/repos/builtin/packages/fsl/fslpython_install_v604.patch create mode 100644 var/spack/repos/builtin/packages/fsl/fslpython_install_v605.patch create mode 100644 var/spack/repos/builtin/packages/fsl/libxmlpp_bool.patch (limited to 'var') diff --git a/var/spack/repos/builtin/packages/fsl/fslpython_install_v6.patch b/var/spack/repos/builtin/packages/fsl/fslpython_install_v6.patch deleted file mode 100644 index 93eac4cb73..0000000000 --- a/var/spack/repos/builtin/packages/fsl/fslpython_install_v6.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- a/etc/fslconf/fslpython_install.sh 2020-07-25 09:20:04.000000000 -0500 -+++ b/etc/fslconf/fslpython_install.sh 2020-11-09 20:12:59.458736979 -0600 -@@ -204,19 +204,19 @@ - # - https://github.com/conda/conda/issues/8804 - - # Try to make downloads more resilient --"${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set remote_read_timeout_secs 240 --"${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set remote_connect_timeout_secs 20 --"${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set remote_max_retries 10 --"${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set remote_backoff_factor 5 --"${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set safety_checks warn -+"${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set remote_read_timeout_secs 240 -+"${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set remote_connect_timeout_secs 20 -+"${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set remote_max_retries 10 -+"${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set remote_backoff_factor 5 -+"${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set safety_checks warn - - # Channel priority: - # - conda-forge (highest priority) - # - defaults (gets automatically added on the first call) - # - fsl (lowest priority) --"${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set channel_priority strict --"${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --add channels conda-forge --"${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --append channels https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/channel -+"${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set channel_priority strict -+"${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --add channels conda-forge -+"${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --append channels https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/channel - - - ############################## -@@ -229,7 +229,7 @@ - if [ ${quiet} -ne 1 ]; then - echo "Stage 2" - fi --FSLDIR=$fsl_dir "${miniconda_bin_dir}/conda" env create -v \ -+FSLDIR=$fsl_dir "${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda-env" create -v \ - -f "${script_dir}/fslpython_environment.yml" \ - 2>> "${miniconda_install_log}" | \ - ${script_dir}/progress.sh 133 ${quiet} 1>> "${miniconda_install_log}" diff --git a/var/spack/repos/builtin/packages/fsl/fslpython_install_v604.patch b/var/spack/repos/builtin/packages/fsl/fslpython_install_v604.patch new file mode 100644 index 0000000000..93eac4cb73 --- /dev/null +++ b/var/spack/repos/builtin/packages/fsl/fslpython_install_v604.patch @@ -0,0 +1,39 @@ +--- a/etc/fslconf/fslpython_install.sh 2020-07-25 09:20:04.000000000 -0500 ++++ b/etc/fslconf/fslpython_install.sh 2020-11-09 20:12:59.458736979 -0600 +@@ -204,19 +204,19 @@ + # - https://github.com/conda/conda/issues/8804 + + # Try to make downloads more resilient +-"${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set remote_read_timeout_secs 240 +-"${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set remote_connect_timeout_secs 20 +-"${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set remote_max_retries 10 +-"${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set remote_backoff_factor 5 +-"${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set safety_checks warn ++"${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set remote_read_timeout_secs 240 ++"${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set remote_connect_timeout_secs 20 ++"${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set remote_max_retries 10 ++"${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set remote_backoff_factor 5 ++"${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set safety_checks warn + + # Channel priority: + # - conda-forge (highest priority) + # - defaults (gets automatically added on the first call) + # - fsl (lowest priority) +-"${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set channel_priority strict +-"${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --add channels conda-forge +-"${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --append channels https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/channel ++"${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set channel_priority strict ++"${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --add channels conda-forge ++"${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --append channels https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/channel + + + ############################## +@@ -229,7 +229,7 @@ + if [ ${quiet} -ne 1 ]; then + echo "Stage 2" + fi +-FSLDIR=$fsl_dir "${miniconda_bin_dir}/conda" env create -v \ ++FSLDIR=$fsl_dir "${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda-env" create -v \ + -f "${script_dir}/fslpython_environment.yml" \ + 2>> "${miniconda_install_log}" | \ + ${script_dir}/progress.sh 133 ${quiet} 1>> "${miniconda_install_log}" diff --git a/var/spack/repos/builtin/packages/fsl/fslpython_install_v605.patch b/var/spack/repos/builtin/packages/fsl/fslpython_install_v605.patch new file mode 100644 index 0000000000..4daadbfc69 --- /dev/null +++ b/var/spack/repos/builtin/packages/fsl/fslpython_install_v605.patch @@ -0,0 +1,42 @@ +diff -ru a/etc/fslconf/fslpython_install.sh b/etc/fslconf/fslpython_install.sh +--- a/etc/fslconf/fslpython_install.sh 2021-07-15 10:05:03.000000000 +0000 ++++ b/etc/fslconf/fslpython_install.sh 2021-11-01 01:01:03.088119423 +0000 +@@ -204,19 +204,19 @@ + # - https://github.com/conda/conda/issues/8804 + + # Try to make downloads more resilient +-"${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set remote_read_timeout_secs 240 +-"${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set remote_connect_timeout_secs 20 +-"${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set remote_max_retries 10 +-"${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set remote_backoff_factor 5 +-"${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set safety_checks warn ++"${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set remote_read_timeout_secs 240 ++"${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set remote_connect_timeout_secs 20 ++"${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set remote_max_retries 10 ++"${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set remote_backoff_factor 5 ++"${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set safety_checks warn + + # Channel priority: + # - conda-forge (highest priority) + # - defaults (gets automatically added on the first call) + # - fsl (lowest priority) +-"${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set channel_priority strict +-"${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --add channels conda-forge +-"${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --append channels https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/channel ++"${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --set channel_priority strict ++"${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --add channels conda-forge ++"${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda" config --file "${miniconda_root_dir}"/.condarc --append channels https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/channel + + + ############################## +@@ -235,7 +235,7 @@ + # different on linux. Also is likely to need + # updating whenever the fslpython environment + # specification is changed. +-FSLDIR=$fsl_dir "${miniconda_bin_dir}/conda" env create \ ++FSLDIR=$fsl_dir "${miniconda_bin_dir}/python" "${miniconda_bin_dir}/conda" env create \ + -f "${script_dir}/fslpython_environment.yml" \ + 2>> "${miniconda_install_log}" | \ + ${script_dir}/progress.sh 400 ${quiet} 1>> "${miniconda_install_log}" +Only in b/etc/fslconf: fslpython_install.sh.orig +Only in b/etc/fslconf: fslpython_install.sh.rej diff --git a/var/spack/repos/builtin/packages/fsl/libxmlpp_bool.patch b/var/spack/repos/builtin/packages/fsl/libxmlpp_bool.patch new file mode 100644 index 0000000000..c95f25405b --- /dev/null +++ b/var/spack/repos/builtin/packages/fsl/libxmlpp_bool.patch @@ -0,0 +1,30 @@ +diff -ru a/extras/src/libxmlpp/libxml++/io/istreamparserinputbuffer.cc b/extras/src/libxmlpp/libxml++/io/istreamparserinputbuffer.cc +--- a/extras/src/libxmlpp/libxml++/io/istreamparserinputbuffer.cc 2019-05-20 12:50:12.000000000 +0000 ++++ b/extras/src/libxmlpp/libxml++/io/istreamparserinputbuffer.cc 2021-10-31 22:29:47.465118993 +0000 +@@ -39,6 +39,6 @@ + + bool IStreamParserInputBuffer::do_close() + { +- return input_; ++ return static_cast(input_); + } + } +diff -ru a/extras/src/libxmlpp/libxml++/io/ostreamoutputbuffer.cc b/extras/src/libxmlpp/libxml++/io/ostreamoutputbuffer.cc +--- a/extras/src/libxmlpp/libxml++/io/ostreamoutputbuffer.cc 2019-05-20 12:50:12.000000000 +0000 ++++ b/extras/src/libxmlpp/libxml++/io/ostreamoutputbuffer.cc 2021-10-31 22:31:47.656434780 +0000 +@@ -29,13 +29,13 @@ + // here we rely on the ostream implicit conversion to boolean, to know if the stream can be used and/or if the write succeded. + if(output_) + output_.write(buffer, len); +- return output_; ++ return static_cast(output_); + } + + bool OStreamOutputBuffer::do_close() + { + if(output_) + output_.flush(); +- return output_; ++ return static_cast(output_); + } + } diff --git a/var/spack/repos/builtin/packages/fsl/package.py b/var/spack/repos/builtin/packages/fsl/package.py index 2dfafa2c69..ab656c4c79 100644 --- a/var/spack/repos/builtin/packages/fsl/package.py +++ b/var/spack/repos/builtin/packages/fsl/package.py @@ -3,6 +3,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import glob import os from spack import * @@ -22,6 +23,7 @@ class Fsl(Package, CudaPackage): url = "file://{0}/fsl-5.0.10-sources.tar.gz".format(os.getcwd()) manual_download = True + version('6.0.5', sha256='df12b0b1161a26470ddf04e4c5d5d81580a04493890226207667ed8fd2b4b83f') version('6.0.4', sha256='58b88f38e080b05d70724d57342f58e1baf56e2bd3b98506a72b4446cad5033e') version('5.0.10', sha256='ca183e489320de0e502a7ba63230a7f55098917a519e8c738b005d526e700842') @@ -33,18 +35,25 @@ class Fsl(Package, CudaPackage): depends_on('openblas', when='@6:') depends_on('vtk@:8') - conflicts('%gcc@:4.7,5.5:') - conflicts('^cuda@9.2:') conflicts('cuda_arch=none', when='+cuda', msg='must select a CUDA architecture') conflicts('platform=darwin', msg='currently only packaged for linux') patch('build_log.patch') - patch('eddy_Makefile.patch', when='@6:') + patch('eddy_Makefile.patch', when='@6.0.4') patch('iconv.patch') patch('fslpython_install_v5.patch', when='@:5') - patch('fslpython_install_v6.patch', when='@6:') + patch('fslpython_install_v604.patch', when='@6.0.4') + patch('fslpython_install_v605.patch', when='@6.0.5') + + # Allow fsl to use newer versions of cuda + patch('https://aur.archlinux.org/cgit/aur.git/plain/005-fix_cuda_thrust_include.patch?h=fsl', + sha256='9471addfc2f880350eedadcb99cb8b350abf42be1c0652ccddf49e34e5e48734', + level=2) + + # allow newer compilers + patch('libxmlpp_bool.patch') # These patches disable FSL's attempts to try to submit a subset of FSL # computations to an SGE queue system. That auto-submit mechanism only @@ -161,10 +170,26 @@ class Fsl(Package, CudaPackage): build_settings.filter(r'(^ptx2_MASTERBUILD)\s*=.*', r'\1 = COMPILE_GPU=0') + filter_file(r'(configure_opts=".*)"', + r'\1 --x-includes={0} --x-libraries={1}"'.format( + self.spec['libx11'].prefix.include, + self.spec['libx11'].prefix.lib), + join_path('extras', 'src', 'tk', 'unix', 'fslconfigure')) + filter_file(r' -L/lib64', + r'', + join_path('src', 'fabber_core', 'Makefile')) + def install(self, spec, prefix): - build = Executable('./build') + build = Executable(join_path(self.stage.source_path, 'build')) build() + rm = which('rm') + for file in glob.glob('build*'): + rm('-f', file) + rm('-r', '-f', 'src') + rm('-r', '-f', join_path('extras', 'src')) + rm('-r', '-f', join_path('extras', 'include')) + install_tree('.', prefix) @run_after('install') -- cgit v1.2.3-70-g09d2