簡體   English   中英

由於缺少 GSL,Windows 機器 (AppVeyor) 上的 R 包構建失敗 - GNU Scientific Library

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

我正在開發一個名為DescObs ( https://github.com/MaaniBeigy/DescObs ) 的 R 包。 它從MBESS導入conf.limits.nct函數,它本身依賴於另一個名為gsl包。 對於R CMD check和在由Travis持續集成平台 ( https://travis-ci.org/MaaniBeigy/DescObs ) 評估的 Linux 機器上安裝DescObs ,它完全沒有問題。 但是, AppVeyor失敗了

** 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

我還嘗試了在 Windows 上構建使用 GSL 的 R 包中推薦的解決方案但沒有幫助。 我還使用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

我不知道確切的原因,但我很高興它有效

編輯:我在另一個包中再次面臨問題 這一行由歐文麥克唐納 image: previous visual studio 2015可以解決問題 有關完整的appveyor.yml請參閱cvcqv軟件包

我來到這個線程是因為當我嘗試更新包gsl時,我遇到了我認為非常相似的情況:

  • 安裝包 'gsl' ... ** 包 'gsl' 成功解包並檢查 MD5 總和 ** 使用分階段安裝

    ********************************************** 警告:這個包有一個配置腳本 可能需要手動配置 ******************************************** *****

** 庫"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: 致命錯誤:gsl/gsl_sf_airy.h: 沒有這樣的文件或目錄 #include <gsl/gsl_sf_airy.h> ^~ ~~~~~~~~~~~~~~~~~~ 編譯終止。 make: *** [C:/PROGRA~1/R/R-4.1.1/etc/x64/Makeconf:238: airy.o] 錯誤 1 ​​錯誤:包 'gsl' 編譯失敗

  • 刪除“C:/Users/shima/OneDrive/Documents/R/win-library/4.1/gsl”
  • 恢復以前的“C:/Users/shima/OneDrive/Documents/R/win-library/4.1/gsl” install.packages 中的警告:安裝包“gsl”具有非零退出狀態

這個線程幫助我找到了解決方案,非常感謝你,以及這個討論這個對於那些在Windows使用Rtools ,這里是我解決這個問題的步驟,即無法在R下更新gslwindows

  1. 啟動Rtools Bash (在apps找到, Windows菜單中的Rtools 4.0
  2. 運行pacman -S mingw-w64-x86_64-gsl並使用 yes ( y ) 確認
  3. 我認為這Rtools ,但我之前運行pacman -Syu來更新我的Rtools並拋出命令pacman -Sl給了我pacman命令在 2 中的正確名稱。

現在在Rstudio更新gsl會導致干凈

  • 完成 (gsl)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM