[R-SIG-Mac] Rgraphviz installation problem

Kasper Daniel Hansen khansen at stat.Berkeley.EDU
Tue Dec 12 03:39:29 CET 2006


I will revive this old thread due to me having recently spend  
considerable time in the internals of (R)Graphviz. So someone besides  
me might benefit from all that time :)

Essentially the conclusions are
1) There is a bug in Graphviz 2.4, 2.6 and 2.8 that makes it  
impossible to layout a graph with singleton nodes (nodes with any  
edges), using the "neato" layout machinery. This is - from the point  
of view of Graphviz - a special case, so it is not surprising that it  
might not work. For strange reasons this bug was not present in 2.5  
and 2.7 (odd numbers are devel versions). The reason why the OP had  
problems is that the vignette uses a random graph with a 0.2  
probability of including an edge, which usually leads to a graph with  
singleton nodes. Rgraphviz checks for versions 2.4 and 2.6 but was  
not updated after 2.8 was released. At least I have this problem on  
PPC and posters have reported the problem on Intel. The problem  
exists in Simon's binary version using the cmd line tools, so it is a  
Graphviz issue. Unless you have special needs (singleton nodes,  
unconnected graphs) it might be easiest to use Simon's binary.

2) The old version of Rgraphviz does not work with 2.10 and 2.12 (the  
newest version). I have (just) submitted a path that should make it  
workable with newer versions. It might take some time to appear.

Here is a quick lowdown on how to get Graphviz working on your system  
if you intend to compile from source.

* Do not use any optimization. Well, at least -O2 leads to broken  
binaries on PPC. This is due to some alignment issues (so just  
disabling some of the alignment optimizations might make it  
workable). This may or may not be a problem on Intel as well. The  
code compiles, the layout just gets messed up (run an example, it is  
easy to see, trust me :)

* You may avoid installing pkgconfig if you install Rgraphviz from  
source and use
   --config-args="--with-graphviz=/usr/local"
(if you have installed Graphviz in /usr/local).

* If you are using i-installer for TeX'ing you might have installed  
libpng using this program. Unfortunately, i-installer's version of  
libpng does not include a version which permits dynamic linking to  
the library per default. In order to get this you should set  
IL2DYLIBS=Keep when you install the package - for details see the i- 
installer release notes for libpng - this one took me a while to  
discover... Missing the dynamic version will result in a linking  
error so just try to compile it and see...

* With these settings it appears it works out of the box.  
Specifically I used the 4.0.3 version of GCC supplied with the CRAN  
binary of R and I configured using the following commands
PATH=/usr/local/gcc4.0/bin:$PATH
export PATH
CC="/usr/local/gcc4.0/bin/gcc-4.0 -arch ppc"
export CC
CFLAGS="-g -O0 -std=gnu99"
export CFLAGS
LDFLAGS="-L/usr/local/lib"
export LDFLAGS
CPPFLAGS="-I/usr/local/include"
export CPPFLAGS
CXX="g++-4.0 -arch ppc"
export CXX
CXXFLAGS="-g -O0"
export CXXFLAGS
CPP="gcc-4.0 -arch ppc -E"
export CPP
CXXCPP="g++-4.0 -arch ppc -E"
export CXXCPP
F77="gfortran-4.0 -arch ppc"
export F77
FFLAGS="-g -O0"
export FFLAGS

./configure --prefix=/usr/local \
    --mandir=/usr/local/share/man

make
sudo make install

Kasper


On Aug 24, 2006, at 10:05 AM, Seth Falcon wrote:

> Rob J Goedman <goedman at mac.com> writes:
>
>> Seth,
>>
>> Quite the contrary, most (all?) of the mails I've seen are on ppc.
>
> Yep, I was completely wrong on that one.
>
> As you demonstrated in a private mail, the issue appears to be with
> graphviz 2.8 on OS X (ppc _and_ intel).
>
> I was able to run the test script using Rgraphviz and a 2.7 devel
> version of graphviz (not sure how to get a hold of this).
>
> At any rate, we will be communicating with the graphviz team to report
> this.
>
> Sorry for the inconvenience, folks, but if the problem really is in
> graphviz itself, there isn't too much we can do...
>
> + seth
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac



More information about the R-SIG-Mac mailing list