Closed russss closed 8 years ago
Thanks for reporting.
OS X 10.11.2 pgmagick 0.6 GraphicsMagick 1.3.23 boost 1.59.0
build success on same environment. (install from homebrew and source)
$ brew untap hhatto/pgmagick
$ brew cleanup
$ brew tap hhatto/pgmagick
$ brew install pgmagick
I did try the homebrew tap but it failed with the same error (I don't really want to try it again because I currently have a working setup :).
Building again from a fresh checkout causes the same problem - but I have just noticed this:
$ python ./setup.py build
include header path: /usr/local/include/GraphicsMagick/
boost lib: boost_python-mt
library path: /usr/local/lib/libGraphicsMagick++
GraphicsMagick version: 1.3.20
...
setup.py
sees the graphicsmagick version as 1.3.20, but I'm fairly sure 1.3.23 is installed:
$ GraphicsMagick-config --version
1.3.23
$ GraphicsMagick++-config --version
1.3.23
$ pkg-config --modversion GraphicsMagick++
1.3.23
$ which GraphicsMagick-config
/usr/local/bin/GraphicsMagick-config
Further digging shows that it's getting the version from the .pc
file in an older version of graphicsmagick which is at /usr/local/Cellar/graphicsmagick/1.3.20
. The build process then tries to build against the currently-installed version, which is 1.3.23.
This is because of /usr/local/Cellar/graphicsmagick
being added to search_include_dirs
in setup.py. If there's more than one version of graphicsmagick installed it'll probably return the oldest version first, which seems wrong.
Not sure why that code is scanning the include dirs for .pc
files, or whether it's ever right to use a homebrew-installed version of graphicsmagick which isn't linked (homebrew will link the .pc
files to /usr/local/lib/pkgconfig/
).
I can work around this by changing line 128 of setup.py to search search_pkgconfig_dirs
before search_include_dirs
:
_version = get_version_from_pc(search_pkgconfig_dirs + search_include_dirs, GMCPP_PC)
After this change it builds successfully.
@russss unfortunately I couldn't reproduce/fix with your steps but I'm getting the same errors. What I've done to have a working environment was:
brew uninstall boost
brew uninstall boost-python
brew install homebrew/versions/boost155 --with-thread-unsafe --build-from-source --with-python
LDFLAGS="-L/usr/local/opt/boost155/lib" CFLAGS="-I/usr/local/opt/boost155/include" pip install pgmagick
Hope it helps until we have a fix.
I can work around this by changing line 128 of setup.py to search search_pkgconfig_dirs before search_include_dirs:
_version = get_version_from_pc(search_pkgconfig_dirs + search_include_dirs, GMCPP_PC)
After this change it builds successfully.
improved to pc file search logic. fix in afb317c6de459079d5c0877e1b59f4cbc01e8773 , and version 0.6.1 released.
OS X 10.11.2 pgmagick 0.6 GraphicsMagick 1.3.23 boost 1.59.0
Fails to build with this error:
I've worked around this by commenting out line 68 in _Image.cpp, as I don't need that method.