Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuring issue on centos 64bit #8

Closed
Danack opened this issue Oct 13, 2013 · 13 comments
Closed

Configuring issue on centos 64bit #8

Danack opened this issue Oct 13, 2013 · 13 comments

Comments

@Danack
Copy link
Collaborator

Danack commented Oct 13, 2013

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.

@mkoppanen
Copy link
Collaborator

Can you dump the value of:

 $PHP_LIBDIR

?

@Danack
Copy link
Collaborator Author

Danack commented Oct 13, 2013

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.

@Danack
Copy link
Collaborator Author

Danack commented 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
Copy link
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.

@mkoppanen
Copy link
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.

@Danack
Copy link
Collaborator Author

Danack commented 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
Copy link
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).

@Danack
Copy link
Collaborator Author

Danack commented Oct 13, 2013

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.

@mkoppanen
Copy link
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?

@mkoppanen
Copy link
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?

@Danack
Copy link
Collaborator Author

Danack commented Oct 14, 2013

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

@mkoppanen
Copy link
Collaborator

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

@Danack
Copy link
Collaborator Author

Danack commented 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants