From 98daea70bd4119efd274d305cb4e55ea6dda393d Mon Sep 17 00:00:00 2001 From: Spencer Bliven Date: Thu, 10 Nov 2022 16:09:27 +0100 Subject: [PATCH] Add new MotionCor2 variants Also standardize the MotionCor2 wrapper so that it's the same for all module versions regardless of cuda support --- EM/MotionCor2/README.md | 1 + EM/MotionCor2/bin/MotionCor2 | 21 +++++++++++++++++++++ EM/MotionCor2/build | 1 + EM/MotionCor2/files/variants | 3 +++ 4 files changed, 26 insertions(+) create mode 100755 EM/MotionCor2/bin/MotionCor2 diff --git a/EM/MotionCor2/README.md b/EM/MotionCor2/README.md index 6bd8089..d619c7c 100644 --- a/EM/MotionCor2/README.md +++ b/EM/MotionCor2/README.md @@ -6,6 +6,7 @@ 4. Move all executables to /opt/psi/EM/MotionCor2/$VERSION/bin 5. Move user manual to /opt/psi/EM/MotionCor2/$VERSION/ 6. Fix permissions: chmod 755 /opt/psi/EM/MotionCor2/$VERSION/bin +7. Create bin/MotionCor2 wrapper for each version ## Cuda versions diff --git a/EM/MotionCor2/bin/MotionCor2 b/EM/MotionCor2/bin/MotionCor2 new file mode 100755 index 0000000..c6619dc --- /dev/null +++ b/EM/MotionCor2/bin/MotionCor2 @@ -0,0 +1,21 @@ +#!/bin/bash + +# Script directory. Better than $MOTIONCOR2_HOME/bin since it can be called without loading modules. +BIN="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +if [ -z ${CUDA_VERSION} ]; then + echo 'MotionCor2 requires the cuda module. Run `module load cuda/`' >&2 + exit 1 +fi + +CUDA=$(echo "${CUDA_VERSION}" | sed -r 's/([0-9]+)\.([0-9]+)(\..*)/\1\2/') + +EXE=$(echo "$BIN"/MotionCor2_*_Cuda${CUDA}*) +#echo "Running $EXE" + +if [ ! -x "$EXE" ]; then + echo "MotionCor2/$MOTIONCOR2_VERSION is not compatible with cuda/$CUDA_VERSION" >&2 + exit 1 +fi + +exec "$EXE" "$@" diff --git a/EM/MotionCor2/build b/EM/MotionCor2/build index b9411f5..0dbbe97 100755 --- a/EM/MotionCor2/build +++ b/EM/MotionCor2/build @@ -18,5 +18,6 @@ pbuild::compile() { pbuild::install() { cp $BUILDBLOCK_DIR/files/LICENSE $PREFIX/ + cp -r $BUILDBLOCK_DIR/bin $PREFIX/ } diff --git a/EM/MotionCor2/files/variants b/EM/MotionCor2/files/variants index f871400..0676632 100644 --- a/EM/MotionCor2/files/variants +++ b/EM/MotionCor2/files/variants @@ -8,3 +8,6 @@ MotionCor2/1.3.0 stable MotionCor2/1.3.1 stable MotionCor2/1.3.2 stable MotionCor2/1.4.0 stable +MotionCor2/1.4.5 stable +MotionCor2/1.4.7 unstable +MotionCor2/1.5.0 unstable