diff --git a/easybuild/easyconfigs/i/IMOD/IMOD-4.11.12_hdf1.12.patch b/easybuild/easyconfigs/i/IMOD/IMOD-4.11.12_hdf1.12.patch new file mode 100644 index 000000000000..94c463f639ce --- /dev/null +++ b/easybuild/easyconfigs/i/IMOD/IMOD-4.11.12_hdf1.12.patch @@ -0,0 +1,36 @@ +# Thomas Hoffmann, EMBL Heidelberg, structures-it@embl.de, 2023/08 +# add H5O_INFO_BASIC (better _ALL?) +# H5Oget_info_by_idx3 API changed for HDF5 version >= 1.12.0 +# https://stackoverflow.com/questions/62157364/why-is-hdf5-giving-a-too-few-arguments-error-here +# https://support.hdfgroup.org/ftp/HDF5/prev-releases/ReleaseFiles/hdf5-1.12.0-RELEASE.txt +diff -ru IMOD/libiimod/iihdf.c IMOD_hdf5/libiimod/iihdf.c +--- IMOD/libiimod/iihdf.c 2022-02-24 19:07:06.000000000 +0100 ++++ IMOD_hdf5/libiimod/iihdf.c 2023-08-24 18:31:53.029981337 +0200 +@@ -774,7 +774,7 @@ + } + + /* Find out if there are attributes */ +- if (!retval && H5Oget_info(groupID, &objInfo) < 0) ++ if (!retval && H5Oget_info(groupID, &objInfo, H5O_INFO_BASIC) < 0) + retval = IIERR_IO_ERROR; + if (!retval) + gdptr->numAttributes = (int)objInfo.num_attrs; +@@ -820,8 +820,7 @@ + } + + /* Get the info */ +- if (H5Oget_info_by_idx(groupID, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)ind, +- &objInfo, H5P_DEFAULT) < 0) { ++ if (H5Oget_info_by_idx(groupID, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)ind, &objInfo, H5P_DEFAULT, H5O_INFO_BASIC) < 0) { + retval = IIERR_IO_ERROR; + break; + } +@@ -931,7 +930,7 @@ + sMaxGroupNum = B3DMAX(sMaxGroupNum, groupNum); + } + dsData.dsetID = dsetID; +- if (H5Oget_info(dsetID, &objInfo) < 0) ++ if (H5Oget_info(dsetID, &objInfo, H5O_INFO_BASIC) < 0) + retval = IIERR_IO_ERROR; + if (!retval) + dsData.numAttributes = (int)objInfo.num_attrs; diff --git a/easybuild/easyconfigs/i/IMOD/IMOD-4.12.17_tiltalign_include.patch b/easybuild/easyconfigs/i/IMOD/IMOD-4.12.17_tiltalign_include.patch new file mode 100644 index 000000000000..3e649ece83f2 --- /dev/null +++ b/easybuild/easyconfigs/i/IMOD/IMOD-4.12.17_tiltalign_include.patch @@ -0,0 +1,13 @@ +# Thomas Hoffmann, EMBL Heidelberg, structures-it@embl.de, 2023/08 +diff -ru IMOD/flib/beadtrack/beadtrack.cpp IMOD_tiltalign_include/flib/beadtrack/beadtrack.cpp +--- IMOD/flib/beadtrack/beadtrack.cpp 2023-08-25 12:38:55.864116440 +0200 ++++ IMOD_tiltalign_include/flib/beadtrack/beadtrack.cpp 2023-08-25 17:13:50.646567630 +0200 +@@ -21,7 +21,7 @@ + #include "btfuncs.h" + #include "tafuncs.h" + #include "arraymaxes.h" +-#include "mapsepgroups.h" ++#include "../tiltalign/mapsepgroups.h" + #include "cgpixels.h" + #include "tltcntrl.h" + diff --git a/easybuild/easyconfigs/i/IMOD/IMOD-4.12.58_cudacc.patch b/easybuild/easyconfigs/i/IMOD/IMOD-4.12.58_cudacc.patch new file mode 100644 index 000000000000..dfe81d1da235 --- /dev/null +++ b/easybuild/easyconfigs/i/IMOD/IMOD-4.12.58_cudacc.patch @@ -0,0 +1,22 @@ +# Thomas Hoffmann, EMBL Heidelberg, structures-it@embl.de, 2024/01 +# replace hardcoded CUDA compute capabilitites in machines/rhlinux. +# Allow to be set by env $CUDACC +diff -ru IMOD/machines/rhlinux IMOD_cudacc/machines/rhlinux +--- IMOD/machines/rhlinux 2024-01-29 12:33:58.000000000 +0100 ++++ IMOD_cudacc/machines/rhlinux 2024-01-31 12:47:19.481617766 +0100 +@@ -604,10 +604,11 @@ + if ($?CUDA_DIR) then + set cudavers = `nvcc --version | sed -n -e '/[,.]/s// /g' -e '/^.*release/s///p'` + @ cudamajor = $cudavers[1] +- if ($cudamajor >= 4) set cuda_arch_opts = '-arch sm_20' +- if ($cudamajor >= 9) set cuda_arch_opts = '-arch sm_30' +- if ($cudamajor >= 11) set cuda_arch_opts = '-arch sm_35' +- if ($cudamajor >= 12) set cuda_arch_opts = '-arch sm_50' ++ #if ($cudamajor >= 4) set cuda_arch_opts = '-arch sm_20' ++ #if ($cudamajor >= 9) set cuda_arch_opts = '-arch sm_30' ++ #if ($cudamajor >= 11) set cuda_arch_opts = '-arch sm_35' ++ #if ($cudamajor >= 12) set cuda_arch_opts = '-arch sm_50' ++ set cuda_arch_opts = `echo "$CUDACC" | awk -F ';' '{for (i=1;i<=NF;i++) printf "-gencode=arch=compute_%s,code=sm_%s " , $i, $i}'` + set cudalibdir = "$CUDA_DIR/lib" + if ($cudamajor > 2 && $m64bit == true) set cudalibdir = "$CUDA_DIR/lib64" + set nvcc_flags = "$cuda_arch_opts $nvcc_flags -DUNIX -Xcompiler -fno-strict-aliasing" diff --git a/easybuild/easyconfigs/i/IMOD/IMOD-4.12.62-foss-2023a-CUDA-12.1.1.eb b/easybuild/easyconfigs/i/IMOD/IMOD-4.12.62-foss-2023a-CUDA-12.1.1.eb new file mode 100644 index 000000000000..bf7aeee0834b --- /dev/null +++ b/easybuild/easyconfigs/i/IMOD/IMOD-4.12.62-foss-2023a-CUDA-12.1.1.eb @@ -0,0 +1,132 @@ +easyblock = 'ConfigureMake' + +name = 'IMOD' +version = '4.12.62' +versionsuffix = '-CUDA-%(cudaver)s' + +homepage = 'https://bio3d.colorado.edu/imod/' +description = """IMOD is a set of image processing, modeling and display +programs used for tomographic reconstruction and for 3D reconstruction of EM +serial sections and optical sections. The package contains tools for assembling +and aligning data within multiple types and sizes of image stacks, viewing 3-D +data from any orientation, and modeling and display of the image files. IMOD +was developed primarily by David Mastronarde, Rick Gaudette, Sue Held, Jim +Kremer, Quanren Xiong, and John Heumann at the University of Colorado.""" + +toolchain = {'name': 'foss', 'version': '2023a'} +toolchainopts = {'pic': True} # openmp leads to segfault with xftoxg tool + +download_instructions = f"""{name} requires manual download from mercurial repository: + hg clone --debug http://bio3d.colorado.edu/imod/nightlyBuilds/IMOD + cd IMOD + hg update -r IMOD_%s + rm .hg* -rf + cd .. + find IMOD -print|sort| tar -czf IMOD-`cat IMOD/.version`.tar.gz -T - +""" % version.replace('.', '-') + +sources = [SOURCE_TAR_GZ] +patches = [ + 'IMOD-4.11.12_hdf1.12.patch', + 'IMOD-4.12.17_tiltalign_include.patch', + # replace hardcoded CUDA compute capabilitites in machines/rhlinux. set as CUDACC: + 'IMOD-4.12.58_cudacc.patch', +] +checksums = [ + # IMOD-4.12.62.tar.gz: + None, # can't include a valid checksum for source tarball, since it has to be created manually + # IMOD-4.11.12_hdf1.12.patch: + '19e5bff97b997c600f157dd56eddae96a7f34fef528e7f40e76ea8e19144810e', + # IMOD-4.12.17_tiltalign_include.patch: + '998c01a4f78b0d48dbffc530fcb12faaa892b1d322bce4f1643df20799845ab7', + # IMOD-4.12.58_cudacc.patch: + '9563b1ac9ab1569689d7db4380301f330290d9695988f8b31e7ea08d2601ee25', +] + +builddependencies = [('groff', '1.22.4')] + +dependencies = [ + ('LibTIFF', '4.5.0'), + ('Qt5', '5.15.10'), + ('Java', '11', '', SYSTEM), + ('HDF5', '1.14.0'), + ('Python', '3.11.3'), + ('libGLU', '9.0.3'), + ('tcsh', '6.24.10'), + ('CUDA', '12.1.1', '', SYSTEM), + ('UCX-CUDA', '1.14.1', versionsuffix), +] + +# parallel build sometimes fails +parallel = 1 + +# modify all qmake pro files in order to pass CFLAGS +_qmake_pass_cflags = "find -name *.pro -exec sed -i -e '$aQMAKE_CXXFLAGS += $$(CFLAGS)' {} \\; && " + +# exports required for configure and build +_exports = 'export QTDIR=$EBROOTQT5 && ' +_exports += "export CUDACC='%(cuda_cc_cmake)s' && " +_exports += 'export HDF5_DIR=$EBROOTHDF5 && ' +_exports += 'export QMAKESPEC=$EBROOTQT5/mkspecs/`qmake -query QMAKE_SPEC` && ' +_exports += 'export CUDA_DIR=$CUDA_HOME && ' +# readw_or_imod.f and others with gfortran10: +# Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/INTEGER(2)) +# => set -fallow-argument-mismatch. Runs through without this option with GCC 8.3.0. +_exports += 'export CFLAGS="$CFLAGS -fallow-argument-mismatch" && ' # required for gfortran10 + +# rename pysrc/pip.py to pysrc/PIP.py +_renamePip = """sed -i 's/from pip/from PIP/g' pysrc/* &&""" +_renamePip += """mv pysrc/pip.py pysrc/PIP.py &&""" +_renamePip += """sed -i 's/pip.py/PIP.py/g' pysrc/Makefile &&""" + +_useTcsh = 'sed -i "s|#!/bin/csh -f|#!/usr/bin/env tcsh|g;s|#! /bin/csh -f|#!/usr/bin/env tcsh|g" ' +_useTcsh += ' %(builddir)s/IMOD/{manpages/convert,setup,setup2,machines/rhlinux,packMacApps} &&' + +preconfigopts = _exports +preconfigopts += _renamePip +preconfigopts += _qmake_pass_cflags +preconfigopts += _useTcsh + +# IMOD's configure script is named setup and does not know the parameter --prefix, but -i. +# CFLAGs are passed with -flags. +configure_cmd = './setup ' +configure_cmd += '-c gnu ' # htf it finds icc? +configure_cmd += '-flags "$CFLAGS" ' # inject CFLAGS +configure_cmd += '-i %(installdir)s ' # set installdir +configure_without_installdir = True + +prebuildopts = _exports + +# create some missing directories required for installation process: +preinstallopts = 'mkdir %(installdir)s/{man/cat1,bin,autodoc,SystemTemplate,lib/imodplug,com,html,Plugins} -p && ' + +# patch hardcoded /usr/bin/python to use Python included as dependency +preinstallopts += "find pysrc -name '*.py' | xargs sed -i 's@^#!/usr/bin/python@#!/usr/bin/env python@g' && " +preinstallopts += "export PYTHONPATH=%(builddir)s/IMOD/pysrc:$PYTHONPATH && " +preinstallopts += "ls manpages/{csvtohtml,adocdefaults} | xargs sed -i 's@^#!.*/python -u@#!/usr/bin/env python@g' && " +preinstallopts += "xargs sed -i 's@^#!.*/python -u@#!/usr/bin/env python@g' html/makeqhp && " + +modextrapaths = {'PYTHONPATH': 'pylib'} + +modextravars = { + 'IMOD_DIR': "%(installdir)s", + 'IMOD_PLUGIN_DIR': '%(installdir)s/lib/imodplug', + 'FOR_DISABLE_STACK_TRACE': '1', +} + +modluafooter = """ +setenv("IMOD_JAVADIR", os.getenv("JAVA_HOME")) +""" + +modtclfooter = """ +setenv IMOD_JAVADIR $::env(JAVA_HOME) +""" + + +modloadmsg = 'Please set the environment variable $IMOD_CALIB_DIR if appropriate.' +sanity_check_paths = { + 'files': ['VERSION', 'bin/subm'], + 'dirs': ['bin', 'lib', 'com', 'autodoc', 'pylib', 'Plugins', 'man', 'SystemTemplate'], +} +sanity_check_commands = [('xftoxg', '-h')] +moduleclass = 'vis'