我正在尝试在Arch Linux内核v.9.1.1上运行的R版本4.0.3上安装mclust软件包。但出现以下错误:
* installing *source* package ‘mclust’ ...
** package ‘mclust’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gfortran -fno-optimize-sibling-calls -fpic -g -O2 -c dmvnorm.f -o dmvnorm.o
gcc -I"/usr/include/R/" -DNDEBUG -D_FORTIFY_SOURCE=2 -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -c init.c -o init.o
gfortran -fno-optimize-sibling-calls -fpic -g -O2 -c mclust.f -o mclust.o
gfortran -fno-optimize-sibling-calls -fpic -g -O2 -c mclustaddson.f -o mclustaddson.o
gcc -L/usr/lib64/R/lib -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -o mclust.so dmvnorm.o init.o mclust.o mclustaddson.o -llapack -lblas -lgfortran -lm -lquadmath -lgfortran -lm -lquadmath -L/usr/lib64/R/lib -lR
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../lib/Scrt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status
make: *** [/usr/share/R//make/shlib.mk:10: mclust.so] Error 1
ERROR: compilation failed for package ‘mclust’
* removing ‘/home/dsm/R/x86_64-pc-linux-gnu-library/3.6/mclust’
Warning in install.packages :
installation of package ‘mclust’ had non-zero exit status
通常调试这些错误非常简单,但是我对此深感困惑。谷歌搜索“对主的未定义引用”错误并没有太大帮助。我正在猜测/希望,也许可以在我的~/.R/Makevars
文件中设置一些命令来解决编译问题,但这只是一个猜测。
对问题是什么或如何解决问题有何想法?