【问题标题】:Installation of R fails because of "undefined reference to `libiconv'"由于“未定义对‘libiconv’的引用”,R 的安装失败
【发布时间】:2019-05-05 17:11:56
【问题描述】:

我在安装 R 3.5.1 时遇到问题。虽然我在“cshrc”中定义了库“libiconv”的路径,但安装失败并显示以下消息:

-L"../../lib" -lRblas -L/usr/lib/gcc/x86_64-redhat-linux/4.4.4 -lgfortran -lm   -lreadline  -lpcre -llzma -lbz2 -lz -lrt -ldl -lm
platform.o: In function `do_eSoftVersion':
/opt/local/rstudio/R-3.5.1/src/main/platform.c:3088: undefined reference to `_libiconv_version'
sysutils.o: In function `Riconv':
/opt/local/rstudio/R-3.5.1/src/main/sysutils.c:799: undefined reference to `libiconv'
/opt/local/rstudio/R-3.5.1/src/main/sysutils.c:799: undefined reference to `libiconv'
/opt/local/rstudio/R-3.5.1/src/main/sysutils.c:799: undefined reference to `libiconv'
/opt/local/rstudio/R-3.5.1/src/main/sysutils.c:799: undefined reference to `libiconv'
sysutils.o: In function `Riconv_close':
 ...

顺便说一句,我没有root权限。

经过2天的搜索,我找不到原因。

任何帮助将不胜感激。

【问题讨论】:

    标签: r centos iconv libiconv


    【解决方案1】:

    您似乎正在使用 glibc 系统(见证:一个针对 x86_64-redhat-linux 的编译器,以及您设置的标签 centos)。

    在 glibc 系统上,您不需要 GNU libiconv,因为 glibc 已经包含一个功能齐全的 iconv 工具。所以只需卸载 libiconv,然后从头开始重建 R (make distclean;configure;make)。

    【讨论】:

    • 感谢您的建议。我可以通过使用 conda 重新安装 R 来解决我的问题。我将其添加为帮助其他面临相同问题的人的答案。
    【解决方案2】:

    我可以通过使用 conda 重新安装 R 来解决这个问题。不仅是 R,其他需要的库和 rstudio 都可以通过 conda 轻松安装。例如 R、rstudio 和 plotly(一个库)通过以下命令安装:

    conda install -c r r-essentials —-prefix=/where/to/install
    conda install -c r rstudio  —-prefix=/where/to/install
    conda install -c conda-forge r-plotly —-prefix=/where/to/install
    

    享受吧。

    【讨论】:

      【解决方案3】:

      我通过编辑 $PATH 搞清楚了,make 被 conda 误导了。

      echo $PATH
      :/gatk:/opt/miniconda/envs/gatk/bin:/opt/miniconda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
      
      PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/gatk:/opt/miniconda/envs/gatk/bin:/opt/miniconda/bin:
      export PATH
      

      【讨论】:

        【解决方案4】:

        我有同样的错误。从您的综合答案中,我认为是康达。修复:

        • conda deactivate
        • make distcleanconfiguremake

        【讨论】:

          猜你喜欢
          • 2011-08-13
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2017-08-11
          • 2015-01-04
          • 2017-02-05
          • 2020-08-06
          • 1970-01-01
          相关资源
          最近更新 更多