我无法在Linux桌面上安装glmnet。以下是我跑步时遇到的错误
typedef struct s_obj t_obj;
struct s_obj {
char *str;
};
int main() {
char *str; // if disable no segmentation fault fault
t_obj obj;
obj.str = strcpy(obj.str, "truc");
// printf("%lu\n",strlen(obj.str));
printf("%s\n",obj.str);
return(0);
}
我首先尝试了R CMD INSTALL -d glmnet_4.0-2.tar.gz
,但结果相同。与install.packages("glmnet")
一起运行R CMD INSTALL
,希望获得一些其他调试信息。
-d
由于某种原因,processing ‘glmnet_4.0-2.tar.gz’
a file
* installing to library ‘/home/sconoor/R/x86_64-redhat-linux-gnu-library/3.6’
* build_help_types=html
* DBG: 'R CMD INSTALL' now doing do_install()
* created lock directory ‘/home/sconoor/R/x86_64-redhat-linux-gnu-library/3.6/00LOCK-glmnet’
* installing *source* package ‘glmnet’ ...
** package ‘glmnet’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
about to run R CMD SHLIB -o glmnet.so glmnet5dpclean.f glmnet_init.c pb.c wls.f
77 -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -I/usr/lib64/gfortran/modules -c glmnet5dpclean.f -o glmnet5dpclean.o
make: 77: Command not found
make: *** [glmnet5dpclean.o] Error 127
ERROR: compilation failed for package ‘glmnet’
* removing ‘/home/sconoor/R/x86_64-redhat-linux-gnu-library/3.6/glmnet’
将R CMD INSTALL
替换为我在编译步骤中期望的77
。我搜索了其他可能遇到此问题且未发现任何问题的人。我不知道如何解决这个问题。任何建议将不胜感激。
这是R版本信息
gfortran
系统信息:
> sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so
locale:
[1] LC_CTYPE=en_US.utf8 LC_NUMERIC=C
[3] LC_TIME=en_US.utf8 LC_COLLATE=en_US.utf8
[5] LC_MONETARY=en_US.utf8 LC_MESSAGES=en_US.utf8
[7] LC_PAPER=en_US.utf8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.utf8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.6.0
和gcc版本
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.8.2003 (Core)
Release: 7.8.2003
Codename: Core
答案 0 :(得分:0)
由@BenBolker识别,问题是〜/ .R / Makevars文件中的错误。我记得在编译支持C ++ 14的StanHeaders时从SO答案中复制的代码片段创建了Makevars文件。我错过了fortran编译器路径的make变量定义中的错误。