安装rbibutils时遇cmath未找到错误,求解决方案
问题
尝试安装依赖rbibutils的lawstat包时失败,单独安装rbibutils也出现编译错误,具体报错信息如下:
> install.packages('rbibutils') Installing package into ‘/home/caio/R/x86_64-pc-linux-gnu-library/4.5’ (as ‘lib’ is unspecified) trying URL 'https://cloud.r-project.org/src/contrib/rbibutils_2.3.tar.gz' Content type 'application/x-gzip' length 1132601 bytes (1.1 MB) ================================================== downloaded 1.1 MB * installing *source* package ‘rbibutils’ ... ** this is package ‘rbibutils’ version ‘2.3’ ** package ‘rbibutils’ successfully unpacked and MD5 sums checked ** using staged installation ** libs using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’ In file included from /home/caio/R/x86_64-pc-linux-gnu-library/4.5/RcppEigen/include/Eigen/Core:19, from /home/caio/R/x86_64-pc-linux-gnu-library/4.5/RcppEigen/include/Eigen/Dense:1, from /home/caio/R/x86_64-pc-linux-gnu-library/4.5/StanHeaders/include/stan/math/prim/fun/Eigen.hpp:22, from <command-line>: /home/caio/R/x86_64-pc-linux-gnu-library/4.5/RcppEigen/include/Eigen/src/Core/util/Macros.h:679:10: fatal error: cmath: No such file or directory 679 | #include <cmath> | ^~~~~~~ compilation terminated. make: *** [/usr/lib/R/etc/Makeconf:202: adsout.o] Error 1 ERROR: compilation failed for package ‘rbibutils’ * removing ‘/home/caio/R/x86_64-pc-linux-gnu-library/4.5/rbibutils’ Warning in install.packages : installation of package ‘rbibutils’ had non-zero exit status The downloaded source packages are in ‘/tmp/RtmpndWN0i/downloaded_packages’
系统信息:Linux Mint 22 Cinnamon,R版本4.5.0,已完成系统软件包更新。
解决步骤
- 安装C++编译依赖包:
sudo apt update && sudo apt install build-essential g++ - 重新安装
rbibutils:install.packages('rbibutils') - 成功安装
rbibutils后,再安装lawstat:install.packages('lawstat')
内容的提问来源于stack exchange,提问作者Théodore Targerian
相关产品推荐
相关产品推荐

