-
Notifications
You must be signed in to change notification settings - Fork 0
/
Singularity.r4
70 lines (58 loc) · 1.88 KB
/
Singularity.r4
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
66
67
68
69
70
BootStrap: docker
From: ubuntu:18.04
%labels
Maintainer Bastian Seelbinder
R_Version 4
%apprun R
exec R "${@}"
%apprun Rscript
exec Rscript "${@}"
%runscript
exec R "${@}"
%environment
export LC_ALL=C
%post
# set mount points
mkdir -p /scratch/global /scratch/local
# Install dependencies
apt-get update
apt-get -y install \
wget \
build-essential \
software-properties-common \
apt-transport-https \
locales \
libpcre2-dev \
pcre2-utils \
libxml2-dev \
libssl-dev \
libcurl4-openssl-dev \
libgtk3-nocsd0 \
gtk3-nocsd
# Update locales
DEBIAN_FRONTEND=noninteractive apt-get install tzdata
echo "LC_ALL=en_US.UTF-8" >> /etc/environment
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
locale-gen en_US.UTF-8
# Install R from CRAN repository
#echo 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/' >> /etc/apt/sources.list
#apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
#gpg --keyserver keyserver.ubuntu.com --recv-key E298A3A825C0D65DFD57CBB651716619E084DAB9
#gpg -a --export E298A3A825C0D65DFD57CBB651716619E084DAB9 | sudo apt-key add -
sed -i~orig -e 's/# deb-src/deb-src/' /etc/apt/sources.list
apt-get update
# Install R devel
apt-get build-dep -y r-base
wget https://stat.ethz.ch/R/daily/R-devel.tar.gz && tar -xzvf R-devel.tar.gz
rm R-devel.tar.gz
cd R-devel
./configure --enable-R-shlib
make
make check
make install
# cleanup
apt-get clean
rm -rf /var/lib/apt/lists/*
mkdir -p /usr/lib/R/etc/
echo "options(repos = c(CRAN = 'https://cloud.r-project.org/'), download.file.method = 'libcurl')" >> /usr/lib/R/etc/Rprofile.site