我正在尝试在 R 中安装 pgmm 库的特定版本,但它失败了:
> library(fs)
> old_lib <- path_home_r("R/x86_64-pc-linux-gnu-library/old-versions/")
> library(remotes)
> install_version("pgmm", version = "1.1", lib = old_lib, build = TRUE)
Downloading package from url: https://cloud.r-project.org/src/contrib/Archive/pgmm/pgmm_1.1.tar.gz
Running `R CMD build`...
* checking for file ‘/tmp/Rtmp6Jj3B0/remotes3b5e8d11b5fe/pgmm/DESCRIPTION’ ... OK
* preparing ‘pgmm’:
* checking DESCRIPTION meta-information ... OK
* cleaning src
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* looking to see if a ‘data/datalist’ file should be added
* building ‘pgmm_1.1.tar.gz’
* installing *source* package ‘pgmm’ ...
** using staged installation
** libs
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/build/r-base-PsrVor/r-base-4.0.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c aecm.c -o aecm.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/build/r-base-PsrVor/r-base-4.0.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gaussj.c -o gaussj.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/build/r-base-PsrVor/r-base-4.0.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c myalloc.c -o myalloc.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/build/r-base-PsrVor/r-base-4.0.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c pgmm.c -o pgmm.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/build/r-base-PsrVor/r-base-4.0.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c updates.c -o updates.o
gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o pgmm.so aecm.o gaussj.o myalloc.o pgmm.o updates.o -L/usr/lib/R/lib -lR
/usr/bin/ld: gaussj.o:/tmp/RtmpGlEBF9/R.INSTALL3b70d1f18017d/pgmm/src/functions.h:4: multiple definition of `testfunc2'; aecm.o:/tmp/RtmpGlEBF9/R.INSTALL3b70d1f18017d/pgmm/src/functions.h:4: first defined here
/usr/bin/ld: gaussj.o:/tmp/RtmpGlEBF9/R.INSTALL3b70d1f18017d/pgmm/src/functions.h:1: multiple definition of `testfunc'; aecm.o:/tmp/RtmpGlEBF9/R.INSTALL3b70d1f18017d/pgmm/src/functions.h:1: first defined here
/usr/bin/ld: myalloc.o:/tmp/RtmpGlEBF9/R.INSTALL3b70d1f18017d/pgmm/src/functions.h:4: multiple definition of `testfunc2'; aecm.o:/tmp/RtmpGlEBF9/R.INSTALL3b70d1f18017d/pgmm/src/functions.h:4: first defined here
/usr/bin/ld: myalloc.o:/tmp/RtmpGlEBF9/R.INSTALL3b70d1f18017d/pgmm/src/functions.h:1: multiple definition of `testfunc'; aecm.o:/tmp/RtmpGlEBF9/R.INSTALL3b70d1f18017d/pgmm/src/functions.h:1: first defined here
/usr/bin/ld: pgmm.o:/tmp/RtmpGlEBF9/R.INSTALL3b70d1f18017d/pgmm/src/functions.h:4: multiple definition of `testfunc2'; aecm.o:/tmp/RtmpGlEBF9/R.INSTALL3b70d1f18017d/pgmm/src/functions.h:4: first defined here
/usr/bin/ld: pgmm.o:/tmp/RtmpGlEBF9/R.INSTALL3b70d1f18017d/pgmm/src/functions.h:1: multiple definition of `testfunc'; aecm.o:/tmp/RtmpGlEBF9/R.INSTALL3b70d1f18017d/pgmm/src/functions.h:1: first defined here
/usr/bin/ld: updates.o:/tmp/RtmpGlEBF9/R.INSTALL3b70d1f18017d/pgmm/src/functions.h:4: multiple definition of `testfunc2'; aecm.o:/tmp/RtmpGlEBF9/R.INSTALL3b70d1f18017d/pgmm/src/functions.h:4: first defined here
/usr/bin/ld: updates.o:/tmp/RtmpGlEBF9/R.INSTALL3b70d1f18017d/pgmm/src/functions.h:1: multiple definition of `testfunc'; aecm.o:/tmp/RtmpGlEBF9/R.INSTALL3b70d1f18017d/pgmm/src/functions.h:1: first defined here
collect2: error: ld returned 1 exit status
make: *** [/usr/share/R/share/make/shlib.mk:6: pgmm.so] Error 1
ERROR: compilation failed for package ‘pgmm’
* removing ‘/home/eric/R/x86_64-pc-linux-gnu-library/old-versions/pgmm’
Warning message:
In i.p(...) :
installation of package ‘/tmp/Rtmp6Jj3B0/file3b5e87e350a98/pgmm_1.1.tar.gz’ had non-zero exit status
“R/x86_64-pc-linux-gnu-library/old-versions/”目录存在,1.1版本的pgmm包也存在。非常感谢任何修复建议。