From 269d0a46680ba6a5dabad0216235617fe1c5e3b8 Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Tue, 19 Sep 2023 05:42:16 +0000 Subject: [PATCH] update matlab to 2023 and add lmod support --- recipes/matlab/README.md | 4 ++-- recipes/matlab/build.sh | 25 ++++++++++++++++++++++--- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/recipes/matlab/README.md b/recipes/matlab/README.md index 71810c66..74733ae5 100644 --- a/recipes/matlab/README.md +++ b/recipes/matlab/README.md @@ -1,6 +1,6 @@ ---------------------------------- -## matlab/2022a ## +## matlab/2023a ## Matlab IDE Important note about licensing @@ -44,7 +44,7 @@ More documentation can be found here To run applications outside of this container --------------------------------------------- - ml matlab/2022a + ml matlab/2023a Citation -------- diff --git a/recipes/matlab/build.sh b/recipes/matlab/build.sh index 4f76da94..e1b9d9d4 100755 --- a/recipes/matlab/build.sh +++ b/recipes/matlab/build.sh @@ -3,7 +3,7 @@ set -e # this template file builds datalad and is then used as a docker base image for layer caching + it contains examples for various things like github install, curl, ... export toolName='matlab' -export toolVersion='2022a' #the version number cannot contain a "-" - try to use x.x.x notation always +export toolVersion='2023a' #the version number cannot contain a "-" - try to use x.x.x notation always # Don't forget to update version change in README.md!!!!! # toolName or toolVersion CANNOT contain capital letters or dashes or underscores (Docker registry does not accept this!) @@ -25,18 +25,37 @@ source ../main_setup.sh # NOTE 2: THE BACKSLASH (\) AT THE END OF EACH LINE MUST FOLLOW THE COMMENT. A BACKSLASH BEFORE THE COMMENT WON'T WORK! ########################################################################################################################################## neurodocker generate ${neurodocker_buildMode} \ - --base-image mathworks/matlab-deep-learning:r2022a `# use Matlab deep learning 2022a docker container provided by Mathworks` \ + --base-image mathworks/matlab-deep-learning:r${toolVersion} `# use Matlab deep learning 2022a docker container provided by Mathworks` \ --user root `# change user to root, as the Matlab container runs with Matlab user` \ --env DEBIAN_FRONTEND=noninteractive `# The matlab image uses Ubuntu, so it's Debian` \ --pkg-manager apt `# desired package manager, has to match the base image (e.g. debian needs apt; centos needs yum)` \ --run="printf '#!/bin/bash\nls -la' > /usr/bin/ll" `# define the ll command to show detailed list including hidden files` \ --run="chmod +x /usr/bin/ll" `# make ll command executable` \ --run="mkdir -p ${mountPointList}" `# create folders for singularity bind points` \ - --install wget git curl ca-certificates datalad unzip libfftw3-3 `# install apt-get packages` \ + --install wget git curl ca-certificates datalad unzip libfftw3-3 apt-transport-https coreutils\ + cryptsetup squashfs-tools lua-bit32 lua-filesystem lua-json lua-lpeg lua-posix lua-term lua5.2 lmod imagemagick less nano tree \ + gcc libzstd1 zlib1g-dev zip build-essential uuid-dev libgpgme-dev libseccomp-dev pkg-config \ --miniconda version=latest \ --env PATH='${PATH}'":/opt/matlab/R${toolVersion}/bin/" `# set PATH; not required to run matlab, but required for other Matlab tools like mex` \ --env DEPLOY_BINS=datalad:matlab:mex `# specify individual binaries (separated by :) on the PATH that should be exposed outside the container for the module system` \ --env MLM_LICENSE_FILE='~/Downloads' `# tell Matlab to look for the license file in Downloads under the home directory. There is the default download folder in Neurodesktop` \ + --env GOPATH='$HOME'/go \ + --env PATH='$PATH':/usr/local/go/bin:'$PATH':${GOPATH}/bin \ + --run="wget https://dl.google.com/go/go$GO_VERSION.$OS-$ARCH.tar.gz \ + && tar -C /usr/local -xzvf go$GO_VERSION.$OS-$ARCH.tar.gz \ + && rm go$GO_VERSION.$OS-$ARCH.tar.gz \ + && mkdir -p $GOPATH/src/github.com/sylabs \ + && cd $GOPATH/src/github.com/sylabs \ + && wget https://github.com/sylabs/singularity/releases/download/v${SINGULARITY_VERSION}/singularity-ce-${SINGULARITY_VERSION}.tar.gz \ + && tar -xzvf singularity-ce-${SINGULARITY_VERSION}.tar.gz \ + && cd singularity-ce-${SINGULARITY_VERSION} \ + && ./mconfig --without-suid --prefix=/usr/local/singularity \ + && make -C builddir \ + && make -C builddir install \ + && cd .. \ + && rm -rf singularity-ce-${SINGULARITY_VERSION} \ + && rm -rf /usr/local/go $GOPATH \ + && ln -s /usr/local/singularity/bin/singularity /bin/" \ --copy README.md /README.md `# include readme file in container` \ --run="rm /usr/local/bin/matlab" `# rm original matlab symbolic link` \ --copy matlab /usr/local/bin/matlab `# replace original matlab with a script that sets MLM_LICENSE_FILE and then call matlab; license dir is set to ~/Downloads because there is where Firefox download the license to` \