Possible issue with libtool

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
gsmmobiledev
Posts: 4
Joined: 2014-01-06T16:53:47-07:00
Authentication code: 6789

Possible issue with libtool

Post by gsmmobiledev »

I am trying to cross-compile ImageMagick-6.7.5-10 for arm-angstrom using an Ubuntu host and the arm-angstrom-linux-gnueabi-gcc tool chain. I can successfully cross-compile other software (such as libjpeg) using the same toolchain. I am using the following configure command line:

./configure --prefix=/home/zephyr/Downloads/ImageMagick-6.7.5-10/build-im --host=arm-angstrom-linux-gnueabi CC=arm-angstrom-linux-gnueabi-gcc CPPFLAGS='-I/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include' LDFLAGS='-L/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/lib -L/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/lib'
Last edited by gsmmobiledev on 2014-01-06T17:23:15-07:00, edited 2 times in total.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Possible issue with libtool

Post by magick »

Download the latest ImageMagick release, 6.8.8-1. If it fails to cross-compile, let us know and we will investigate further.
gsmmobiledev
Posts: 4
Joined: 2014-01-06T16:53:47-07:00
Authentication code: 6789

Re: Possible issue with libtool

Post by gsmmobiledev »

Okay... I downloaded the latest version (6.8.8.1) and get the same libtool error. The error is as follows...

./libtool: line 7486: cd: $SDK_PATH/$TARGET_SYS/usr/lib: No such file or directory
libtool: link: warning: cannot determine absolute directory name of `$SDK_PATH/$TARGET_SYS/usr/lib'
/bin/grep: $SDK_PATH/$TARGET_SYS/usr/lib/libjpeg.la: No such file or directory
/bin/sed: can't read $SDK_PATH/$TARGET_SYS/usr/lib/libjpeg.la: No such file or directory
libtool: link: `$SDK_PATH/$TARGET_SYS/usr/lib/libjpeg.la' is not a valid libtool archive
make[2]: *** [magick/libMagickCore-6.Q16.la] Error 1
make[2]: Leaving directory `/home/zephyr/Downloads/ImageMagick-6.8.8-1'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/zephyr/Downloads/ImageMagick-6.8.8-1'
make: *** [all] Error 2

What I have determined is that this is possibly a cross-compile toolchain issue rather than IM. The $SDK_PATH and $TARGET environment variables are defined in a setup script that is run in the terminal window before running './configure' and 'make' on the IM code. I have verified that $SDK_PATH and $TARGET_SYS point to real directories using '$echo $SDK_PATH', but libtool does not seem to use these and rather takes the literal names defined in the .la files. Does anybody have any suggestion on how I can fix this without having to edit all of the dependacy .la files?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Possible issue with libtool

Post by magick »

What about a static build? Use ./configure -0-disable-shared.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: Possible issue with libtool

Post by glennrp »

Does your setup script export the variables after it sets them?

export SDK_PATH TARGET_SYS
TomConnolly
Posts: 1
Joined: 2014-01-08T12:44:09-07:00
Authentication code: 6789

Re: Possible issue with libtool

Post by TomConnolly »

I'm having exactly the same issue:


CCLD wand/libMagickWand-6.Q16.la
/bin/sed: can't read Development/ImageMagick-6.8.8-1/magick/libMagickCore-6.Q16.la: No such file or directory
libtool: link: `Development/ImageMagick-6.8.8-1/magick/libMagickCore-6.Q16.la' is not a valid libtool archive
make[2]: *** [wand/libMagickWand-6.Q16.la] Error 1
make[2]: Leaving directory `/media/tom/UbuntuExtra/For Web Development/ImageMagick-6.8.8-1'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/media/tom/UbuntuExtra/For Web Development/ImageMagick-6.8.8-1'
make: *** [all] Error 2

This is without make options. When I tried again following instructions for disabling shared, I got this:

configure: error: unrecognized option: `-O-disable-shared'
Try `./configure --help' for more information
tom@home:/media/tom/UbuntuExtra/For Web Development/ImageMagick-6.8.8-1$ ./configure -0-disable-shared
configure: error: unrecognized option: `-0-disable-shared'

(I wasn't sure whether it was a zero or "o" so I tried both)
gsmmobiledev
Posts: 4
Joined: 2014-01-06T16:53:47-07:00
Authentication code: 6789

Re: Possible issue with libtool

Post by gsmmobiledev »

TomConnolly, I think the above was a typo. The switch setting should be --disable-shared. I will post my results shortly.
Last edited by gsmmobiledev on 2014-01-15T13:36:32-07:00, edited 1 time in total.
gsmmobiledev
Posts: 4
Joined: 2014-01-06T16:53:47-07:00
Authentication code: 6789

Re: Possible issue with libtool

Post by gsmmobiledev »

Ok... still having issues with my cross-compile environment. I have the required cross-compiled libraries in /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/lib and $SDK_PATH and $TARGET_SYS are exported with the above path components (i.e. $SDK_PATH = /usr/local/angstrom/arm and $TARGET_SYS = arm-angstrom-linux-gnueabi)

So $SDK_PATH/$TARGET_SYS/usr/lib/libjpeg.la should resove to /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/lib/libjpeg.la ... and the .la file is present at that location. I run the following configure command:

Code: Select all

./configure --prefix=/home/zephyr/Downloads/ImageMagick-6.8.8-1/build-im --host=arm-angstrom-linux-gnueabi --disable-shared
and get the following output from the configure step:

Code: Select all

ImageMagick is configured as follows. Please verify that this configuration
matches your expectations.

Host system type: arm-angstrom-linux-gnueabi
Build system type: i686-pc-linux-gnu

                  Option                        Value
-------------------------------------------------------------------------------
Shared libraries  --enable-shared=no		no
Static libraries  --enable-static=yes		yes
Module support    --with-modules=no		no
GNU ld            --with-gnu-ld=yes		yes
Quantum depth     --with-quantum-depth=16	16
High Dynamic Range Imagery
                  --enable-hdri=no		no

Delegate Configuration:
BZLIB             --with-bzlib=yes		yes
Autotrace         --with-autotrace=no		no
Dejavu fonts      --with-dejavu-font-dir=default	none
DJVU              --with-djvu=yes		no
DPS               --with-dps=yes		no
FFTW              --with-fftw=yes		no
FlashPIX          --with-fpx=yes		no
FontConfig        --with-fontconfig=yes		yes
FreeType          --with-freetype=yes		yes
GhostPCL          None				pcl6 (unknown)
GhostXPS          None				gxps (unknown)
Ghostscript       None				gs (9.05)
Ghostscript fonts --with-gs-font-dir=default	/usr/share/fonts/type1/gsfonts/
Ghostscript lib   --with-gslib=no		no
Graphviz          --with-gvc=no		
JBIG              --with-jbig=yes		no
JPEG v1           --with-jpeg=yes		yes
JPEG-2000         --with-jp2=yes		yes
LCMS v1           --with-lcms=yes		no
LCMS v2           --with-lcms2=yes		no
LQR               --with-lqr=yes		no
LTDL              --with-ltdl=yes		no
LZMA              --with-lzma=yes		no
Magick++          --with-magick-plus-plus=yes	yes
MUPDF             --with-mupdf=no		no
OpenEXR           --with-openexr=yes		no
PANGO             --with-pango=yes		no
PERL              --with-perl=no		no
PNG               --with-png=yes		yes
RSVG              --with-rsvg=no		no
TIFF              --with-tiff=yes		yes
WEBP              --with-webp=yes		no
Windows fonts     --with-windows-font-dir=	none
WMF               --with-wmf=no		no
X11               --with-x=			yes
XML               --with-xml=yes		no (failed tests)
ZLIB              --with-zlib=yes		yes

X11 Configuration:
      X_CFLAGS        = 
      X_PRE_LIBS      = -lSM -lICE
      X_LIBS          = 
      X_EXTRA_LIBS    = 

Options used to compile and link:
  PREFIX          = /home/zephyr/Downloads/ImageMagick-6.8.8-1/build-im
  EXEC-PREFIX     = /home/zephyr/Downloads/ImageMagick-6.8.8-1/build-im
  VERSION         = 6.8.8
  CC              = arm-angstrom-linux-gnueabi-gcc -std=gnu99 -std=gnu99
  CFLAGS          = -I/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/freetype2 -g -O2 -Wall -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
  CPPFLAGS        = -I/home/zephyr/Downloads/ImageMagick-6.8.8-1/build-im/include/ImageMagick-6
  PCFLAGS         = -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
  DEFS            = -DHAVE_CONFIG_H
  LDFLAGS         = 
  MAGICK_LDFLAGS  = -L/home/zephyr/Downloads/ImageMagick-6.8.8-1/build-im/lib 
  LIBS            = -ltiff -lfreetype -ljasper -ljpeg -lpng12 -lfontconfig -lXext -lXt -lSM -lICE -lX11 -lbz2 -lz -lm
  CXX             = arm-angstrom-linux-gnueabi-g++
  CXXFLAGS        = -g -O2 -pthread
  FEATURES        = DPC
  DELEGATES       = bzlib mpeg fontconfig freetype jng jp2 jpeg png ps tiff x zlib
You can see from the above that shared libraries are disabled and static is enabled. In the above, LDFLAGS is not set. If I run ./configure with the LDFLAGS='-L/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/lib', this will set LDFLAGS, but the output from make is the same.... it compiles just fine but when it hits the first link step, it cant seem to resolve the location of libjpeg.la correctly (output from make below)

Code: Select all

CCLD     magick/libMagickCore-6.Q16.la
./libtool: line 7486: cd: $SDK_PATH/$TARGET_SYS/usr/lib: No such file or directory
libtool: link: warning: cannot determine absolute directory name of `$SDK_PATH/$TARGET_SYS/usr/lib'
/bin/grep: $SDK_PATH/$TARGET_SYS/usr/lib/libjpeg.la: No such file or directory
/bin/sed: can't read $SDK_PATH/$TARGET_SYS/usr/lib/libjpeg.la: No such file or directory
libtool: link: `$SDK_PATH/$TARGET_SYS/usr/lib/libjpeg.la' is not a valid libtool archive
make[2]: *** [magick/libMagickCore-6.Q16.la] Error 1
make[2]: Leaving directory `/home/zephyr/Downloads/ImageMagick-6.8.8-1'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/zephyr/Downloads/ImageMagick-6.8.8-1'
make: *** [all] Error 2
I have been able to cross compile other code (i.e. libjpeg and mjpeg-streamer) for angstrom with no issues. I am at a loss for how to fix this issue. Any advice or thoughts would be most appreciated.
-thx
tmpresponse
Posts: 1
Joined: 2014-12-07T01:58:38-07:00
Authentication code: 6789

Re: Possible issue with libtool

Post by tmpresponse »

I also ran into the same error, with by libjpeg.la pristinely sitting in /usr/local/lib/. My very hacky work around was to "sudo ln -s /usr/local/lib/libjpeg.la /usr/lib/libjpeg.la"
Its not pretty but it got it to compile.
Post Reply