-
Notifications
You must be signed in to change notification settings - Fork 27
/
R-3.5.1_MPI_install
executable file
·102 lines (91 loc) · 2.94 KB
/
R-3.5.1_MPI_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
#!/usr/bin/env bash
###############################################
# Installing R and Bioconductor MPI support
# packages.
#
# This replaces the old ~ccaabaa/Software/R/extra-pkgs-order.txt file from
# previous version of R on Legion etc. It will need to be updated each time
# an extra package is added to the current R installation.
#
# For R 3.5.0 and later Note: R-<version>_packages_install should be run first.
#
# This is needed on Grace for the Rmpi package to install correctly:
#
# export OMPI_MCA_mtl=^psm
#
# by Brian Alston, June 2016
# Updated Nov 2016 for R 3.3.2
# Updated May 2017 for R 3.4.0
# Updated December 2017 for R 3.4.2
# Updated June 2018 for R 3.5.0
# Updated June 2018 (19th) to fix MPI support - now using mpi/openmpi/3.0.0/gnu-4.9.2
# Updated September 2018 for R 3.5.1
# Also for udunits 2.2.26.
#
# Using Ian's require function to load modules
#
# Will need modules: see list of modules below.
VERSION=${VERSION:-3.5.1}
INSTALL_PREFIX=${INSTALL_PREFIX:-/shared/ucl/apps/R/R-${VERSION}-OpenBLAS}
export RLIB_MAIN=${RLIB_MAIN:-${INSTALL_PREFIX}/lib64/R/library}
export RLIB_DB=${RLIB_DB:-/home/ccspapp/Scratch/R/R-${VERSION}-OpenBLAS/library}
export REPROS=${REPROS:-https://cloud.r-project.org/}
LOCALDIR=${LOCALDIR:-/shared/ucl/apps/build_scripts/files/R_UCL}
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 gcc-libs/4.9.2
require compilers/gnu/4.9.2
require openblas/0.2.14/gnu-4.9.2
require java/1.8.0_92
require fftw/3.3.6-pl2/gnu-4.9.2
require ghostscript/9.19/gnu-4.9.2
require texinfo/5.2/gnu-4.9.2
require texlive/2015
require gsl/1.16/gnu-4.9.2
require hdf/5-1.8.15/gnu-4.9.2
require udunits/2.2.26/gnu-4.9.2
require netcdf/4.3.3.1/gnu-4.9.2
require jags/4.2.0/gnu.4.9.2-openblas
require root/5.34.36/gnu-4.9.2-fftw-3.3.6
require glpk/4.60/gnu-4.9.2
require mpi/openmpi/3.0.0/gnu-4.9.2
require perl/5.22.0
require libtool/2.4.6
require graphicsmagick/1.3.21
require python2/recommended
require gdal/2.0.0
require gmt/5.3.1
require proj.4/4.9.1
require geos/3.5.0/gnu-4.9.2
require r/3.5.1-openblas/gnu-4.9.2
require v8/3.15
require protobuf/12-2017/gnu-4.9.2
require jq/1.5/gnu-4.9.2
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
mkdir -p $RLIB_DB
export OMPI_MCA_btl=vader,self
# Note: some old packages need to be installed from local files that have had minor updates applied eg:
#
# adapt fails to install on R > 3.0.1 with: ERROR: a 'NAMESPACE' file is required
#
# tar xvzf adapt_1.0-4.tar.gz
# cd adapt
# Create NAMESPACE with contents:
#
# exportPattern("^[^\\.]")
#
# cd ..
# tar cvzf adapt_1.0-4-ucl.tar.gz adapt
#
# Do this for all packages that fail with abover error.
R_input=${LOCALDIR}/R_packages_MPI_1.R
R --no-save < $R_input