-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSingularity.v1.0.0
58 lines (42 loc) · 2.08 KB
/
Singularity.v1.0.0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Bootstrap: docker
From: ubuntu:16.04
%setup
mkdir -p ${SINGULARITY_ROOTFS}/opt/naleg_roi
%files
bin /opt/naleg_roi
src /opt/naleg_roi
README.md /opt/naleg_roi
compile_matlab.sh /opt/naleg_roi
spm_make_standalone_local.m /opt/naleg_roi
test_sing_container.sh /opt/naleg_roi
%labels
Maintainer [email protected]
%post
apt-get update
apt-get install -y wget unzip zip xvfb ghostscript openjdk-8-jre imagemagick
# Fix imagemagick policy to allow PDF output. See https://usn.ubuntu.com/3785-1/
sed -i 's/rights="none" pattern="PDF"/rights="read | write" pattern="PDF"/' \
/etc/ImageMagick-6/policy.xml
# Download the Matlab Compiled Runtime installer, install, clean up
mkdir /MCR
wget -nv -P /MCR http://ssd.mathworks.com/supportfiles/downloads/R2017a/deployment_files/R2017a/installers/glnxa64/MCR_R2017a_glnxa64_installer.zip
unzip /MCR/MCR_R2017a_glnxa64_installer.zip -d /MCR/MCR_R2017a_glnxa64_installer
/MCR/MCR_R2017a_glnxa64_installer/install -mode silent -agreeToLicense yes
rm -r /MCR/MCR_R2017a_glnxa64_installer /MCR/MCR_R2017a_glnxa64_installer.zip
rmdir /MCR
# Create input/output directories for binding
mkdir /INPUTS && mkdir /OUTPUTS
# Singularity-hub doesn't work with github LFS (it gets the pointer info instead
# of the actual file) so we get the compiled matlab executable via direct download.
# Also need a "dry run" of SPM executable to avoid directory creation errors later.
rm /opt/naleg_roi/bin/spm12.ctf
wget -nv -P /opt/naleg_roi/bin https://github.com/baxpr/naleg-roi/raw/master/bin/spm12.ctf
/opt/naleg_roi/bin/run_spm12.sh /usr/local/MATLAB/MATLAB_Runtime/v92 quit
%environment
# We don't need to set the Matlab library path here, because Matlab's
# auto-generated run_??.sh script does it for us.
%runscript
xvfb-run --server-num=$(($$ + 99)) \
--server-args='-screen 0 1600x1200x24 -ac +extension GLX' \
bash /opt/naleg_roi/bin/run_spm12.sh \
/usr/local/MATLAB/MATLAB_Runtime/v92 function process_rois "$@"