Compiling PythonMagick with MacPorts python, imagemagick, boost?

Ryan Schmidt ryandesign at macports.org
Wed Dec 8 11:54:38 PST 2010


On Dec 5, 2010, at 21:27, Leonard Lin wrote:

> I'm having some problems trying to compile the PythonMagick
> (http://www.imagemagick.org/download/python/) ImageMagick/Magick++
> bindings and was hoping to get some help.
> 
> It seems to have problems finding the boost python .hpp files even
> though they are in /opt/local/include (i.e.
> /opt/local/include/boost/python/module.hpp)

[snip]

> configure:14627: checking for boostlib >= 1.20.0
> configure:14681: g++ -c -g -O2  -I/opt/local/include conftest.cpp >&5
> configure:14681: $? = 0
> configure:14683: result: yes
> 
> ...
> 
> configure:14932: result:   results of the Python check:
> configure:14934: result:     Binary:      python
> configure:14936: result:     Library:     python
> configure:14938: result:     Include Dir: no
> configure:14950: checking whether the Boost::Python library is available
> configure:14980: g++ -c -g -O2  conftest.cpp >&5
> conftest.cpp:23:36: error: boost/python/module.hpp: No such file or
> directory

Here, -I/opt/local/include is clearly missing from the compile line; try adding -I/opt/local/include to your CPPFLAGS. I expect you'll also want -L/opt/local/lib in the LDFLAGS.


> Making all in pythonmagick_src
> /bin/sh ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I.
> -I../config    -I -I/opt/local/include -fopenmp
> -I/opt/local/include/ImageMagick   -g -O2 -DBOOST_PYTHON_DYNAMIC_LIB -MT
> libpymagick_la-_DrawableFillRule.lo -MD -MP -MF
> .deps/libpymagick_la-_DrawableFillRule.Tpo -c -o
> libpymagick_la-_DrawableFillRule.lo `test -f '_DrawableFillRule.cpp' ||
> echo './'`_DrawableFillRule.cpp
> libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../config -I
> -I/opt/local/include -fopenmp -I/opt/local/include/ImageMagick -g -O2
> -DBOOST_PYTHON_DYNAMIC_LIB -MT libpymagick_la-_DrawableFillRule.lo -MD
> -MP -MF .deps/libpymagick_la-_DrawableFillRule.Tpo -c
> _DrawableFillRule.cpp  -fno-common -DPIC -o
> .libs/libpymagick_la-_DrawableFillRule.o
> _DrawableFillRule.cpp:3:28: error: boost/python.hpp: No such file or
> directory

Here, -I/opt/local/include is in the compile line, so I don't see why it can't find it.





More information about the macports-users mailing list