为了做R语言云计算服务,需要给服务器安装所有的R包,这样一来用户就不用担心安装和编译各种包的时候出现问题了。
打个小广告:一个月仅15元的R语言云计算服务
首先更新系统:
yum update -y
添加jag repo
vi /etc/yum.repos.d/jags.repo
#写入
[home_cornell_vrdc]
name=Sundry packages for scientific computing (CentOS_7)
type=rpm-md
baseurl=/repositories/home:/cornell_vrdc/CentOS_7/
gpgcheck=1
gpgkey=/repositories/home:/cornell_vrdc/CentOS_7//repodata/repomd.xml.key
enabled=1
给系统安装所有需要的Lib:
yum groups mark convert
yum install epel-release -y
yum groupinstall “Development tools” -y
yum install wget openblas java-1.8.0-openjdk-devel zlib-devel libicu-devel libpng-devel libcurl-devel libxml2-devel openssl-devel openmpi-devel numpy python-matplotlib netcdf4-python netcdf-devel netcdf python-pandas python-basemap proj-epsg proj-devel gdal-devel monitorix gnuplot ImageMagick librsvg2-devel libsodium-devel libwebp-devel cairo-devel hunspell-devel openssl-devel poppler-cpp-devel protobuf-devel mariadb-devel mysql-devel v8-devel redland-devel cyrus-sasl-devel libtiff-devel tcl-devel tk-devel xauth mesa-libGLU-devel glpk-devel libXt-devel gsl-devel fftw-devel bzip2-devel geos-devel gtk2-devel gtk3-devel libjpeg-turbo-devel jags4-devel bwidget blas-devel lapack-devel mpfr-devel unixODBC-devel libsndfile-devel udunits2-devel postgresql-devel libRmath-devel qt-devel libdb-devel octave-devel hiredis-devel poppler-glib-devel QuantLib-devel boost-devel czmq-devel ImageMagick-c++-devel file-devel opencl-headers gdal gdal-devel proj proj-devel proj-nad proj-epsg openssl-devel libcurl-devel postgresql-devel udunits2-devel libxml2-devel geos-devel libjpeg-turbo-devel libpng-devel udunits2-devel screen glpk-devel cairo-devel mesa-libGL-devel mesa-libGLU-devel freeglut-devel -y
#安装gdal2.0
wget /etc-/gdal-travisci/install-libkml-r864-64bit.tar.gz
tar xzf install-libkml-r864-64bit.tar.gz
sudo cp -r install-libkml/include/* /usr/local/include
sudo cp -r install-libkml/lib/* /usr/local/lib
sudo ldconfig
wget /gdal/2.2.3/gdal-2.2.3.tar.gz
tar xzf gdal-2.2.3.tar.gz
cd gdal-2.2.3
./configure –with-libkml
make
make install
cd ..
cp /usr/local/lib/* /usr/lib64/
#安装gsl
wget ftp:///gnu/gsl/gsl-latest.tar.gz
tar xzf gsl-latest.tar.gz
cd gsl*
./configure –prefix=/usr
make
make install
cd ..
#安装R
yum install R -y
#替换openBLAS
mv /usr/lib64/R/lib/libRblas.so /usr/lib64/R/lib/libRblas.so_
ln -s /usr/lib64/libopenblas.so.0 /usr/lib64/R/lib/libRblas.so
#设置java环境
env PATH=/usr/local/bin:$PATH R CMD javareconf
#设置openMPI
sudo echo “/usr/lib64/openmpi/lib” > /etc/ld.so.conf.d/openmpi.conf
sudo ldconfig
#安装ggobi
wget /downloads/ggobi-2.1.11.tar.bz2
bunzip2 ggobi-2.1.11.tar.bz2
tar -xf ggobi-2.1.11.tar
cd ggobi-2.1.11
./configure –with-all-plugins
make
sudo make install
make ggobirc
sudo mkdir -p /etc/xdg/ggobi
sudo cp ggobirc /etc/xdg/ggobi/ggobirc
sudo ln -s /usr/local/lib/libggobi.so.0 /usr/lib64/libggobi.so.0
cd ..
#安装OpenCL
wget http://registrationcenter-/akdlm/irc_nas/9019/opencl_runtime_16.1.1_x64_rh_6.4.0.25.tgz
tar -xzf opencl_runtime_16.1.1_x64_rh_6.4.0.25.tgz
sudo yum install opencl_runtime_16.1.1_x64_rh_6.4.0.25/rpm/*
#安装SYMPHONY
wget http://www.coin-/download/source/SYMPHONY/SYMPHONY-5.6.14.tgz
tar -xzf SYMPHONY-5.6.14.tgz
cd SYMPHONY-5.6.14
./configure
make
sudo make install
sudo cp -R include/* /usr/include/
sudo cp -R bin/* /usr/bin/
sudo cp -R lib/* /usr/lib64/
sudo cp -R share/* /usr/share/
cd ..
#如果需要显卡支持的话要安装CUDA
#/cuda-downloads
#vi /etc/profile.d/custom.sh
#写入
#export CPATH=\$CPATH:/usr/include/openmpi-x86_64
#PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
#export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
#export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:${LD_LIBRARY_PATH}
开始安装Packages
install.packages(‘devtools’)
library(devtools)
devtools::install_github(‘imanuelcostigan/RSQLServer’)
source(“/biocLite.R”
biocLite(c(“DNAcopy”, “SAGx”, “aroma.light”, “aroma.core”, “genefilter”, “limma”, “DESeq”, “graph”, “Rgraphviz”, “genefilter”, “edgeR”, “RDAVIDWebService”, “sva”, “fabia”, “beadarray”, “geneplotter”, “biomaRt”, “Biostrings”, “GOSemSim”, “qvalue”, “DESeq2”, “marray”, “GEOquery”, “GenomicRanges”, “GenomeInfoDb”, “pcaMethods”, “chopsticks”, “RBGL”, “BSgenome”, “BSgenome.Hsapiens.UCSC.hg19”, “affxparser”, “affy”, “oligo”, “supraHex”, “siggenes”, “gcrma”, “Rsamtools”, “GenomicAlignments”, “impute”, “flowWorkspace”, “flowCore”, “breastCancerVDX”, “snpStats”, “EBImage”, “rtracklayer”, “GenomicFeatures”, “genoset”, “nem”, “a4Core”, “Icens”, “lfa”, “org.Hs.eg.db”, “GOstats”, “pdInfoBuilder”, “convert”, “GEOmetadb”, “annotate”, “simpleaffy”, “lumi”, “globaltest”, “ssize”, “GeneMeta”, “MergeMaid”, “metaArray”, “seqLogo”, “GlobalAncova”, “GSVA”, “mzR”, “xcms”, “vsn”, “minet”, “ShortRead”, “safe”, “piano”, “LBE”, “survcomp”, “fmcsR”, “ChemmineR”, “KEGGREST”, “widgetTools”, “copynumber”, “phyloseq”, “MassSpecWavelet”, “MAIT”, “CNTools”, “qpgraph”, “topGO”, “kelvin”, “miscF”, “randtoolbox”, “mcGlobaloptim”, “ycinterextra”, “DiceOptim”, “GPareto”, “KrigInv”, “bamsignals”, “Rdisop”, “KEGGgraph”, “VariantAnnotation”, “iBBiG”, “rqubic”, “BicARE”, “CMA”, “affyPLM”))
install.packages(‘tcltk2’)
install.packages(‘udunits2′,configure.args=’–with-udunits2-include=/usr/include/udunits2′)
install.packages(‘Rmpi’,configure.args = ‘–with-Rmpi-include=/usr/include/openmpi-x86_64 –with-Rmpi-libpath=/usr/lib64/openmpi/lib –with-Rmpi-type=OPENMPI’)
availablePackages
This article is under CC BY-NC-SA 4.0 license.
Please quote the original link:/article/262.html
如果觉得《centos7 r语言安装_CentOS7下安装所有的R包|Install all R packages in CentOS7》对你有帮助,请点赞、收藏,并留下你的观点哦!