[R] Installing Package rgl - Compilation Fails - FreeBSD

Rainer Hurling rhurlin at gwdg.de
Wed Feb 21 17:50:13 CET 2007


Brian,

I just tried your version rgl_0.70-2 with R-2.5.0 on FreeBSD 7.0-CURRENT 
(i386) and it works!

Thank you very much for this competently and very fast help.

Next I will try if it compiles on amd64, too ...

Rainer


Prof Brian Ripley schrieb:
> This looks to me like a problem in your OpenGL, I am afraid.
> 
> I've made available a (completely unofficial) revised tarball at
> 
> http://www.stats.ox.ac.uk/pub/R/rgl_0.70-2.tar.gz
> 
> that attempts to work around various configure issues.  Not only does it 
> assume a vanilla make, it also tests if the various headers and 
> libraries are actually present (without assuming they are in .../lib, 
> which they are not on my main system).  So the enquiry with originally 
> started this thread will get a clear error from configure about what is 
> wrong.
> 
> Duncan: I have left in -Iext in PKG_CPPFLAGS, but AFAICS it is only 
> needed on Windows.  We've lost the ability to use a static libpng unless 
> we have libpng-config:  that is I am afraid inevitable as there is no 
> way to find where it might be, and you can't just grab a object of the 
> right name on a multi-architecture system.  Actually, I think it is 
> fundamentally broken as only on a few systems would a static library be 
> PIC (and as i386 Linux with recent gcc is one of those, people tend to 
> forget that).
> 
> Brian Ripley
> 
> On Wed, 21 Feb 2007, Hiroyuki Kawakatsu wrote:
> 
>> Hi Rainer,
>>
>> Have you had any luck after Prof Ripley's suggested fix? I am on
>> FreeBSD 6.2 (amd64) and cannot get rgl to work either. With the
>> suggested fix and after commenting out the log2() declaration in
>> math.h, the package builds but segfaults when running the examples in
>> R CMD check. (I have contacted one of the maintainers about this a
>> while back on an earlier version of rgl but no response.) If you had
>> success, are you on a 32bit or 64bit system?
>>
>> h.
>>
>> * checking examples ... ERROR
>> Running examples in 'rgl-Ex.R' failed.
>> The error most likely occurred in:
>>
>>> ### * 3dobjects
>>>
>>> flush(stderr()); flush(stdout())
>>>
>>> ### Name: points3d
>>> ### Title: add primitive set shape
>>> ### Aliases: points3d lines3d segments3d triangles3d quads3d
>>> ### Keywords: dynamic
>>>
>>> ### ** Examples
>>>
>>> # Show 12 random vertices in various ways.
>>>
>>> M <- matrix(rnorm(36), 3, 12, dimnames=list(c('x','y','z'),
>> +                                        rep(LETTERS[1:4], 3)))
>>>
>>> # Force 4-tuples to be convex in planes so that quads3d works.
>>>
>>> for (i in c(1,5,9)) {
>> +     quad <- as.data.frame(M[,i+0:3])
>> +     coeffs <- runif(2,0,3)
>> +     if (mean(coeffs) < 1) coeffs <- coeffs + 1 - mean(coeffs)
>> +     quad$C <- with(quad, coeffs[1]*(B-A) + coeffs[2]*(D-A) + A)
>> +     M[,i+0:3] <- as.matrix(quad)
>> + }
>>>
>>> open3d()
>> [1] 1
>>>
>>> # Rows of M are x, y, z coords; transpose to plot
>>>
>>> M <- t(M)
>>> shift <- matrix(c(-3,3,0), 12, 3, byrow=TRUE)
>>>
>>> points3d(M, size=2)
>>
>> *** caught segfault ***
>> address 0x0, cause 'unknown'
>>
>> Traceback:
>> 1: .C(rgl_primitive, success = as.integer(FALSE), idata,
>> as.numeric(vertex),     NAOK = TRUE)
>> 2: rgl.primitive("points", x, y, z, ...)
>> 3: rgl.points(x = c(-0.626453810742332, 1.59528080213779,
>> 2.00575308060846, -0.305388387156356, -0.621240580541804,
>> -0.0449336090152309, 3.95860460385714, 0.782136300731067,
>> 0.61982574789471, -1.47075238389927, -5.58920873034883,
>> -0.0538050405829051, 0.183643324222082, 0.329507771815361,
>> 1.66524706227070, 1.51178116845085, -2.2146998871775,
>> -0.0161902630989461, 7.05452342645083, 0.0745649833651906,
>> -0.0561287395290008, -0.47815005510862, -2.69588540023329,
>> -1.37705955682861, -0.835628612410047, -0.820468384118015,
>> 0.407234134716211, 0.389843236411431, 1.12493091814311,
>> 0.94383621068530, -7.46953644668121, -1.98935169586337,
>> -0.155795506705329, 0.417941560199702, 1.02866050611420,
>> -0.41499456329968), y = NULL, z = NULL, color = "#000000",     alpha =
>> numeric(0), lit = TRUE, ambient = "#000000", specular = "#FFFFFF",
>> emission = "#000000", shininess = 50, smooth = TRUE, front = "filled",
>>   back = "filled", size = 2, fog = FALSE)
>> 4: do.call("rgl.points", c(list(x = x, y = y, z = z),
>> .fixMaterialArgs(...,     Params = save)))
>> 5: points3d(M, size = 2)
>> aborting ...
>>
>>
>>
>> Message: 53
>> Date: Tue, 20 Feb 2007 21:45:55 +0000 (GMT)
>> From: Prof Brian Ripley <ripley at stats.ox.ac.uk>
>> Subject: Re: [R] Installing Package rgl - Compilation Fails - FreeBSD
>>
>> The problem is that rgl is apparently written for GNU make, and has (as
>> shipped)
>>
>> ifdef MAKINGAGL
>> PKG_CPPFLAGS=@AGLCPPFLAGS@ -Iext
>> PKG_LIBS=@AGLLIBS@
>> else
>> PKG_CPPFLAGS= -If:/R/R-2.4.1/src/extra/zlib -DHAVE_PNG_H
>> -If:/R/R-2.4.1/src/gnuwin32/bitmap/libpng  -Iext
>> PKG_LIBS=-lgdi32 -lopengl32 -lglu32
>> -Lf:/R/R-2.4.1/src/gnuwin32/bitmap/libpng -
>> lpng -Lf:/R/R-2.4.1/src/extra/zlib -lz
>> endif
>>
>> and similar for BUILDAGL.
>>
>> That seems to have been written to make it workable on MacOS X. Given 
>> that
>> configure knows (or could know) the OS, it seems better to write (via
>> configure) a separate Makevars for MacOS X and remove all the
>> ifdef...endif stuff for everyone else.  (If you do that in Makevars.in it
>> should work.)



More information about the R-help mailing list