You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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.
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.
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).
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.
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.
Activity
mkoppanen commentedon Oct 13, 2013
Can you dump the value of:
?
Danack commentedon Oct 13, 2013
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.1which is the 32bit filename, but with the 64bit directory.Danack commentedon Oct 13, 2013
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
mkoppanen commentedon Oct 13, 2013
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.
mkoppanen commentedon Oct 13, 2013
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.
Danack commentedon Oct 13, 2013
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.
mkoppanen commentedon Oct 13, 2013
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).
Danack commentedon Oct 13, 2013
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.
mkoppanen commentedon Oct 14, 2013
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?
mkoppanen commentedon Oct 14, 2013
I just pushed some changes. Can you test the following on your machine:
Does that pick up the correct library names and paths?
Danack commentedon Oct 14, 2013
Pretty much.
Yep it does, though it gave an error on that exact spelling and asked for an absolute path, but:
worked just fine.
cheers
Dan
mkoppanen commentedon Oct 16, 2013
I guess the master is now in better shape regarding configuring. Closing this issue
Danack commentedon Oct 16, 2013
Yep good to close, though the setting should be mentioned in the install file, which doesn't seem to exist just yet.
Fix memory leak in Imagick::colorThresholdImage()
Fix memory leak in Imagick::colorThresholdImage()
Fix memory leak in polynomialImage()
Fix memory leak in colorMatrixImage()