rhub
rhub copied to clipboard
gsl-config not found on linux/debian?
First off, thank you for all you do to provide and maintain the r-hub/rhub service! I do appreciate it. I have tinkered, researched, and submitted several times to try and answer my own question, and I'm hoping it is a quick answer so as to not take up too much of your time. If it does look like it will take up too much -- feel free to just point in another direction to try on my own.
I have an R-package right now that is being developed privately, otherwise, I'd include some reproducible examples. Here goes --
When I run rhub::check_on_windows()
, the entire check is successful. My Makevars.win
looks like
GSL_CFLAGS = -I$(LIB_GSL)/include
ifeq "$(WIN)" "64"
GSL_LIBS = -L$(LIB_GSL)/lib/x64 -lgsl -lgslcblas
else
GSL_LIBS = -L$(LIB_GSL)/lib/i386 -lgsl -lgslcblas
endif
# combine with standard arguments for R
PKG_CPPFLAGS = $(GSL_CFLAGS)
PKG_LIBS = $(GSL_LIBS)
With windows successful, I'll set it aside. Let's move onto Solaris. When I run rhub::check_on_solaris()
, I get a successful check as well with this Makevars
(let's call it for the sake of this trouble shooting "Makevars-form-1"):
- Makevars-form-1
PKG_CPPFLAGS=-I$(LIB_GSL)/include
PKG_LIBS=-L$(LIB_GSL)/lib -lgsl -lgslcblas
I also have a successful check with rhub::check_on_solaris()
using the trick from Section 1.6 of R-exts that talks about backticks and gsl-configure
-- the Makevars
looks like this (we'll labels it Makevars-form-2):
- Makevars-form-2
PKG_CPPFLAGS=`gsl-config --cflags`
PKG_LIBS=`gsl-config --libs`
I have yet a third (!) style which uses a configure file that looks for gsl-config
and then if found gets the information from its output. Let's call this Makevars-form-3:
- Makevars-form-3
GSL_CFLAGS = @GSL_CFLAGS@
GSL_LIBS = @GSL_LIBS@
PKG_LIBS=$(GSL_LIBS)
PKG_CFLAGS=$(GSL_CFLAGS)
with the configure.ac
made into configure
with a run of autoconf
in Terminal that uses the pattern popularized by the RcppGSLExample approach. I put an echo statement to print out the values and this is the output:
#> --------------------------------------------------
120#> GSL_CFLAGS: -I/opt/csw/include
121#> GSL_LIBS: -L/opt/csw/lib -lgsl -lgslcblas -lm
#> --------------------------------------------------
Okay. So at this point I have 3 different forms for identifying the location of GSL which lead to successful checks on solaris. Moreover, as a bonus, all 3 forms of Makevar lead to successful checks with rhub::check(platform="macos-highsierra-release-cran")
, and I include the echo statement for Makevar-form-3:
#> --------------------------------------------------
110#> GSL_CFLAGS: -I/usr/local/include
111#> GSL_LIBS: -L/usr/local/lib -lgsl -lgslcblas
112#> --------------------------------------------------
So what's the problem? -- The problem is when I move to Debian or Ubuntu. For instance, I'll call rhub::check_on_linux()
and apparently it can't find the gsl-config
. The R console output seems to end prematurely:
> check_on_linux()
─ Building package
─ Uploading package
─ Preparing build, see status at
https://builder.r-hub.io/status/[privatePackage].tar.gz-5c3cd76ba6cd44d292bee39666362244
─ Build started
─ Downloading and unpacking package file
─ Querying system requirements
─ Installing system requirements
─ Starting Docker container
─ Querying package dependencies
─ Installing package dependencies
>
And then I go and check the HTML sent to my email, and see the output for the PREPERROR:
#> ** using staged installation
209#> checking for gsl-config... no
210#> configure: error: gsl-config not found, is GSL installed?
211#> ERROR: configuration failed for package
Same story for the Debian and Ubuntu calls.
It is my impression from this file in https://github.com/r-hub/sysreqsdb/blob/master/sysreqs/libgsl.json that gsl is indeed installed for the debian, ubuntu, and etc -- given its contents:
{
"libgsl": {
"sysreqs": ["/Gnu Scientific Library/i", "/\\bgsl\\b/"],
"platforms": {
"DEB": [
{
"distribution": "Ubuntu",
"releases": ["precise", "trusty", "vivid", "wily"],
"runtime": "libgsl0ldbl",
"buildtime": "libgsl0-dev"
},
{
"distribution": "Ubuntu",
"runtime": "libgsl2",
"buildtime": "libgsl-dev"
},
{
"distribution": "Debian",
"releases": ["squeeze", "wheezy", "jessie"],
"runtime": "libgsl0ldbl",
"buildtime": "libgsl0-dev"
},
{
"distribution": "Debian",
"runtime": "libgsl2",
"buildtime": "libgsl-dev"
}
],
"PKGBUILD": "gsl",
"OSX/brew": "gsl",
"RPM": {
"runtime": "gsl",
"buildtime": "gsl-devel"
}
}
}
}
In closing, how do I structure the Makevars so that I can get successful checks on systems besides Windows, MacOS, and Solaris? Or am missing some other piece or setup entirely? Thank you for your time.