-->

Sunday, November 04, 2012

netpbm install

I needed to install netpbm in order to use astrometry.net, but the install sucked.

First, had to build with a bunch of flags:
CC=/usr/bin/gcc-4.2 CFLAGS="-arch i386 -arch x86_64" FFLAGS="-m32 -m64" LDFLAGS="-Wall -undefined dynamic_lookup -bundle -arch i386 -arch x86_64"  MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS_SHLIB="-fno-common" NETPBMLIBTYPE=dylib NETPBMLIBSUFFIX=dylib LDSHLIB="--shared" TIFFLIB=-ltiff JPEGLIB=-ljpeg PNGLIB=-lpng ZLIB=-lz make  (some of those probably aren't necessary, and oops my deployment target should've been 10.7 but I don't think it matters.

Then, I got error messages that looked like this:
strip: symbols referenced by indirect symbol table entries that can't be stripped in: /private/tmp/netpbm/bin/#inst.36429# (for architecture i386)
It was caused by this line:
 /Users/adam/repos/netpbm-10.35.86/buildtools/install.sh -c -s -m 755          atktopbm /tmp/netpbm/bin
I thought that looked a little suspicious, so I tried removing the "-s" (for "stripprg").  I had to remove it in the buildtools/install.sh directory.  Felt like a hack, but apparently worked.  Except that now I get dyld errors:

dyld: Library not loaded: /libnetpbm.10.dylib
  Referenced from: /usr/local/netpbm/bin/pnmfile
  Reason: image not found
Trace/BPT trap: 5

Solution:
export DYLD_LIBRARY_PATH=/usr/local/netpbm/lib/
in ~/.bashrc

UPDATE: Installing on 10.6.8 was trivial, ironically.

1 comment:

adamponting said...

OMG thank you! I was about to give up - so many things failed while Making, then "image not found" error when I tried doing anything, but

export DYLD_LIBRARY_PATH=/usr/local/netpbm/lib/

and suddenly what I was trying to do worked perfectly :-D