problems with graphviz port and selfupdate

Lisa Friedland <[email protected]> Tue, 29 Aug 2006 01:48:21 -0400
Newsgroups gmane.os.opendarwin.darwinports
Message-ID <[email protected]>
I normally try to avoid compiling at all costs, so please excuse  
whatever I shouldn't have done along the way in this saga.  I'm  
posting first to document the errors and solutions I've found (being  
grateful to previous reporters), and second to ask for suggestions  
about the current "Bus error".

Everything's running on OS 10.4 PPC G4.

1) [Suggestion]

I wanted to get a newer version of graphviz, so downloaded  
darwinports to get it (v.2.8).  Running the programs (dot or neato)  
from graphviz, I had the errors many people have seen (for instance  
at http://www.graphviz.org/bugs/b891.html) when outputting certain  
file types:
"Error: fontconfig: Didn't find expected font family. Perhaps URW  
Type 1 fonts need installing?"

Distracted by those bug reports and workarounds, I had many false  
starts before realizing the correct answer is actually to install  
those URW Type 1 fonts.  Easiest way:
port install urw-fonts

In fact, I can't see why urw-fonts isn't listed as a dependency for  
graphviz.  It needs to be installed first.

2) [Current issue, but probably a graphviz problem]

Before passing step 1, I ended up with three different installations  
of graphviz executables:
an old version that comes with the Mac GUI, in /Applications/ 
Graphviz.app/Contents/MacOS/
a fink version in /sw/bin (which, if I remember right, had related  
font errors and was an older version than in darwinports)
the darwinports version in /opt/bin
(and a local directory where I tried, but failed, to compile it from  
source.)

So when, after everything else was working I got a "Bus error" in  
neato (the graphviz program I'm using), and saw something on the web  
suggesting it could be from different versions getting linked in  
together, I decided I'd better clean up everything.  I deleted the  
fink version, took Graphviz.app out of my path, uninstalled all  
packages in darwinports, and reinstalled them.

Same problem: Bus error.

Updating darwinports seemed like something to try.  But . . .

2) [Compile problem and solution]

Running "port selfupdate", or downloading the source (DarwinPorts  
1.3.2) and trying to do the same, I first had a compile error about  
TCL not being compiled with threads enabled.  I grabbed the  
darwinports version of tcl tools, but these didn't have threads  
enabled either.  To get around this, I found http:// 
tcltkaqua.sourceforge.net/ and downloaded the current TclTkAqua  
distribution (8.4.10).  It's precompiled and did turn out to have  
threads enabled.  Hooray.

(The darwinports .dmg's (v.1.2 and v.1.3) seemed to install fine, but  
I imagine the problem would surface on a selfupdate.)

3) [Compile problem and hacked solution]

Running "port selfupdate" or compiling darwinports from source, this  
next error followed:
===> making all in src/pextlib1.0
gcc -c -DUSE_TCL_STUBS -g -O2 -W -Wall -pedantic -g -Os - 
DHAVE_CONFIG_H -I.. -I.  -I"/usr/include"  -DHAVE_UNISTD_H=1 - 
DHAVE_LIMITS_H=1 -DTCL_WIDE_INT_TYPE=long\ long -DWORDS_BIGENDIAN=1 - 
DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 - 
DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 - 
DNO_VALUES_H=1 -DNO_DLFCN_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 - 
DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 - 
DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 - 
DHAVE_TM_GMTOFF=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 - 
Dsocklen_t=unsigned -DHAVE_SIGNED_CHAR=1 -DHAVE_PUTENV_THAT_COPIES=1 - 
DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1  -fno-common Pextlib.c -o  
Pextlib.o
In file included from Pextlib.c:96:
/usr/include/sys/socket.h:99: error: two or more data types in  
declaration specifiers
make[2]: *** [Pextlib.o] Error 1
make[1]: *** [all] Error 1
make: *** [all] Error 1

FYI, I updated XCode at this point (from 2.0 to 2.4), which neither  
seems to have helped or hurt the matter.

Poking around randomly, I came up with the following fix, which  
solved it (but is probably not "the right" thing to do):
In the file DarwinPorts-1.3.2/Mk/dports.autoconf.mk, edit the  
TCL_DEFS in line 10.  Delete the flag "-Dsocklen_t=unsigned".  Then  
rerun "make" from the top directory.

----

Everything's dandy now except for that "bus error."  I'm suspecting,  
since I've only seen it with unusually large files, that it's  
actually a graphviz issue.  Unless anyone can think of a way I could  
have multiple libraries mixed in together (or something) at this point.

Thanks.
-Lisa