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
| yum install centos-release-scl yum-config-manager --enable rhel-server-rhscl-7-rpms yum install -y devtoolset-4 --exclude=devtoolset-4-4.1-3.el7,devtoolset-4-ide-4.1-3.el7 yum update -y
tee -a /etc/bashrc << EOF source /opt/rh/devtoolset-4/enable EOF source /etc/bashrc
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm yum install -y epel-release-latest-7.noarch.rpm yum install -y R R-devel R-java libxml2-devel libxml2-static tcl tcl-devel tk tk-devel libtiff-static libtiff-devel libjpeg-turbo-devel libpng12-devel cairo-tools libicu-devel openssl-devel libcurl-devel freeglut readline-static readline-devel cyrus-sasl-devel
wget https://mran.microsoft.com/install/mro/3.3.2/microsoft-r-open-3.3.2.tar.gz tar zxvf microsoft-r-open-3.3.2.tar.gz yum install -y microsoft-r-open/rpm/microsoft-r-open-*
curl -v -j -k -L -H "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u112-b15/jdk-8u112-linux-x64.rpm -o jdk-8u112-linux-x64.rpm yum install -y jdk-8u112-linux-x64.rpm tee -a /etc/bashrc << "EOF" export JAVA_HOME=/usr/java/jdk1.8.0_112 export PATH=$PATH:$JAVA_HOME/bin EOF source /etc/bashrc
rm -rf /usr/lib64/R cp -r /usr/lib64/microsoft-r/3.3/lib64/R /usr/lib64
chmod -R 777 /usr/lib64/R/library
R CMD javareconf
Rscript -e "install.packages(c('rJava', 'Rcpp'))" Rscript -e "library(rJava); library(Rcpp)"
sed -i -e 's/CXX1X =/CXX1X = g++/g' /usr/lib64/R/etc/Makeconf sed -i -e 's/CXX1XFLAGS =/CXX1XFLAGS = -DU_STATIC_IMPLEMENTATIN -O2 -g/g' /usr/lib64/R/etc/Makeconf sed -i -e 's/CXX1XPICFLAGS =/CXX1XPICFLAGS = -fpic/g' /usr/lib64/R/etc/Makeconf sed -i -e 's/CXX1XSTD =/CXX1XSTD = -std=c++11/g' /usr/lib64/R/etc/Makeconf
Rscript -e "install.packages('RcppMLPACK')"
wget https://download2.rstudio.org/rstudio-server-rhel-1.0.136-x86_64.rpm yum install -y --nogpgcheck rstudio-server-rhel-1.0.136-x86_64.rpm
tee -a /etc/rstudio/rsession.conf << EOF r-libs-user=/usr/lib64/R/library EOF
tee -a /usr/lib/rstudio-server/R/ServerOptions.R << EOF Sys.setenv(PATH = "/opt/rh/devtoolset-4/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin", LD_LIBRARY_PATH = "/opt/rh/devtoolset-4/root/usr/lib64:/opt/rh/devtoolset-4/root/usr/lib:/usr/lib64/R/lib::/lib:/builddir/vendor/build/lib:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-3.b12.el7_3.x86_64/jre/lib/amd64/server") EOF
systemctl enable rstudio-server systemctl start rstudio-server
firewall-cmd --zone=public --add-port=8787/tcp --permanent firewall-cmd --reload
|