Rainer Hurling
2012-May-15 17:05 UTC
[Rd] R-devel on FreeBSD: new C99 functions don't build
About April 25th, there had been some changes within R-devel's
src/nmath/pnbeta.c (and probably some other relevant places) and now
building R-devel on FreeBSD 10.0-CURRENT (amd64) with gcc-4.6.4 and
math/R-devel (selfmade forked port from math/R) fails like this:
[..snip..]
mkdir /usr/ports/math/R-devel/work/R-devel/bin/exec
gcc46 -std=gnu99 -I../../src/extra -I. -I../../src/include
-I../../src/include -I/usr/local/include -DHAVE_CONFIG_H -fopenmp -fpic
-O2 -pipe -O2 -fno-strict-aliasing -pipe -msse3
-Wl,-rpath=/usr/local/lib/gcc46 -c Rmain.c -o Rmain.o
gcc46 -std=gnu99 -export-dynamic -fopenmp -L/usr/local/lib
-Wl,-rpath=/usr/local/lib/gcc46 -o R.bin Rmain.o -L../../lib -lR -lRblas
../../lib/libR.so: undefined reference to `log1pl'
collect2: ld returned 1 exit status
*** [R.bin] Error code 1
Stop in /usr/ports/math/R-devel/work/R-devel/src/main.
*** [R] Error code 1
Stop in /usr/ports/math/R-devel/work/R-devel/src/main.
*** [R] Error code 1
Stop in /usr/ports/math/R-devel/work/R-devel/src.
*** [R] Error code 1
Stop in /usr/ports/math/R-devel/work/R-devel.
*** [do-build] Error code 1
Stop in /usr/ports/math/R-devel.
*** [build] Error code 1
Stop in /usr/ports/math/R-devel.
===>>> make failed for math/R-devel
It seems, that at least one new C99 function (log1pl) is introduced in
R-devel, see
src/nmath/pnbeta.c:l95
return (double) (log_p ? log1pl(-ans) : (1 - ans));
for which there is only a declaration in FreeBSDs math.h, but no full
implementation in libm (see http://wiki.freebsd.org/MissingMathStuff).
Is there any chance to get at least rudimentary replacement functions in
R-devel for systems with missing or defective C99 math functions?
(For example, in the similar case of log1p(), see the RMATH_HAVE_LOG1P
and RMATH_HAVE_WORKING_LOG1P bits in the configure script,
src/include/Rmath.h0.in, and src/nmath/log1p.c; thanks to b.f. for
pointing me out to this).
Thanks for any help,
Rainer Hurling
CC'ed to b.f. as the maintainer of the math/R port on FreeBSD.
Murray Stokely
2012-May-15 18:49 UTC
[Rd] R-devel on FreeBSD: new C99 functions don't build
On Tue, May 15, 2012 at 10:05 AM, Rainer Hurling <rhurlin at gwdg.de> wrote:> About April 25th, there had been some changes within R-devel's > src/nmath/pnbeta.c (and probably some other relevant places) and now > building R-devel on FreeBSD 10.0-CURRENT (amd64) with gcc-4.6.4 and > math/R-devel (selfmade forked port from math/R) fails like this:> It seems, that at least one new C99 function (log1pl) is introduced in > R-devel, see > > src/nmath/pnbeta.c:l95 > return (double) (log_p ? log1pl(-ans) : (1 - ans));AFAIK, Bruce Evans is not happy with the numerical accuracy of other open-source implementations of log1pl and so has blocked their inclusion in FreeBSD pending work on a better implementation. Can you put a conditional FreeBSD check here and use log1p instead of log1pl instead as a workaround? I can admire the insistence on correctness from the FreeBSD libm maintainers for their technical purity, but it can be a bit of a pain for things like this. - Murray