How do I install Perl/Tk 804.29 from CPAN on OS X with the Xcode tools?

1

A friend tried to install Perl/Tk 804.029 from source on his MacBook Pro, but it failed during the build of the internal zlib archive:

$ cpanp -i Tk
[...]
cd zlib && make libz.a "CC=llvm-gcc-4.2  " RANLIB="/usr/bin/ar s"
[...]
llvm-gcc-4.2   -arch x86_64 -arch i386 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include   -DUSE_MMAP   -c -o inffast.o inffast.c
ar rc libz.a adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o 
ar: libz.a is a fat file (use libtool(1) or lipo(1) and ar(1) on it)
ar: libz.a: Inappropriate file type or format
make[2]: *** [libz.a] Error 1
make[1]: *** [zlib/libz.a] Error 2
make: *** [subdirs] Error 2

Greg Bacon

Posted 2011-07-26T09:44:52.493

Reputation: 813

sudo port install p5-tk – Jared Burrows – 2013-09-09T05:11:28.430

Answers

3

See this discussion on the MacPorts mailing list. The primary suggestion is to use MacPorts and install the p5-tk port, which will include all its dependencies. I would agree with that, but if you're not interested in using MacPorts, then you would be best to build zlib outside of your Perl/Tk installation. The key thing is that the two architectures you have there, x86_64 and i386, create a fat library file which is not supported by the build system.

fideli

Posted 2011-07-26T09:44:52.493

Reputation: 13 618