#6 Looking for libtiff.a in wrong directory

closed
5
2008-05-22
2008-05-14
TConrad
No

Hello:

I am building GraphicsMagick-1.2 on AIX 5.3. If I build with tiff support, it builds without error, but executing gm gives the following error:

0509-036 Cannot load program gm because of the following errors:
0509-150 Dependent module /opt/freeware/lib/libtiff.a(libtiff.so.3) could not be loaded.
0509-152 Member libtiff.so.3 is not found in archive

On the system I'm working on libtiff.a is installed in two places. The version GraphicsMagick needs is in /opt/apps/ots/lib, not in /opt/freeware/lib.

I need to make GraphicsMagick (gm) look for libtiff.a in /opt/apps/ots/lib (or, more generally, in whatever directory I tell it to look in) instead of /opt/freeware/lib. How can I make this happen? I've tried building GraphicsMagick several (about 15) different ways. Nothing worked. Your help will be much appreciated.

---Thanks
---T.Conrad

Discussion

1 2 > >> (Page 1 of 2)
  • Logged In: YES
    user_id=128624
    Originator: NO

    Add the configure options

    LDFLAGS=-L/opt/apps/ots/lib CPPFLAGS=-I/opt/apps/ots/include

    and it should look in the right place. However, there could still be an issue if a package like FreeType is installed and freetype-config is found via PATH in /opt/freeware/bin such that it adds additional search paths to look in /opt/freeware/lib. Another library which uses an external config program is libwmf.

     
    • assigned_to: nobody --> bfriesen
     
  • TConrad
    TConrad
    2008-05-14

    Logged In: YES
    user_id=1885529
    Originator: YES

    Mr. Friesenhahn:

    I already have those two configure options defined in my build. Didn't solve the problem.

    But your other point about freetype-config...I see this file it in /opt/freeware/bin. Should I remove this directory from my PATH?

    ---TC

     
  • Logged In: YES
    user_id=128624
    Originator: NO

    If you don't need/want anything from /opt/freeware, then temporarily removing it from your PATH will keep GraphicsMagick from picking anything up from there.

     
  • TConrad
    TConrad
    2008-05-15

    Logged In: YES
    user_id=1885529
    Originator: YES

    I removed /opt/freeware/bin from PATH [which disabled FreeType] and re-built GM. Received the same error message.

    Anything else I can try?

     
  • Logged In: YES
    user_id=128624
    Originator: NO

    Since removing /opt/freeware/bin from the PATH did not solve the problem, it seems likely that one of the other libraries you are using is already dependent on a library in /opt/freetype/lib and this is pulling in unwanted dependencies. It is also possible that there is a system-wide configuration (or an environment variable such as LD_OPTIONS, LD_RUN_PATH, or LD_LIBRARY_PATH) which causes the linker to look there. Can you post the report which gets printed at the end of configure which shows the options which were enabled, and the various build flags which will be used?

     
  • TConrad
    TConrad
    2008-05-16

    Logged In: YES
    user_id=1885529
    Originator: YES

    Other libraries in /opt/freeware/lib that GM could possibly be using are png, zlib, and bzlib.

    The following is the configure report.

    ----------------------------------------

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

    Host system type : powerpc-ibm-aix5.3.0.0
    Build system type : powerpc-ibm-aix5.3.0.0

    Option Configure option Configured value
    -----------------------------------------------------------------
    Shared libraries --enable-shared=no no
    Static libraries --enable-static=yes yes
    GNU ld --with-gnu-ld=no no
    Quantum depth --with-quantum-depth=8 8

    Delegate Configuration:
    BZLIB --with-bzlib=yes yes
    DPS --with-dps=yes no
    FlashPIX --with-fpx=no no
    FreeType 2.0 --with-ttf=yes no (failed tests)
    Ghostscript None gs (unknown)
    Ghostscript fonts --with-gs-font-dir=default none
    Ghostscript lib --with-gslib=no no
    JBIG --with-jbig=yes no
    JPEG v1 --with-jpeg=yes yes
    JPEG-2000 --with-jp2=yes yes
    LCMS --with-lcms=yes no
    Magick++ --with-magick-plus-plus=yes yes
    PERL --with-perl=no no
    PNG --with-png=yes yes
    TIFF --with-tiff=yes yes
    TRIO --with-trio=yes no
    Windows fonts --with-windows-font-dir= none
    WMF --with-wmf=yes no
    X11 --with-x= yes
    XML --with-xml=yes yes
    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:
    CC = /usr/vacpp/bin/xlC
    CFLAGS = -q64 -g -qmaxmem=-1 -qarch=auto -D_THREAD_SAFE
    CPPFLAGS = -I/opt/apps/ots/include -I/opt/apps/ots/jpeg/jpeg2000/include -I/opt/freeware/include/libxml2
    CXX = xlC_r
    CXXFLAGS = -q64 -g -qmaxmem=-1 -qarch=auto -D_THREAD_SAFE
    DEFS = -DHAVE_CONFIG_H
    LDFLAGS = -L/opt/apps/ots/lib -lm -L/opt/freeware/lib
    LIBS = -ltiff -ljasper -ljpeg -lpng -lXext -lSM -lICE -lX11 -lbz2 -lxml2 -lz -lm -lpthreads

     
  • Logged In: YES
    user_id=128624
    Originator: NO

    libxml2 is clearly the bad-boy here. In order to configure for libxml2, GraphicsMagick configure executes 'xml2-config' as found in the PATH. Even though you think that you removed /opt/freeware/bin from your PATH, it seems that xml2-config is getting picked up somehow. Make sure you do a 'which xml2-config' and see if it is found prior to executing 'configure'.

    Is it possible that your path is being reset to default via the actions of a '.' file similar to .profile or .bashrc?

    Since FreeType and libxml2 are quite useful, I recommend installing them under the same prefix where you are attempting to install GraphicsMagick. As long as your PATH is correct when GraphicsMagick is configured, you will then benefit from much more modern versions than whatever AIX offers via /opt/freeware.

     
  • TConrad
    TConrad
    2008-05-16

    Logged In: YES
    user_id=1885529
    Originator: YES

    Oh crap. 'which xml2-config' is telling me that xml2-config is in /usr/bin. I can't delete /usr/bin from PATH...everything will halt.

    Does configure search for FreeType and libxml2 (etc.) by first looking in the directories listed in PATH? What is the search sequence?

     
  • TConrad
    TConrad
    2008-05-21

    Logged In: YES
    user_id=1885529
    Originator: YES

    Okay, I compiled/installed FreeType2 and libxml2, then re-compiled GraphicsMagick without perl support and it worked fine. Thanks a million for your help.

    I hope you can help me out again---now I want to add perl support/compile PerlMagick. I get a strange error message when I try:
    --------------------------
    /opt/apps/ots/GraphicsMagick/PerlMagick> /usr/vacpp/bin/xlC -L/opt/apps/ots/GraphicsMagick/magick/.libs -brtl -b32 -bmaxdata:0x80000000 -bE:/usr/opt/perl5/lib/5.8.2/aix-thread-multi/CORE/perl.exp -o PerlMagick -O ./perlmain.o Magick.o blib/arch/auto/Graphics/Magick/Magick.a /usr/opt/perl5/lib/5.8.2/aix-thread-multi/auto/DynaLoader/DynaLoader.a /usr/opt/perl5/lib/5.8.2/aix-thread-multi/CORE/libperl.a `cat blib/arch/auto/Graphics/Magick/extralibs.all` -lbind -lnsl -ldl -lld -lm -lpthreads -lc_r -lcrypt -lbsd -lPW
    ld: 0706-020 The number 0x100000000 is too large for the -b pT option.
    Use a value that is 4294967295 (hex FFFFFFFF) or less.
    ld: 0706-020 The number 0x110000000 is too large for the -b pD option.
    Use a value that is 4294967295 (hex FFFFFFFF) or less.
    ---------------------------

    I thought this meant changing the value in compiler option -bmaxdata:0x80000000 but that did not work. Any suggestions?

    (I attached a log of what the make produced.)
    File Added: GM_make.out

     
1 2 > >> (Page 1 of 2)