-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathSingularity.Easybuild-CentOS-7
66 lines (54 loc) · 1.85 KB
/
Singularity.Easybuild-CentOS-7
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
58
59
60
61
62
63
64
65
Bootstrap: yum
OSVersion: 7
MirrorURL: http://mirror.centos.org/centos-%{OSVERSION}/%{OSVERSION}/os/x86_64/
Include: yum
%post
yum install --quiet --assumeyes epel-release
yum install --quiet --assumeyes python setuptools Lmod
yum install --quiet --assumeyes python-pip
yum install --quiet --assumeyes bzip2 gzip tar zip unzip xz
yum install --quiet --assumeyes curl wget
yum install --quiet --assumeyes patch make
yum install --quiet --assumeyes file git which
yum install --quiet --assumeyes gcc-c++
yum install --quiet --assumeyes perl-Data-Dumper
yum install --quiet --assumeyes perl-Thread-Queue
yum --skip-broken --quiet --assumeyes install openssl-devel libssl-dev libopenssl-devel
# create 'easybuild' user (if missing)
id easybuild || useradd easybuild
cat >> /home/easybuild/.bashrc <<-EOM
export EASYBUILD_PREFIX=/scratch
export EASYBUILD_TMPDIR=/scratch/tmp
export EASYBUILD_SOURCEPATH=/scratch/sources:/tmp/easybuild/sources
export EASYBUILD_INSTALLPATH=/app
export EASYBUILD_RPATH=True
EOM
cat >> /home/easybuild/.bash_profile <<-EOM
export EASYBUILD_PREFIX=/scratch
export EASYBUILD_TMPDIR=/scratch/tmp
export EASYBUILD_SOURCEPATH=/scratch/sources:/tmp/easybuild/sources
export EASYBUILD_INSTALLPATH=/app
export EASYBUILD_RPATH=True
EOM
# create /app software installation prefix + /scratch sandbox directory
if [ ! -d /app ]; then mkdir -p /app; chown easybuild:easybuild -R /app; fi
if [ ! -d /scratch ]; then mkdir -p /scratch; chown easybuild:easybuild -R /scratch; fi
# install Lmod RC file
cat > /etc/lmodrc.lua << EOF
scDescriptT = {
{
["dir"] = "/app/lmodcache",
["timestamp"] = "/app/lmodcache/timestamp",
},
}
EOF
# retrieve build system details
mkdir /.buildsystem
cat /proc/cpuinfo > /.buildsystem/cpuinfo
lscpu > /.buildsystem/lscpu
dmesg > /.buildsystem/dmesg
uname -a > /.buildsystem/uname
%runscript
eval "$@"
%environment
%labels