Skip to content

Configuring issue on centos 64bit #8

Closed

Description

@Danack

Hi,

I can see that you're in the middle of editing the config file 667183c so this might be slightly redundant, but it seems that in version 3.1.2 the config isn't generated correctly for 64bit centos.

Basically the wrong libs are being used, the 32bit version names of MagickWand-6.Q16 and MagickCore-6.Q16 are used instead of MagickWand and MagickCore.

The error seems to be triggered by the line export PKG_CONFIG_PATH="$IMAGICK_MAGICK_PREFIX/lib/pkgconfig/"

With some debugging around that:

  DEBUG_LIBS=`/usr/bin/MagickWand-config --libs`
  AC_MSG_RESULT(libs before $DEBUG_LIBS)

  export PKG_CONFIG_PATH="$IMAGICK_MAGICK_PREFIX/lib/pkgconfig/"

  DEBUG_LIBS=`/usr/bin/MagickWand-config --libs`
  AC_MSG_RESULT(libs after $DEBUG_LIBS)

Outputs

libs before -lMagickWand -lMagickCore
libs after -lMagickWand-6.Q16 -lMagickCore-6.Q16

i.e. the export line is making imagemagick give the wrong data.

Activity

  1. mkoppanen commented on Oct 13, 2013

    @mkoppanen
    Collaborator

    Can you dump the value of:

     $PHP_LIBDIR
    

    ?

  2. Danack commented on Oct 13, 2013

    @Danack
    CollaboratorAuthor
    AC_MSG_RESULT(PHP_LIBDIR is $PHP_LIBDIR) 
    

    gives

    PHP_LIBDIR is lib

    To clarify - imagick is looking in the correct directories for the file, it's just using the 32bit names instead of the 64bit names.

    i.e. it's looking for /usr/lib64/libMagickWand-6.Q16.so.1 which is the 32bit filename, but with the 64bit directory.

  3. Danack commented on Oct 13, 2013

    @Danack
    CollaboratorAuthor

    I should have said, this is compiling against ImageMagick-6.8.7-0.tar.gz in this Centos Vagrant box
    http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-x86_64-v20130427.box

  4. mkoppanen commented on Oct 13, 2013

    @mkoppanen
    Collaborator

    The problem is that PKG_CONFIG_PATH includes "lib" instead of "lib64" which would probably contain the right library names. However, if $PHP_LIBDIR is "lib" that makes it somewhat hard to detect that actually /usr/lib64 should be used.

    As far as I understand /usr/lib64 is a just a convention chosen by some distributions (there are others like /usr/lib/64 etc) so not really sure how to approach this problems.

  5. mkoppanen commented on Oct 13, 2013

    @mkoppanen
    Collaborator

    Let me check if any of the available variables gives the correct and expected library directory. With the current master branch you should be able to do ./configure PKG_CONFIG_PATH="/usr/lib64/pkgconfig" to set the right path.

  6. Danack commented on Oct 13, 2013

    @Danack
    CollaboratorAuthor

    Thanks - setting PKG_CONFIG_PATH worked.

    Possibly a dumb question, but why do you export PKG_CONFIG_PATH during the normal configure process?

    Obviously you need to set it if the user has passed it in on the command line, but can't you just assume that it's set correctly by default, rather than always trying to set it? aka other pecl packages don't seem to set it.

  7. mkoppanen commented on Oct 13, 2013

    @mkoppanen
    Collaborator

    Well, first of all most PECL extensions don't use pkgconfig to get the flags. Magickwand-Config is a thin shell wrapper for pkg-config. Therefore if you have imagemagick installed to non-standard location PKG_CONFIG_PATH needs to be set to find the libs and flags (--with-imagick=/path/to sets it).

  8. Danack commented on Oct 13, 2013

    @Danack
    CollaboratorAuthor

    if you have imagemagick installed to non-standard location PKG_CONFIG_PATH needs to be set to find the libs and flags (--with-imagick=/path/to sets it).

    Yeah - that's what I don't understand.

    I have imagemagick installed to it's default location, and am not setting --with-imagick. The script already finds the wand-config in one of the default places it's looking for it, so why does PKG_CONFIG_PATH need to be set, when it's neither passed in explicitly nor implicitly through --with-imagick.

  9. mkoppanen commented on Oct 14, 2013

    @mkoppanen
    Collaborator

    I think I remember why that was added. The Magickwand-Config program is search from these paths: for i in /usr/local /usr /opt /opt/local. This isn't necessarily the same as pkg-config search path and calling pkg-config foo --cflags without explicitly setting PKG_CONFIG_PATH might pick up the library from different directory from where Magickwand-Config was found. This might cause confusion when configure says "found in X" but cflags are actually picked up from different location.

    Makes sense?

  10. mkoppanen commented on Oct 14, 2013

    @mkoppanen
    Collaborator

    I just pushed some changes. Can you test the following on your machine:

    phpize
    ./configure --libdir=lib64
    make
    

    Does that pick up the correct library names and paths?

  11. Danack commented on Oct 14, 2013

    @Danack
    CollaboratorAuthor

    Makes sense?

    Pretty much.

    Does that pick up the correct library names and paths?

    Yep it does, though it gave an error on that exact spelling and asked for an absolute path, but:

    /bin/bash ./configure --with-php-config=/usr/local/bin/php-config --libdir=/usr/lib64

    worked just fine.

    cheers
    Dan

  12. mkoppanen commented on Oct 16, 2013

    @mkoppanen
    Collaborator

    I guess the master is now in better shape regarding configuring. Closing this issue

  13. Danack commented on Oct 16, 2013

    @Danack
    CollaboratorAuthor

    Yep good to close, though the setting should be mentioned in the install file, which doesn't seem to exist just yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions