Page 1 of 1

Trying to build Magick++ on AIX

Posted: 2009-06-22T10:58:10-07:00
by alchemist
Hi,

I need some help with building Magick++ library on AIX 6.1.

Code: Select all

myhost:/home/alchy/ImageMagick-6.5.3-7 # uname -a
AIX myhost 1 6 00CB25304C00
Here is my configuration script:

Code: Select all

./configure \
  --disable-installed \
  --disable-shared \
  --disable-largefile \
  --without-threads \
  --without-modules \
  --without-perl \
  --without-dps \
  --without-jbig \
  --without-lcms \
  --without-xml \
  --without-x \
  --without-gslib \
  --without-freetype \
  CXX='xlC' \
  CXXFLAGS='-q64 -qsrcmsg -qflag=w:e -qlanglvl=newexcp' \
  CPPFLAGS='-I/path/to/jpeg-6b -I/path/to/zlib -I/path/to/bzip2 -I/path/to/tiff/libtiff' \
  LDFLAGS='-q64 -L/path/to/jpeg-6b -L/path/to/zlib -L/path/to/bzip2 -L/path/to/tiff/libtiff/.libs' \
  CC='xlc' \
  CFLAGS='-q64 -qsrcmsg -qflag=w:e -qlanglvl=newexcp' \
  AR_FLAGS='-v -q -X64'
I don't need any support except jpeg and tiff, no threads, no installation, no truetype fonts, static libs.
Output from ./configure :

Code: Select all

Host system type: powerpc-ibm-aix6.1.0.0
Build system type: powerpc-ibm-aix6.1.0.0

                  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=no              no
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
DJVU              --with-djvu=yes               no
DPS               --with-dps=no         no
FlashPIX          --with-fpx=yes                no
FontConfig        --with-fontconfig=no          no
FreeType          --with-freetype=no           no
GhostPCL          None                          pcl6 (unknown)
GhostXPS          None                          gxps (unknown)
Ghostscript       None                          gs (unknown)
Ghostscript fonts --with-gs-font-dir=default    none
Ghostscript lib   --with-gslib=no               no
Graphviz          --with-gvc=yes                no
JBIG              --with-jbig=no                no
JPEG v1           --with-jpeg=yes               yes
JPEG-2000         --with-jp2=yes                no
LCMS              --with-lcms=no                no
LQR               --with-lqr=yes                no
Magick++          --with-magick-plus-plus=yes   yes
OpenEXR           --with-openexr=yes            no
PERL              --with-perl=no                no
PNG               --with-png=yes                no
RSVG              --with-rsvg=no                no
TIFF              --with-tiff=yes               yes
Windows fonts     --with-windows-font-dir=      none
WMF               --with-wmf=no         no
X11               --with-x=no                   no
XML               --with-xml=no         no
ZLIB              --with-zlib=yes               yes

X11 Configuration:
      X_CFLAGS        = 
      X_PRE_LIBS      = 
      X_LIBS          = 
      X_EXTRA_LIBS    = 

Options used to compile and link:
  PREFIX          = /usr/local
  EXEC-PREFIX     = /usr/local
  VERSION         = 6.5.3
  CC              = xlc
  CFLAGS          = -q64 -qsrcmsg -qflag=w:e -qlanglvl=newexcp
  MAGICK_CFLAGS   = -q64 -qsrcmsg -qflag=w:e -qlanglvl=newexcp
  CPPFLAGS        = -I/usr/local/include/ImageMagick
  PCFLAGS         = 
  DEFS            = -DHAVE_CONFIG_H
  LDFLAGS         = -q64 -L/path/to/jpeg-6b -L/path/to/zlib -L/path/to/bzip2 -L/path/to/tiff/libtiff/.libs
  MAGICK_LDFLAGS  = -L/usr/local/lib -q64 -L/path/to/jpeg-6b -L/path/to/zlib -L/path/to/bzip2 -L/path/to/tiff/libtiff/.libs
  LIBS            = -lMagickCore -ltiff -ljpeg -lbz2 -lz -lm 
  CXX             = xlC
  CXXFLAGS        = -q64 -qsrcmsg -qflag=w:e -qlanglvl=newexcp
So everything seems to be ok till now.
But I got this error after running make:

Code: Select all

...
...
        source='magick/annotate.c' object='magick/magick_libMagickCore_la-annotate.lo' libtool=yes \
        DEPDIR=.deps depmode=aix /bin/sh ./config/depcomp \
        /bin/sh ./libtool --silent  --tag=CC   --mode=compile xlc -DHAVE_CONFIG_H -I. -I./config  -I./ltdl -I./ltdl  -I/path/to/jpeg-6b -I/path/to/zlib -I/path/to/bzip2 -I/path/to/tiff/libtiff  -q64 -qsrcmsg -qflag=w:e -qlanglvl=newexcp -c -o magick/magick_libMagickCore_la-annotate.lo `test -f 'magick/annotate.c' || echo './'`magick/annotate.c
       78 | #  include <ft2build.h>
            ...........a...........
a - 1506-296 (S) #include file <ft2build.h> not found.
       83 | #  include <freetype/freetype.h>
            ...........a....................
a - 1506-296 (S) #include file <freetype/freetype.h> not found.
       88 | #  include <freetype/ftglyph.h>
            ...........a...................
a - 1506-296 (S) #include file <freetype/ftglyph.h> not found.
       93 | #  include <freetype/ftoutln.h>
            ...........a...................
a - 1506-296 (S) #include file <freetype/ftoutln.h> not found.
       98 | #  include <freetype/ftbbox.h>
            ...........a..................
a - 1506-296 (S) #include file <freetype/ftbbox.h> not found.
...
...
What is wrong? Why it includes all these headers even if it is switched off with configure parameter --without-freetype?
It seems that configure script does not re-generates config headers.
I found this line in magick/magick-config.h :

Code: Select all

#define MAGICKCORE_FREETYPE_DELEGATE  1

Re: Trying to build Magick++ on AIX

Posted: 2009-06-22T11:43:06-07:00
by magick
The build is picking up a magick-config.h file that includes a define for MAGICKCORE_FREETYPE_DELEGATE. Its possible that you have more than one these files on your system. Check carefully and make sure you undef MAGICKCORE_FREETYPE_DELEGATE.

Re: Trying to build Magick++ on AIX

Posted: 2009-06-22T12:04:55-07:00
by alchemist
I'm sure that it picks up magick-config.h from correct location (/path_to_ImageMagick_source/magick directory), but this header file doesn't match configuration output.
It doesn't change if I run configure with different arguments.

Re: Trying to build Magick++ on AIX

Posted: 2009-06-22T12:09:30-07:00
by magick
Check the dates on the file to see if its being modified when the configure script is run. You can also check file permissions and config.log to verify. If the FreeType delegate library is not found, the magick/magick-config.h file should be created and MAGICKCORE_FREETYPE_DELEGATE should not be defined.

Re: Trying to build Magick++ on AIX

Posted: 2009-06-23T07:28:09-07:00
by alchemist
Probably there is some problem in config.status script.
Here is output from config.status:

Code: Select all

config.status: creating config/configure.xml
config.status: creating config/delegates.xml
config.status: creating config/ImageMagick.rdf
config.status: creating config/MagickCore.dox
config.status: creating config/MagickWand.dox
config.status: creating config/type-ghostscript.xml
config.status: creating config/type-windows.xml
config.status: creating config/type.xml
config.status: creating ImageMagick.spec
config.status: creating Magick++/bin/Magick++-config
config.status: creating magick/ImageMagick.pc
config.status: creating Magick++/lib/ImageMagick++.pc
config.status: creating Magick++/lib/Magick++.pc
config.status: creating magick/Magick-config
config.status: creating magick/MagickCore-config
config.status: creating magick/MagickCore.pc
config.status: creating magick/version.h
config.status: creating Makefile
config.status: creating PerlMagick/Magick.pm
config.status: creating PerlMagick/Makefile.PL
config.status: creating PerlMagick/check.sh
config.status: creating utilities/animate.1
config.status: creating utilities/compare.1
config.status: creating utilities/composite.1
config.status: creating utilities/conjure.1
config.status: creating utilities/convert.1
config.status: creating utilities/display.1
config.status: creating utilities/identify.1
config.status: creating utilities/ImageMagick.1
config.status: creating utilities/import.1
config.status: creating utilities/mogrify.1
config.status: creating utilities/montage.1
config.status: creating utilities/stream.1
config.status: creating wand/MagickWand-config
config.status: creating wand/MagickWand.pc
config.status: creating wand/Wand-config
config.status: creating wand/Wand.pc
config.status: creating config/config.h
config.status: config/config.h is unchanged
config.status: executing magick/magick-config.h commands
config.status: creating x - prefix MAGICKCORE for config/config.h defines
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing MagickCore-config.in commands
config.status: executing Magick-config.in commands
config.status: executing MagickWand-config.in commands
config.status: executing Wand-config.in commands
config.status: executing Magick++-config.in commands
config.status: executing PerlMagick/check.sh.in commands
It is creating file "x" instead "magick/magick-config.h".
I try to add some debug echos:

Code: Select all

....
  case $ac_file$ac_mode in
    "magick/magick-config.h":C)
DEBUG_ECHO=echo
$DEBUG_ECHO "I-------- generating magick-config.h"
ac_prefix_conf_OUT=`echo magick/magick-config.h`
$DEBUG_ECHO "OUT:$ac_prefix_conf_OUT"
ac_prefix_conf_DEF=`echo _$ac_prefix_conf_OUT | sed -e "y:abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:" -e "s/[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g"`
$DEBUG_ECHO "DEF:$ac_prefix_conf_DEF"
ac_prefix_conf_PKG=`echo MagickCore`
$DEBUG_ECHO "PKG:'$ac_prefix_conf_PKG'"
ac_prefix_conf_LOW=`echo _$ac_prefix_conf_PKG | sed -e "y:ABCDEFGHIJKLMNOPQRSTUVWXYZ-:abcdefghijklmnopqrstuvwxyz_:"`
$DEBUG_ECHO "LOW:'$ac_prefix_conf_LOW'"
ac_prefix_conf_UPP=`echo $ac_prefix_conf_PKG | sed -e "y:abcdefghijklmnopqrstuvwxyz-:ABCDEFGHIJKLMNOPQRSTUVWXYZ_:"  -e "/^[0123456789]/s/^/_/"`
$DEBUG_ECHO "UPP:'$ac_prefix_conf_UPP'"
ac_prefix_conf_INP=`echo "" | sed -e 's/ *//'`
$DEBUG_ECHO "INP:'$ac_prefix_conf_INP'"
if test ".$ac_prefix_conf_INP" = "."; then
   for ac_file in : $CONFIG_HEADERS; do test "_$ac_file" = _: && continue
     case "$ac_file" in
....
and here is result:

Code: Select all

I-------- generating magick-config.h
OUT:x
DEF:_X
PKG:'MagickCore'
LOW:'_magickcore'
UPP:'MAGICKCORE'
INP:''
If I add this line before setting ac_prefix_conf_OUT variable:

Code: Select all

echo `echo magick/magick-config.h`
it prints "x" to stdout and next variables are ok:

Code: Select all

I-------- generating magick-config.h
x
OUT:magick/magick-config.h
DEF:_MAGICK_MAGICK_CONFIG_H
PKG:'MagickCore'
LOW:'_magickcore'
UPP:'MAGICKCORE'
INP:''

Re: Trying to build Magick++ on AIX

Posted: 2009-06-23T07:39:07-07:00
by magick
ImageMagick utilizes the GNU autoconf / automake / libtool build tools and perhaps there is a bug. You can post a bug report to the tools autoconf developers otherwise we will update the ImageMagick build scripts just as soon as a bug patch update is released for autoconf.

Re: Trying to build Magick++ on AIX

Posted: 2009-06-23T10:42:42-07:00
by alchemist
Ok, I got it - seems to be a bug in our version of Korn shell.
Thanks for your time

Re: Trying to build Magick++ on AIX

Posted: 2009-06-23T11:42:31-07:00
by alchemist
So one of solutions is creating a kind of pre-configure script that replaces all occurrences of /bin/sh with /path/to/another/shell (recursively in IM directory ofcourse :)
But configure option "SHELL=/path/to/another/shell" does enough.

Re: Trying to build Magick++ on AIX

Posted: 2009-07-02T04:27:01-07:00
by alchemist
I posted bugreport to autoconf and patch is now available.

bug-autoconf mailing list thread
commitdiff