由于缺少 GSL,R 包构建在 Windows 台机器 (AppVeyor) 上失败 - GNU Scientific Library

R package build failing on Windows machines (AppVeyor) due to missing GSL - GNU Scientific Library

我正在开发一个名为 DescObs 的 R 包(https://github.com/MaaniBeigy/DescObs). It imports conf.limits.nct function from MBESS, which itself depends on another package called gsl. It shows no problems at all for R CMD check and the installation of DescObs on Linux machines assessed by Travis continuous integration platform (https://travis-ci.org/MaaniBeigy/DescObs). However, AppVeyor fails

** libs
*** arch - i386
C:/Rtools/mingw_32/bin/gcc  -I"c:/R/include" -DNDEBUG -I/include         -O3 -Wall  -std=gnu99 -mtune=generic -c airy.c -o airy.o
airy.c:1:29: fatal error: gsl/gsl_sf_airy.h: No such file or directory
 #include <gsl/gsl_sf_airy.h>
                             ^
compilation terminated.
make: *** [c:/R/etc/i386/Makeconf:208: airy.o] Error 1
ERROR: compilation failed for package 'gsl'
* removing 'c:/RLibrary/gsl'
Error in i.p(...) : 
  (converted from warning) installation of package 'gsl' had non-zero exit status
Calls: <Anonymous> ... with_rprofile_user -> with_envvar -> force -> force -> i.p
Execution halted
Command exited with code 1

我也尝试了Building an R package that uses the GSL on Windows中推荐的解决方案,但没有帮助。我还使用 mingw-w64gcc-4.6.3 编译了它,它们都显示了相同的错误。
此外,我尝试通过 - cmd: vcpkg install gsl:x64-windows 安装,但确实显示了相同的错误。在这里,你可以看到我的 appveyor.yml.
你有什么想法吗?

幸运的是,我之前的 appveyor.yml 终于可以构建它了:

install:
  - ps: Bootstrap
  - cmd: git submodule update --init --recursive
  - cmd: git clone https://github.com/CxxTest/cxxtest
  - cmd: cd c:\tools\vcpkg
  - cmd: vcpkg integrate install
  - cmd: vcpkg install gsl:x64-windows
  - cmd: vcpkg install fftw3:x64-windows
  - cmd: cd "%APPVEYOR_BUILD_FOLDER%"
environment:
  global:
    USE_RTOOLS: true
    NOT_CRAN: true
    _R_CHECK_FORCE_SUGGESTS: true
    _R_CHECK_CRAN_INCOMING_: true
    #R_CHECK_ARGS: "--run-dontrun"
  matrix:

  - R_VERSION: devel
    R_ARCH: x64
    GCC_PATH: gcc-4.6.3

我不知道确切的原因,但我很高兴works

编辑:我在另一个 package. This line by Owen McDonnell image: previous visual studio 2015 could solve the problem. Refer to cvcqv package 中再次遇到了完整 appveyor.yml 的问题。

我来到这个帖子是因为我在尝试更新包时遇到了我认为非常相似的情况 gsl:

  • installing source package 'gsl' ... ** package 'gsl' successfully unpacked and MD5 sums checked ** using staged installation

    ********************************************** WARNING: this package has a configure script It probably needs manual configuration **********************************************

** libs "C:/rtools40/mingw64/bin/"gcc -I"C:/PROGRA~1/R/R-4.1.1/include" -DNDEBUG -I/include -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c airy.c -o airy.o airy.c:1:10: fatal error: gsl/gsl_sf_airy.h: No such file or directory #include <gsl/gsl_sf_airy.h> ^~~~~~~~~~~~~~~~~~~ compilation terminated. make: *** [C:/PROGRA~1/R/R-4.1.1/etc/x64/Makeconf:238: airy.o] Error 1 ERROR: compilation failed for package 'gsl'

  • removing 'C:/Users/shima/OneDrive/Documents/R/win-library/4.1/gsl'
  • restoring previous 'C:/Users/shima/OneDrive/Documents/R/win-library/4.1/gsl' Warning in install.packages : installation of package ‘gsl’ had non-zero exit status

这个帖子帮助我找到了解决方案,非常感谢,还有 this discussion and this one 对于 Windows 上的那些人,使用 Rtools,这里是我解决这个问题的步骤,即无法更新 [=15= 下 R 中的 gsl 包]:

  1. 开始 Rtools Bash(在 Windows 菜单的 appsRtools 4.0 中找到)
  2. 运行 pacman -S mingw-w64-x86_64-gsl 然后用 yes (y)
  3. 确认
  4. 我认为这不相关,但我 运行 pacman -Syu 就在更新我的 Rtools 并发出命令 pacman -Sl 之前给了我正确的名称2.
  5. pacman命令的包

更新 Rstudio 中的 gsl 现在会导致干净

  • 完成 (gsl)