Search code examples
rwindowspackagegslappveyor

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


I am developing an R package called DescObs (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

I also tried the solution recommended in Building an R package that uses the GSL on Windows but it did not help. I also compiled it using mingw-w64 and gcc-4.6.3, which both showed the same error.
Moreover, I tried to install by - cmd: vcpkg install gsl:x64-windows, but did show the same error. Here, you can see my appveyor.yml.
Do you have any ideas?


Solution

  • Fortunately, my previous appveyor.yml could finally build it:

    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
    

    I do not know the exact reason, but I am glad it works.

    edit: I faced the problem again in another package. This line by Owen McDonnell image: previous visual studio 2015 could solve the problem. Refer to cvcqv package for the full appveyor.yml.