forked from UCL-ARC/rcps-buildscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathR-3.6.3_install
executable file
·102 lines (89 loc) · 2.83 KB
/
R-3.6.3_install
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/usr/bin/env bash
###############################################
# Installing base R plus recommended packages using GCC + OpenBLAS
#
# R 3.6.3
#
# by Brian Alston, April 2020
#
# May 2017 updated for R 3.4.0
# October 2017 updated for R 3.4.2
# May 2018 updated for R 3.5.0 and using fftw 3.3.6 and ROOT built
# using fftw 3.3.6
# Sept 2018 updated for R 3.5.1 and udunits 2.2.26
# April 2019 updated for R 3.5.3
# June 2019 updated for R 3.6.0
# April 2020 updated for R 3.6.3 - now needs GNU 9.2.0 for some
# additional packages (eg Rfast)
#
# Using Ian's require function to load modules
#
# Will need modules: see list of modules below.
# May need to update required modules for the latest R. Modules
# updated:
#
#
VERSION=${VERSION:-3.6.3}
INSTALL_PREFIX=${INSTALL_PREFIX:-/shared/ucl/apps/R/R-${VERSION}-OpenBLAS}
MD5=${MD5:-506c9576ba33e1262ad5b5624db9d96a}
SRC_ARCHIVE=${SRC_ARCHIVE:- http://www.stats.bris.ac.uk/R/src/base/R-3/R-${VERSION}.tar.gz}
# LOCAL_ARCHIVE=${LOCAL_ARCHIVE:- 1}
# SRC_ARCHIVE=${SRC_ARCHIVE:- /home/ccaabaa/Software/R//R-${VERSION}.tar.gz}
export PATH=$INSTALL_PREFIX/bin:$PATH
dirname=$(dirname $0 2>/dev/null || pwd)
INCLUDES_DIR=${INCLUDES_DIR:-${dirname}/includes}
source ${INCLUDES_DIR}/module_maker_inc.sh
source ${INCLUDES_DIR}/require_inc.sh
require beta-modules
require gcc-libs/9.2.0
require compilers/gnu/9.2.0
require openblas/0.3.7-serial/gnu-9.2.0
require java/1.8.0_92
require fftw/3.3.8/gnu-9.2.0
require ghostscript/9.19/gnu-4.9.2
require texinfo/6.6/gnu-4.9.2
require texlive/2019
require gsl/2.6/gnu-9.2.0
require hdf/5-1.10.5/gnu-9.2.0
require udunits/2.2.26/gnu-9.2.0
require netcdf/4.7.4/gnu-9.2.0
# Not doing Jags or ROOT initially.
# require jags/4.2.0/gnu.4.9.2-openblas
# require root/5.34.36/gnu-4.9.2-fftw-3.3.6-gsl-2.4
#
# And for doing the MPI support:
#
# require mpi/openmpi/3.1.5/gnu-9.2.0
# temp_dir=`mktemp -d -p /dev/shm`
temp_dir='/home/ccspapp/Software/R'
echo "Building in $temp_dir ..."
cd $temp_dir
module list
read -p "Press [Enter] key to start ..."
cd $temp_dir
if [[ $LOCAL_ARCHIVE ]]
then
cp $SRC_ARCHIVE .
else
wget $SRC_ARCHIVE
fi
CHECKSUM=`md5sum R-${VERSION}.tar.gz| awk '{print $1}'`
if [[ "$MD5" == "$CHECKSUM" ]]
then
tar xvzf R-${VERSION}.tar.gz
cd R-${VERSION}
./configure -C --prefix=${INSTALL_PREFIX} --with-recommended-packages --with-x \
--with-readline=yes --enable-R-shlib \
--with-blas="-L/shared/ucl/apps/openblas/0.3.7-serial/gnu-9.2.0/lib -lopenblas" \
--enable-BLAS-shlib 2>&1 |
tee configure-command-OpenBLAS_log
make 2>&1 | tee make-OpenBLAS_log
make check 2>&1 | tee make-check-OpenBLAS_log
make pdf 2>&1 | tee make-pdf_log
make install 2>&1 | tee make-install_log
make install-pdf 2>&1 | tee make-install-pdf_log
else
echo "***** Hash mismatch,"
echo " Expected: $MD5"
echo " Got: $CHECKSUM"
fi