Skip to content

Commit

Permalink
update matlab to 2023 and add lmod support
Browse files Browse the repository at this point in the history
  • Loading branch information
stebo85 committed Sep 19, 2023
1 parent a531220 commit 269d0a4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
4 changes: 2 additions & 2 deletions recipes/matlab/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

----------------------------------
## matlab/2022a ##
## matlab/2023a ##
Matlab IDE

Important note about licensing
Expand Down Expand Up @@ -44,7 +44,7 @@ More documentation can be found here
To run applications outside of this container
---------------------------------------------

ml matlab/2022a
ml matlab/2023a

Citation
--------
Expand Down
25 changes: 22 additions & 3 deletions recipes/matlab/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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!)

Expand All @@ -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` \
Expand Down

0 comments on commit 269d0a4

Please sign in to comment.