【发布时间】:2021-08-16 00:37:20
【问题描述】:
使用 R 脚本克隆了一个存储库,包括一个包含库的目录,最初在 Windows 机器上使用:
sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19041)
Matrix products: default
locale:
[1] LC_COLLATE=Portuguese_Portugal.1252 LC_CTYPE=Portuguese_Portugal.1252
[3] LC_MONETARY=Portuguese_Portugal.1252 LC_NUMERIC=C
[5] LC_TIME=Portuguese_Portugal.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.0.3 htmltools_0.5.0 tools_4.0.3 yaml_2.2.1 rmarkdown_2.5
[6] knitr_1.30 xfun_0.19 digest_0.6.27 rlang_0.4.8 evaluate_0.14
然后,遇到了几个问题,例如版本 3 或某些包执行失败。这些问题在管理 Debian 设置和重新安装此类软件包时得到了解决。
最后,当其中一个脚本运行时,会出现当前情况:
install.packages(pkgs = 'TSdist', lib = .libPaths()[1], dependencies = T)
trying URL 'https://cloud.r-project.org/src/contrib/TSdist_3.7.tar.gz'
Content type 'application/x-gzip' length 182707 bytes (178 KB)
==================================================
downloaded 178 KB
* installing *source* package ‘TSdist’ ...
** package ‘TSdist’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/build/r-base-fhxXXR/r-base-4.0.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c EDR.c -o EDR.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/build/r-base-fhxXXR/r-base-4.0.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c EDRnw.c -o EDRnw.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/build/r-base-fhxXXR/r-base-4.0.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c ERP.c -o ERP.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/build/r-base-fhxXXR/r-base-4.0.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c ERPnw.c -o ERPnw.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/build/r-base-fhxXXR/r-base-4.0.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c LCSS.c -o LCSS.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/build/r-base-fhxXXR/r-base-4.0.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c LCSSnw.c -o LCSSnw.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/build/r-base-fhxXXR/r-base-4.0.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c registerDynamicSymbol.c -o registerDynamicSymbol.o
gcc -std=gnu99 -shared -L/usr/lib/R/lib
-Wl,-Bsymbolic-functions -Wl,-z,relro -o TSdist.so EDR.o EDRnw.o ERP.o ERPnw.o LCSS.o LCSSnw.o registerDynamicSymbol.o -L/usr/lib/R/lib -lR
installing to /home/nmorais/deployment/euniversal-clustering/libraries/00LOCK-TSdist/00new/TSdist/libs
** R
** data
** inst
** byte-compile and prepare package for lazy loading
Error: object ‘getWindowsHandle’ is not exported by 'namespace:utils'
Execution halted
ERROR: lazy loading failed for package ‘TSdist’
* removing ‘/home/nmorais/deployment/euniversal-clustering/libraries/TSdist’
The downloaded source packages are in
‘/tmp/RtmpwJbt3F/downloaded_packages’
Warning message: In install.packages(pkgs = "TSdist", lib = .libPaths()[1], dependencies = T) :
installation of package ‘TSdist’ had non-zero exit status
伪装的机器给我们:
sessionInfo()
R version 4.0.4 (2021-02-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.2 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
>
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>
attached base packages:
[1] stats graphics grDevices utils datasets methods base
>
loaded via a namespace (and not attached):
[1] compiler_4.0.4 tools_4.0.4
提前致谢!
【问题讨论】:
-
奇数,
utils::getWindowsHandle是last modified 17y ago,在NAMESPACE中导出它的行在at least 12y 中没有改变。 -
这很有趣,因为 getWindowsHandle 是一个“获取窗口或 MS Windows 中 R 进程的 Windows 句柄”的函数。它似乎只适用于 Windows 计算机。 (当我尝试在 mac 或 linux 上运行时出现错误)。目前尚不清楚为什么该软件包会尝试在 Windows 机器上使用该功能。
标签: r linux windows gcc package