• Centos6 安装R3.3.3


    1.安装R服务,将编译成功的R文件夹复制到/usr/local/,所依赖的包解压到/home路径,直接配置环境变量即可。
    export R_HOME=/usr/local/R-3.3.3
    export PATH=$PATH:$R_HOME/bin
    export PATH=/home/packages/bin:$PATH
    export LD_LIBRARY_PATH=/home/packages/lib:/usr/local/lib:$LD_LIBRARY_PATH
    export CFLAGS="-I/home/packages/include"
    export LDFLAGS="-L/home/packages/lib"

    2. 安装依赖包(编译环境centos6.5:
    yum -y install gcc gcc-c++ )
    yum install libgfortran -y
    yum install libgomp freetype -y
    yum install fontconfig -y
    yum install libpng libXrender cairo libjpeg libSM libXt -y
    yum install cairo-devel.x86_64 -y
    yum install pango-devel.x86_64 -y
    yum install libX11 libX11-devel libXt-devel -y
    yum groupinstall X11 -y

    增加交互图,需要安装包:pandoc和pandoc-citeproc
    1)Centos6及以上:直接将rstudio-server安装目录../bin/pandoc
    下的pandoc和pandoc-citeproc拷贝到/usr/local/bin下。
    2)修改权限,chmod -R 777 /usr/local/bin/pandoc /usr/local/bin/pandoc-citeproc
    3)重启R服务。(如果以上不行,可试着使用yum search pandoc安装pandoc和pandoc-citeproc)
    或参考:https://github.com/rstudio/rmarkdown/blob/master/PANDOC.md,该网址说明
    https://www.rstudio.com/products/rstudio/download-server-2/
    3.启动R服务
    命令:
    R CMD Rserve --RS-enable-remote
    netstat -ntpl | grep 6311 #查看6311端口

    5.检查是否安装Cairo及是否支持JPEG画图

    1)library(Cairo) # 加载Cairo包
    2)(能加载的话,此步骤先略去,不能加载继续此步骤)就联网安装 Cairo,进入R命令行。 installpackages("Cairo")
    3)Cairo.capabilities() # 检查Cairo包支持的图片格式

    4)jpeg对应的为false时,说明刚安装的Cairo包不支持JPEG画图,将原Cairo文件夹删除,
    将U盘里的Cairo 复制到/usr/local/R-3.2.0/library
    再Cairo.capabilities() ,JPEG为TRUE,可用。


    注意事项!!!需要在 安装R服务的服务器上安装postgresql,否则运行组件的时候会出错,提示找不到依赖的文件


    ******R包安装记录

    1 安装RPostgreSQL报错提示:fatal error: libpq-fe.h: No such file or directory
    解决方法:
    Depending on your environment:
    Mac: brew install postgresql
    Ubuntu: sudo apt-get install libpq-dev
    RHEL: yum install postgresql-devel

    2 安装RCurl包提示:cannot find curl-config
    解决方法:
    安装curl
    [root@qilincaizhe-vmlnx ~]#wget http://curl.haxx.se/download/curl-7.24.0.tar.gz
    [root@qilincaizhe-vmlnx ~]#tar -zxvf curl-7.24.0.tar.gz
    [root@qilincaizhe-vmlnx ~]#cd curl-7.24
    [root@qilincaizhe-vmlnx curl-7.24.0]#./configure
    [root@qilincaizhe-vmlnx curl-7.24.0]#make
    [root@qilincaizhe-vmlnx curl-7.24.0]#make install
    再重新安装RCurl包

    3 安装lmtest包:/usr/bin/ld: cannot find -lgfortran
    collect2: error: ld returned 1 exit status
    make: *** [lmtest.so] Error 1

    ld -lgfortran --verbose
    得到如下结果
    ==================================================
    attempt to open /usr/x86_64-redhat-linux/lib64/libgfortran.so failed
    attempt to open /usr/x86_64-redhat-linux/lib64/libgfortran.a failed
    attempt to open /usr/local/lib64/libgfortran.so failed
    attempt to open /usr/local/lib64/libgfortran.a failed
    attempt to open /lib64/libgfortran.so failed
    attempt to open /lib64/libgfortran.a failed
    attempt to open /usr/lib64/libgfortran.so failed
    attempt to open /usr/lib64/libgfortran.a failed
    attempt to open /usr/x86_64-redhat-linux/lib/libgfortran.so failed
    attempt to open /usr/x86_64-redhat-linux/lib/libgfortran.a failed
    attempt to open /usr/lib64/libgfortran.so failed
    attempt to open /usr/lib64/libgfortran.a failed
    attempt to open /usr/local/lib/libgfortran.so failed
    attempt to open /usr/local/lib/libgfortran.a failed
    attempt to open /lib/libgfortran.so failed
    attempt to open /lib/libgfortran.a failed
    attempt to open /usr/lib/libgfortran.so failed
    attempt to open /usr/lib/libgfortran.a failed
    /usr/bin/ld.bfd.real: cannot find -libgfortran

    输入如下命令:
    find /usr/lib/gcc/x86_64-redhat-linux/ -name libgfortran.a

    得到路径
    /usr/lib/gcc/x86_64-redhat-linux/4.4.4/32/libgfortran.a
    /usr/lib/gcc/x86_64-redhat-linux/4.4.4/libgfortran.a

    创建软链接
    ln -s /usr/lib/gcc/x86_64-redhat-linux/4.4.4/libgfortran.a /usr/lib/libgfortran.a

    再安装包


    4 安装pROC包
    出现错误:
    Error in library.dynam(lib, package, package.lib) :
    shared object ‘stringi.so’ not found
    ERROR: lazy loading failed for package ‘stringr’
    * removing ‘/home/james/R/x86_64-pc-linux-gnu-library/3.1/stringr’
    Warning in install.packages :
    installation of package ‘stringr’ had non-zero exit status
    ERROR: dependency ‘stringr’ is not available for package ‘reshape2’
    * removing ‘/home/james/R/x86_64-pc-linux-gnu-library/3.1/reshape2’
    Warning in install.packages :
    installation of package ‘reshape2’ had non-zero exit status

    解决方法:
    > install.packages("stringi",dep=TRUE)

    会出现
    ERROR: failed to lock directory ‘/home/james/R/x86_64-pc-linux-gnu-library/3.1’ for modifying
    Try removing ‘/home/james/R/x86_64-pc-linux-gnu-library/3.1/00LOCK-stringi’
    Warning in install.packages :
    installation of package ‘stringi’ had non-zero exit status

    rm -rf /home/james/R/x86_64-pc-linux-gnu-library/3.1/00LOCK-stringi

    再输入
    install.packages("stringi",dep=TRUE)
    install.packages("pROC")


    5 安装tseries
    出现错误:
    relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC

    ... libfortran.a could not read symbols: Bad value

    ---------------------
    此问题是因libfortran.a路径错误导致
    进入gcc目录,找到对应的版本,重新建立libfortran.a的链接
    再重新安装

    6 安装plotly
    出现错误:configuration failed for package ‘openssl’
    未安装openssl-devel导致
    yum install openssl-devel

    再安装包

    7 安装RMySQL

    centos系统需先安装mysql-devel,输入yum install mysql-devel 安装
    deb: libmariadb-client-lgpl-dev (Debian, Ubuntu 16.04)
    libmariadbclient-dev (Ubuntu 14.04)
    * rpm: mariadb-devel | mysql-devel (Fedora, CentOS, RHEL)
    * csw: mysql56_dev (Solaris)
    * brew: mariadb-connector-c (OSX)


    8 > library(curl)
    Error in dyn.load(file, DLLpath = DLLpath, ...) :
    无法载入共享目标对象‘/usr/local/R-3.3.3/lib64/R/library/curl/libs/curl.so’::
    /usr/local/R-3.3.3/lib64/R/library/curl/libs/curl.so: undefined symbol: curl_multi_wait
    错误: ‘curl’程辑包或名字空间载入失败,

    系统环境变量导致的,下面这个路径要和安装路径一致
    export LD_LIBRARY_PATH=/home/packages/lib:$LD_LIBRARY_PATH

    9 安装topicmodels
    先要安装gsl
    tar -zxvf gsl.gz
    cd gsl
    ./configure
    make
    make install

    再修改环境变量
    LD_LIBRARY_PATH=/usr/local/lib
    $export LD_LIBRARY_PATH

    最后输入ldconfig命令 以更新缓存。


    10交互图,一定要安装pandoc

    11 分词运行出错:Error in get("Analyzer", envir = .RwordsegEnv) : 找不到对象'.RwordsegEnv'

    多个R的时候检查JDk的目录是否一致,如果不一致,修改成一致,再修改环境变量

    centos7 编译安装出现错误
    1 configure: error: "liblzma library and headers are required"

    解决方案:安装xz
    sudo wget http://tukaani.org/xz/xz-5.2.2.tar.gz
    sudo tar xzvf xz-5.2.2.tar.gz
    sudo cd xz-5.2.2
    sudo ./configure
    sudo make
    sudo make install

    2 configure: error: libcurl >= 7.28.0 library and headers are required with support for https
    yum install libcurl-devel

    move on
  • 相关阅读:
    类与类之间的关系图
    UML介绍
    数据建模
    状态图
    部署图
    用例图
    业务建模
    时序图
    postgresql 维护手册
    ashx文件的使用(转)
  • 原文地址:https://www.cnblogs.com/amy720/p/12185860.html
Copyright © 2020-2023  润新知