[R-pkg-devel] R package build- C compilation issue related to math.h

Vincent Plagnol v|ncent@p|@gno| @end|ng |rom gm@||@com
Thu Oct 20 00:39:57 CEST 2022


Dear all at R-package-devel,

I am struggling with a R package build.
It builds fine on my mac, which is my usual work environment. But when I
submit to CRAN, while the windows version is fine, the debian version fails
with a cryptic message:














** installing *source* package ‘ExomeDepth’ ...** using staged
installation** libsg++-12  -std=gnu++14 -I"/home/hornik/tmp/R/include"
-DNDEBUG   -I/usr/local/include -DUSE_TYPE_CHECKING_STRICT
-D_FORTIFY_SOURCE=2   -fpic  -g -O2 -Wall -pedantic -mtune=native  -c
CNV_estimate.cpp -o CNV_estimate.ogcc-12  -I"/home/hornik/tmp/R/include"
-DNDEBUG   -I/usr/local/include -DUSE_TYPE_CHECKING_STRICT
-D_FORTIFY_SOURCE=2   -fpic  -g -O2 -Wall -Wstrict-prototypes -pedantic
-mtune=native  -c ExomeDepth_init.c -o ExomeDepth_init.ogcc-12
 -I"/home/hornik/tmp/R/include" -DNDEBUG   -I/usr/local/include
-DUSE_TYPE_CHECKING_STRICT -D_FORTIFY_SOURCE=2   -fpic  -g -O2 -Wall
-Wstrict-prototypes -pedantic -mtune=native  -c VP_gamma.c -o VP_gamma.oIn
file included from gsl_math.h:22,                 from
VP_gamma.c:23:/usr/include/x86_64-linux-gnu/bits/mathcalls.h:85:1: error:
expected ‘;’ before ‘extern’   85 | __MATHCALL_VEC (acosh,, (_Mdouble_
__x));      |
^~~~~~~~~~~~~~/usr/include/x86_64-linux-gnu/bits/mathcalls.h:87:1: error:
expected ‘;’ before ‘extern’   87 | __MATHCALL_VEC (asinh,, (_Mdouble_
__x));      | ^~~~~~~~~~~~~~*


It is painful to debug because I don't have a debian machine. Furthermore
the issue seems to be in the file called at line 22 of gsl_math.sh which is
#include <math.h>
These are rather arcane (to me) building blocks of C and I don't get why it
would suddenly create some issue on Debian (but not on mac or windows).

My issue is perhaps that I copied substantial amount of the GSL library (as
opposed to using it as dependency) but it would be painful to do otherwise
now (this is an old package that has started to complain only recently).

Any and all advice is welcome to help me interpret what I see here.

Thanks,

Vincent

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list