Skip Menu |

This queue is for tickets about the Imager CPAN distribution.

Report information
The Basics
Id: 88039
Status: resolved
Priority: 0/
Queue: Imager

People
Owner: Nobody in particular
Requestors: jfield [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Problem compiling with JPEG support on OSX
Date: Thu, 22 Aug 2013 15:17:02 -0700
To: bug-Imager [...] rt.cpan.org
From: Jonathan Field <jfield [...] gmail.com>
Hello, First, thanks for building my favorite image manipulation package :) I have used it many times successfully on Linux systems. However... I am trying to build Imager 0.97 with jpeg support on OS X 10.8.4 (Mountain Lion). I have tried with libjpeg 6b, 7, 8d, and 9. In each case I am getting the same error in the perl Makefile.PL output: JPEG: main: includes found - libraries found JPEG: Test code failed: Can't link/include 'jpeg' JPEG: Checking if the compiler can find them on its own JPEG: Test code failed: Can't link/include 'jpeg' (Full output of perl Makefile.PL is at the bottom of the email) I configured the libjpeg libraries with --enable-shared and --enable-static, and "make test" reported no problems. They are in /usr/local/lib: -rwxr-xr-x 1 root admin 145076 Aug 22 13:47 libjpeg.62.dylib* -rwxr-xr-x 1 root admin 267252 Aug 22 14:12 libjpeg.7.dylib* -rwxr-xr-x 1 root admin 277952 Aug 22 14:16 libjpeg.8.dylib* -rwxr-xr-x 1 root admin 281440 Aug 22 14:18 libjpeg.9.dylib* -rw-r--r-- 1 root admin 1281080 Aug 22 14:18 libjpeg.a lrwxr-xr-x 1 root admin 15 Aug 22 14:18 libjpeg.dylib@ -> libjpeg.9.dylib -rwxr-xr-x 1 root admin 910 Aug 22 14:18 libjpeg.la* I verified after each libjpeg install that the symlink was pointing to the version just installed. And /usr/local/include has the following file, which was correctly updated after each libjpeg installation: -rw-r--r-- 1 root admin 48910 Aug 22 14:18 jpeglib.h Here's the output of perl -V: Summary of my perl5 (revision 5 version 12 subversion 4) configuration: Platform: osname=darwin, osvers=12.0, archname=darwin-thread-multi-2level uname='darwin b1026.apple.com 12.0 darwin kernel version 12.0.0: tue may 15 23:31:29 pdt 2012; root:xnu-2050.6.70~1release_x86_64 x86_64 ' config_args='-ds -e -Dprefix=/usr -Dccflags=-g -pipe -Dldflags= -Dman3ext=3pm -Duseithreads -Duseshrplib -Dinc_version_list=none -Dcc=clang' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='clang', ccflags ='-arch i386 -arch x86_64 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include', optimize='-Os', cppflags='-g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='clang -mmacosx-version-min=10.8', ldflags ='-arch i386 -arch x86_64 -fstack-protector -L/usr/local/lib' libpth=/usr/local/lib /usr/lib libs=-ldbm -ldl -lm -lutil -lc perllibs=-ldl -lm -lutil -lc libc=, so=dylib, useshrplib=true, libperl=libperl.dylib gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-arch i386 -arch x86_64 -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API Locally applied patches: /Library/Perl/Updates/<version> comes before system perl directories installprivlib and installarchlib points to the Updates directory Built under darwin Compiled at Jun 20 2012 13:55:28 @INC: /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.4/darwin-thread-multi-2level /Library/Perl/Updates/5.12.4 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library/Perl/Extras/5.12 . --- and here is the output of running Makefile.PL jfield@laptop:~/Downloads/Imager-0.97 > perl Makefile.PL done. TT-fonts: includes not found - libraries not found POSIX threads Writing Makefile for Imager::CountColor Writing Makefile for Imager::Filter::DynTest FreeType 2: main: includes not found - libraries found FreeType 2: alt 1: includes found - libraries found FreeType 2: Test code failed: Can't link/include 'ft2build.h', 'freetype' FreeType 2: alt 2: includes not found - libraries found FreeType 2: Checking if the compiler can find them on its own Note (probably harmless): No library found for -lfreetype FreeType 2: Test code failed: Can't link/include 'ft2build.h', 'freetype' Writing Makefile for Imager::Filter::Flines GIF: main: includes not found - libraries not found GIF: Checking if the compiler can find them on its own Note (probably harmless): No library found for -lgif GIF: Test code failed: Can't link/include 'gif_lib.h', 'stdio.h', 'errno.h', 'string.h', 'gif' Writing Makefile for Imager::File::ICO JPEG: main: includes found - libraries found JPEG: Test code failed: Can't link/include 'jpeg' JPEG: Checking if the compiler can find them on its own JPEG: Test code failed: Can't link/include 'jpeg' Writing Makefile for Imager::Filter::Mandelbrot PNG: Generic: includes found - libraries found PNG: Test code failed: Can't link/include 'png' PNG: v1.6: includes not found - libraries not found PNG: v1.5: includes found - libraries found PNG: Test code failed: Can't link/include 'png15' PNG: v1.4: includes not found - libraries not found PNG: v1.2: includes not found - libraries not found PNG: v1.0: includes not found - libraries not found PNG: base (+libz): includes found - libraries found PNG: Test code failed: Can't link/include 'png', 'z' PNG: v1.6 (+libz): includes not found - libraries not found PNG: v1.5 (+libz): includes found - libraries found PNG: Test code failed: Can't link/include 'png15', 'z' PNG: v1.4 (+libz): includes not found - libraries not found PNG: v1.2 (+libz): includes not found - libraries not found PNG: v1.0 (+libz): includes not found - libraries not found PNG: Checking if the compiler can find them on its own Note (probably harmless): No library found for -lpng PNG: Test code failed: Can't link/include 'png.h', 'stdio.h', 'png' Writing Makefile for Imager::File::SGI T1Lib: main: includes not found - libraries not found T1Lib: Checking if the compiler can find them on its own Note (probably harmless): No library found for -lt1 T1Lib: Test code failed: Can't link/include 't1lib.h', 't1' TIFF: main: includes found - libraries found TIFF: Test code failed: Can't link/include 'tiff' TIFF: Checking if the compiler can find them on its own Note (probably harmless): No library found for -ltiff TIFF: Test code failed: Can't link/include 'tiffio.h', 'stdio.h', 'string.h', 'tiff' Win32: main: includes not found - libraries not found Win32: Checking if the compiler can find them on its own Note (probably harmless): No library found for -lgdi32 Win32: Test code failed: Can't link/include 'windows.h', 'gdi32' Writing Makefile for Imager::plugins Writing Makefile for Imager Libraries *not* found: FT2 GIF JPEG PNG T1 TIFF Win32 Any suggestions? Jonathan Field
Subject: Re: [rt.cpan.org #88039] Problem compiling with JPEG support on OSX
Date: Fri, 23 Aug 2013 08:29:42 +1000
To: Jonathan Field via RT <bug-Imager [...] rt.cpan.org>
From: Tony Cook <tony [...] develop-help.com>
On Thu, Aug 22, 2013 at 06:17:19PM -0400, Jonathan Field via RT wrote: Show quoted text
> First, thanks for building my favorite image manipulation package :) I have > used it many times successfully on Linux systems. However... > > I am trying to build Imager 0.97 with jpeg support on OS X 10.8.4 (Mountain > Lion). I have tried with libjpeg 6b, 7, 8d, and 9. In each case I am > getting the same error in the perl Makefile.PL output: > > JPEG: main: includes found - libraries found > JPEG: Test code failed: Can't link/include 'jpeg' > JPEG: Checking if the compiler can find them on its own > JPEG: Test code failed: Can't link/include 'jpeg' > > (Full output of perl Makefile.PL is at the bottom of the email) > > I configured the libjpeg libraries with --enable-shared and > --enable-static, and "make test" reported no problems. They are in > /usr/local/lib: > > -rwxr-xr-x 1 root admin 145076 Aug 22 13:47 libjpeg.62.dylib* > -rwxr-xr-x 1 root admin 267252 Aug 22 14:12 libjpeg.7.dylib* > -rwxr-xr-x 1 root admin 277952 Aug 22 14:16 libjpeg.8.dylib* > -rwxr-xr-x 1 root admin 281440 Aug 22 14:18 libjpeg.9.dylib* > -rw-r--r-- 1 root admin 1281080 Aug 22 14:18 libjpeg.a > lrwxr-xr-x 1 root admin 15 Aug 22 14:18 libjpeg.dylib@ -> > libjpeg.9.dylib > -rwxr-xr-x 1 root admin 910 Aug 22 14:18 libjpeg.la* > > I verified after each libjpeg install that the symlink was pointing to the > version just installed. And /usr/local/include has the following file, > which was correctly updated after each libjpeg installation:
Hi Jonathan, You most likely need to build libjpeg with multi-arch support. See: https://metacpan.org/module/TONYC/Imager-0.97/lib/Imager/Install.pod#Building-libraries for details on how to do that. If that doesn't solve the problem, please send me the output of: perl Makefile.PL --verbose Tony
Subject: Re: [rt.cpan.org #88039] Problem compiling with JPEG support on OSX
Date: Thu, 22 Aug 2013 16:09:03 -0700
To: bug-Imager [...] rt.cpan.org
From: Jonathan Field <jfield [...] gmail.com>

Message body is not shown because it is too large.

Message body is not shown because it is too large.

Subject: Re: [rt.cpan.org #88039] Problem compiling with JPEG support on OSX
Date: Fri, 23 Aug 2013 09:57:32 +1000
To: Jonathan Field via RT <bug-Imager [...] rt.cpan.org>
From: Tony Cook <tony [...] develop-help.com>
On Thu, Aug 22, 2013 at 07:09:27PM -0400, Jonathan Field via RT wrote: Show quoted text
> Queue: Imager > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=88039 > > > Hi Tony, > > Thanks for the quick response. I recompiled libjpeg 6b with: > > ./configure --enable-shared --enable-static --disable-dependency-tracking > CFLAGS='-arch x86_64 -arch i386' > > perl Makefile.PL had the same problem. I have included the perl Makefile.PL > --verbose output below, but here's an interesting result: for the heck of > it I tried installing an old copy of Imager I had laying around (Imager > 0.79) and that linked and worked fine with libjpeg 6b, even without the > additional CFLAGS arguments. Perhaps there's in hint in that result?
... Show quoted text
> > > -rwxr-xr-x 1 root admin 145076 Aug 22 13:47 libjpeg.62.dylib* > > > -rwxr-xr-x 1 root admin 267252 Aug 22 14:12 libjpeg.7.dylib* > > > -rwxr-xr-x 1 root admin 277952 Aug 22 14:16 libjpeg.8.dylib* > > > -rwxr-xr-x 1 root admin 281440 Aug 22 14:18 libjpeg.9.dylib* > > > -rw-r--r-- 1 root admin 1281080 Aug 22 14:18 libjpeg.a > > > lrwxr-xr-x 1 root admin 15 Aug 22 14:18 libjpeg.dylib@ -> > > > libjpeg.9.dylib > > > -rwxr-xr-x 1 root admin 910 Aug 22 14:18 libjpeg.la* > > > > > > I verified after each libjpeg install that the symlink was pointing to
> > the
> > > version just installed. And /usr/local/include has the following file, > > > which was correctly updated after each libjpeg installation:
Hi Jonathan, Is libjpeg.dylib still pointing at libjpeg.9.dylib, or did the reinstall point it at libjpeg.62.dylib? From the trace I see: ld: warning: ignoring file /usr/local/lib/libjpeg.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /usr/local/lib/libjpeg.dylib Undefined symbols for architecture i386: "_jpeg_CreateDecompress", referenced from: _main in assertlibm8vo7vvt-BeA27R.o "_jpeg_std_error", referenced from: _main in assertlibm8vo7vvt-BeA27R.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) JPEG: Test code failed: Can't link/include 'jpeg' JPEG: Checking if the compiler can find them on its own If you run: file /usr/local/lib/libjpeg.dylib you should get results something like (mine is in a different location): neptune:~ tony$ file ~/local/lib/libjpeg.dylib /Users/tony/local/lib/libjpeg.dylib: Mach-O universal binary with 3 architectures /Users/tony/local/lib/libjpeg.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 /Users/tony/local/lib/libjpeg.dylib (for architecture i386): Mach-O dynamically linked shared library i386 /Users/tony/local/lib/libjpeg.dylib (for architecture ppc7400): Mach-O dynamically linked shared library ppc Tony
Subject: Re: [rt.cpan.org #88039] Problem compiling with JPEG support on OSX
Date: Thu, 22 Aug 2013 19:58:43 -0700
To: bug-Imager [...] rt.cpan.org
From: Jonathan Field <jfield [...] gmail.com>
Yes, libjpeg.dylib currently points to libjpeg.62.dylib - that listing was from a previous test with v9. The output of file libjpeg.dylib: jfield@laptop:/usr/local/lib > file libjpeg.dylib libjpeg.dylib: Mach-O 64-bit dynamically linked shared library x86_64 jfield@laptop:/usr/local/lib > So it looks like i386 isn't getting compiled into libjpeg.62.dylib despite the flags. I did eventually get Imager 0.97 working after trying a few more things: first, it seems like libjpeg 6b doesn't want to compile for i386 at all on Mountain Lion. If I try compiling it just for i386 I get several errors along the lines of: ld: warning: ignoring file .libs/rdtarga.o, file was built for i386 which is not the architecture being linked (x86_64): .libs/rdtarga.o And it ultimately fails. I tried compiling the latest version of libjpeg (v9) for both architectures, but that didn't work either: make all-am CC jaricom.lo llvm-gcc-4.2: -E, -S, -save-temps and -M options are not allowed with multiple -arch flags make[1]: *** [jaricom.lo] Error 1 make: *** [all] Error 2 However, I was able to get v9 to build with i386 and x86_64 separately. I then found a page that explained how to combine them using lipo: http://cpanforum.com/threads/13588 That's his suggested "solution 2". And that worked - Imager 0.97 built fine with that. Afterwards I tried "solution 1" (building Imager for only x86_64) and that also worked. It also picked up PNG support with that, so I think I'll go that way. Interesting that at the bottom of that page they mention your solution again, but that didn't seem to work for me. Not sure if this is a Mountain Lion thing or something strange with my setup. So it seems the the issues trace back to libjpeg being finicky about building for both architectures. Not sure if that's useful info to you or not, for future support, but there you go. Thanks for your time, Tony, and for setting me on the right path. Cheers, Jonathan On Thu, Aug 22, 2013 at 4:57 PM, tony@develop-help.com via RT < bug-Imager@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=88039 > > > On Thu, Aug 22, 2013 at 07:09:27PM -0400, Jonathan Field via RT wrote:
> > Queue: Imager > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=88039 > > > > > Hi Tony, > > > > Thanks for the quick response. I recompiled libjpeg 6b with: > > > > ./configure --enable-shared --enable-static
> --disable-dependency-tracking
> > CFLAGS='-arch x86_64 -arch i386' > > > > perl Makefile.PL had the same problem. I have included the perl
> Makefile.PL
> > --verbose output below, but here's an interesting result: for the heck of > > it I tried installing an old copy of Imager I had laying around (Imager > > 0.79) and that linked and worked fine with libjpeg 6b, even without the > > additional CFLAGS arguments. Perhaps there's in hint in that result?
> > ...
> > > > -rwxr-xr-x 1 root admin 145076 Aug 22 13:47 libjpeg.62.dylib* > > > > -rwxr-xr-x 1 root admin 267252 Aug 22 14:12 libjpeg.7.dylib* > > > > -rwxr-xr-x 1 root admin 277952 Aug 22 14:16 libjpeg.8.dylib* > > > > -rwxr-xr-x 1 root admin 281440 Aug 22 14:18 libjpeg.9.dylib* > > > > -rw-r--r-- 1 root admin 1281080 Aug 22 14:18 libjpeg.a > > > > lrwxr-xr-x 1 root admin 15 Aug 22 14:18 libjpeg.dylib@ -> > > > > libjpeg.9.dylib > > > > -rwxr-xr-x 1 root admin 910 Aug 22 14:18 libjpeg.la* > > > > > > > > I verified after each libjpeg install that the symlink was pointing
> to
> > > the
> > > > version just installed. And /usr/local/include has the following
> file,
> > > > which was correctly updated after each libjpeg installation:
> > Hi Jonathan, > > Is libjpeg.dylib still pointing at libjpeg.9.dylib, or did the > reinstall point it at libjpeg.62.dylib? > > From the trace I see: > > ld: warning: ignoring file /usr/local/lib/libjpeg.dylib, file was built for > unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 > 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked > (i386): /usr/local/lib/libjpeg.dylib > Undefined symbols for architecture i386: > "_jpeg_CreateDecompress", referenced from: > _main in assertlibm8vo7vvt-BeA27R.o > "_jpeg_std_error", referenced from: > _main in assertlibm8vo7vvt-BeA27R.o > ld: symbol(s) not found for architecture i386 > clang: error: linker command failed with exit code 1 (use -v to see > invocation) > JPEG: Test code failed: Can't link/include 'jpeg' > JPEG: Checking if the compiler can find them on its own > > If you run: > > file /usr/local/lib/libjpeg.dylib > > you should get results something like (mine is in a different > location): > > neptune:~ tony$ file ~/local/lib/libjpeg.dylib > /Users/tony/local/lib/libjpeg.dylib: Mach-O universal binary with 3 > architectures > /Users/tony/local/lib/libjpeg.dylib (for architecture x86_64): Mach-O > 64-bit dynamically linked shared library x86_64 > /Users/tony/local/lib/libjpeg.dylib (for architecture i386): Mach-O > dynamically linked shared library i386 > /Users/tony/local/lib/libjpeg.dylib (for architecture ppc7400): Mach-O > dynamically linked shared library ppc > > Tony > >
Subject: Re: [rt.cpan.org #88039] Problem compiling with JPEG support on OSX
Date: Sat, 9 Nov 2013 13:30:54 -0800
To: bug-Imager [...] rt.cpan.org
From: Jonathan Field <jfield [...] gmail.com>
Hi Tony, Just wanted to send you an installation note in case you want to add anything about this the documentation. I've recently installed Imager on Mac OS X 10.9 (Mavericks). I was able to use the default configuration when compiling libjpeg, libpng, and libgif, however I had to configure Imager to only build x86_64. I did it like so: env "ARCHFLAGS=-arch x86_64" perl Makefile.PL This got it to recognize and include the three image libraries I had installed. Without the environment variable it wouldn't pick them up as they were 64-bit only by default. I briefly tried compiling the libraries for multi-arch support, but there were lots of troubles there. So I'd say the above approach is the simplest way to get a successful Imager build on Mavericks. Hope that is helpful to someone else :) Cheers, Jonathan On Thu, Aug 22, 2013 at 3:29 PM, tony@develop-help.com via RT < bug-Imager@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=88039 > > > On Thu, Aug 22, 2013 at 06:17:19PM -0400, Jonathan Field via RT wrote:
> > First, thanks for building my favorite image manipulation package :) I
> have
> > used it many times successfully on Linux systems. However... > > > > I am trying to build Imager 0.97 with jpeg support on OS X 10.8.4
> (Mountain
> > Lion). I have tried with libjpeg 6b, 7, 8d, and 9. In each case I am > > getting the same error in the perl Makefile.PL output: > > > > JPEG: main: includes found - libraries found > > JPEG: Test code failed: Can't link/include 'jpeg' > > JPEG: Checking if the compiler can find them on its own > > JPEG: Test code failed: Can't link/include 'jpeg' > > > > (Full output of perl Makefile.PL is at the bottom of the email) > > > > I configured the libjpeg libraries with --enable-shared and > > --enable-static, and "make test" reported no problems. They are in > > /usr/local/lib: > > > > -rwxr-xr-x 1 root admin 145076 Aug 22 13:47 libjpeg.62.dylib* > > -rwxr-xr-x 1 root admin 267252 Aug 22 14:12 libjpeg.7.dylib* > > -rwxr-xr-x 1 root admin 277952 Aug 22 14:16 libjpeg.8.dylib* > > -rwxr-xr-x 1 root admin 281440 Aug 22 14:18 libjpeg.9.dylib* > > -rw-r--r-- 1 root admin 1281080 Aug 22 14:18 libjpeg.a > > lrwxr-xr-x 1 root admin 15 Aug 22 14:18 libjpeg.dylib@ -> > > libjpeg.9.dylib > > -rwxr-xr-x 1 root admin 910 Aug 22 14:18 libjpeg.la* > > > > I verified after each libjpeg install that the symlink was pointing to
> the
> > version just installed. And /usr/local/include has the following file, > > which was correctly updated after each libjpeg installation:
> > Hi Jonathan, > > You most likely need to build libjpeg with multi-arch support. > > See: > > > https://metacpan.org/module/TONYC/Imager-0.97/lib/Imager/Install.pod#Building-libraries > > for details on how to do that. > > If that doesn't solve the problem, please send me the output of: > > perl Makefile.PL --verbose > > Tony > >