解决构建R源的ld链接器问题 [英] Solve ld linker issues for building R source

查看:98
本文介绍了解决构建R源的ld链接器问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在尝试从源代码安装R时,我遇到了链接器问题,尤其是:undefined reference to 'u_getVersion_58

While trying to install R from source, I ran into linker issues, in particular: undefined reference to 'u_getVersion_58

我发现了有关此错误的有限信息(例如,

I found limited information on this error (eg, this post on the RStudio forum). Despite running apt-get build-dep, these issues persisted.

It is apparent from these comments by Dirk Eddenbuettel that it relates to libicu versions. I have libicu version 60, while R 3.6.0 and similar recent versions seem to require version 58.

推荐答案

我们可以从源代码中安装libicu的早期版本,如下所示:

We can install a previous version of libicu from source as follows:

wget http://download.icu-project.org/files/icu4c/58.2/icu4c-58_2-src.tgz
tar -xf icu4c-58_2-src.tgz
cd icu
make
make install

但是,由于缺少xlocale.hmake可能会遇到编译错误.如在此github帖子上所示,可以通过运行ln -s /usr/include/locale.h /usr/include/xlocale.h来解决此问题xlocale.h只是已删除的locale.h的子集.来自glibc最近.此后,makemake install对于icu 58版本应该会成功,随后的R应该会成功.

However, make is likely to run into a compilation error due to missing xlocale.h. As indicated on this github post, this can be solved by running ln -s /usr/include/locale.h /usr/include/xlocale.h, as xlocale.h is just a subset of locale.h which was removed from glibc recently. After this, make and make install should succeed for icu version 58, and following that, for R.

这篇关于解决构建R源的ld链接器问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆