首页 > 解决方案 > r ridge 包未定义符号:regression_wrapper_function

问题描述

如何ridge在 R 中安装软件包而不会出现以下未定义符号错误?

** R
** data
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error: package or namespace load failed for ‘ridge’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/qwr/R/x86_64-pc-linux-gnu-library/3.4/ridge/libs/ridge.so':
  /home/qwr/R/x86_64-pc-linux-gnu-library/3.4/ridge/libs/ridge.so: undefined symbol: regression_wrapper_function
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/qwr/R/x86_64-pc-linux-gnu-library/3.4/ridge’

The downloaded source packages are in
    ‘/tmp/Rtmp5AEXdl/downloaded_packages’
Warning message:
In install.packages("ridge") :
  installation of package ‘ridge’ had non-zero exit status

标签: rinstallation

解决方案


查看安装消息,我看到必须安装 GSL(GNU 科学库):

* installing *source* package ‘ridge’ ...
** package ‘ridge’ successfully unpacked and MD5 sums checked
checking for gsl-config... no
configure: WARNING: gsl-config not found, is GSL installed?
configure: WARNING: ridge will be installed but some functions will be unavailable
configure: creating ./config.status

安装(在 Ubuntu 18.04 上)sudo apt install libgsl-dev


推荐阅读