Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
36 changes: 36 additions & 0 deletions easybuild/easyconfigs/i/IMOD/IMOD-4.11.12_hdf1.12.patch
Original file line number Diff line number Diff line change
@@ -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;
13 changes: 13 additions & 0 deletions easybuild/easyconfigs/i/IMOD/IMOD-4.12.17_tiltalign_include.patch
Original file line number Diff line number Diff line change
@@ -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"

125 changes: 125 additions & 0 deletions easybuild/easyconfigs/i/IMOD/IMOD-4.12.58-foss-2023a-CUDA-12.1.1.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
easyblock = 'ConfigureMake'

name = 'IMOD'
version = '4.12.58'
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"""
To generate the source tarball for %(name)s:
hg clone --debug http://bio3d.colorado.edu/%(namelower)s/nightlyBuilds/%(name)s
get lunch
cd %(name)s
hg update -r %(name)s_{version.replace('.', '-')}
cd ..
tar czf %(name)s-%(version)s.tar.gz IMOD
"""
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.58.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',
]

# can't include a valid checksum, since tarball has to be created manually
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
maxparallel = 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 = ' && '.join([
'export QTDIR=$EBROOTQT5',
'export CUDACC="%(cuda_cc_cmake)s"',
'export HDF5_DIR="$EBROOTHDF5"',
'export QMAKESPEC="$EBROOTQT5/mkspecs/`qmake -query QMAKE_SPEC`"',
'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.
'export CFLAGS="$CFLAGS -fallow-argument-mismatch"', # required for gfortran10 and newer
])

# 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'
configopts = '-c gnu -flags "$CFLAGS"'
prefix_opt = '-i '

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',
'IMOD_JAVADIR': '$JAVA_HOME',
'FOR_DISABLE_STACK_TRACE': '1',
}
sanity_check_paths = {
'files': ['VERSION', 'bin/subm'],
'dirs': ['lib', 'com', 'autodoc', 'pylib', 'Plugins', 'man', 'SystemTemplate'],
}

sanity_check_commands = [('xftoxg', '-h')]

modloadmsg = 'Please set the environment variable $IMOD_CALIB_DIR if appropriate.'

moduleclass = 'vis'
22 changes: 22 additions & 0 deletions easybuild/easyconfigs/i/IMOD/IMOD-4.12.58_cudacc.patch
Original file line number Diff line number Diff line change
@@ -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"
Loading