Fwd: Compiling Avogadro on MacOS X 10.5

Dear Martin,

First off – where is libopenbabel? I understand babel is in your path, but Avogadro needs to find the library itself.

Secondly, you mention problems with SIP. What version of SIP are you using?

Others may have ideas about compile with the Python bindings – I know that SIP, PyQt, and Boost all updated more recently than Avogadro, so we may need to try out the latest versions.

Best regards,
-Geoff

Begin forwarded message:

From: Martin Hediger ma.hed@bluewin.ch
Date: November 29, 2009 6:47:08 AM EST
To: Geoffrey Hutchison geoff.hutchison@gmail.com
Subject: Re: [Avogadro-devel] Compiling Avogadro on MacOS X 10.5

Dear Geoff,

so far, i could track the problem down to this:
short version: the problem was that openbabel could not be found

mzh @ ~/build/avogadro $ cmake ~/src/avogadro/
– The C compiler identification is GNU
– The CXX compiler identification is GNU
– Check for working C compiler: /usr/bin/gcc
– Check for working C compiler: /usr/bin/gcc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working CXX compiler: /usr/bin/c++
– Check for working CXX compiler: /usr/bin/c++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– The build type is RelWithDebInfo
– Performing Test HAVE_GCC_VISIBILITY
– Performing Test HAVE_GCC_VISIBILITY - Success
– Performing Test COMPILES_WITHOUT_FPERMISSIVE
– Performing Test COMPILES_WITHOUT_FPERMISSIVE - Success
– Looking for Q_WS_X11
– Looking for Q_WS_X11 - not found.
– Looking for Q_WS_WIN
– Looking for Q_WS_WIN - not found.
– Looking for Q_WS_QWS
– Looking for Q_WS_QWS - not found.
– Looking for Q_WS_MAC
– Looking for Q_WS_MAC - found
– Looking for QT_MAC_USE_COCOA
– Looking for QT_MAC_USE_COCOA - found
– Found Qt-Version 4.5.3
– Found OpenSSL: /usr/lib/libssl.dylib
– Found lupdate: /usr/bin/lupdate
– Found lrelease: /usr/bin/lrelease
– Found lconvert: /usr/bin/lconvert
– Found Eigen2: /usr/local/include/eigen2
– Found ZLIB: /usr/lib/libz.dylib
– checking for module ‘openbabel-2.0>=2.2.2’
– package ‘openbabel-2.0>=2.2.2’ not found
CMake Error at cmake/modules/FindOpenBabel2.cmake:76 (message):
Could NOT find OpenBabel 2.2 or later.
Call Stack (most recent call first):
CMakeLists.txt:130 (find_package)

– Configuring incomplete, errors occurred!

I really cant understand why it does not.

mzh @ ~/build/avogadro babel No output file or format spec! Open Babel 2.2.3 -- Nov 28 2009 -- 11:27:52 Usage: babel [-i<input-type>] <name> [-o<output-type>] <name> Try -H option for more information. mzh @ ~/build/avogadro

I’ll just provide it myself.

mzh @ ~/build/avogadro $ cmake
-DOPENBABEL2_INCLUDE_DIR=~/src/openbabel-2.2/include
-DOPENBABEL2_VERSION_MET=true
-DOPENBABEL2_LIBRARIES=/usr/local/lib/libopenbabel.dylib ~/src/avogadro/
– The build type is RelWithDebInfo
– Found lupdate: /usr/bin/lupdate
– Found lrelease: /usr/bin/lrelease
– Found lconvert: /usr/bin/lconvert
– Found OpenBabel2 executable: /usr/local/bin/babel
– Git revision found to be d70cc9d
– Found Git revision is: d70cc9d
– Building development version from Git clone.
– Searching for python dependencies…
– [1/5] Boost Python
– Boost version: 1.41.0
– Found the following Boost libraries:
– python
– Boost Python found…
– [2/5] Python Libraries
– Found PythonLibs: -framework Python
– [3/5] Python Interpreter
– Found PythonInterp: /usr/bin/python2.5
– [4/5] Numpy Module
– Numpy headers found
– [5/5] SIP Module
– Found sip.h header…
– All python dependencies found - Python support enabled
– Threaded OpenGL rendering not enabled
– RPath support enabled for installed binaries and libraries
– Setting new boost python libraries
– Enabled python terminal
– Python site-packages directory: /Library/Python/2.5/site-packages
– docbook tools not found, doc targets disabled
– Configuring done
– Generating done
– Build files have been written to: /Users/mzh/build/avogadro

sounded like good news to me.

mzh @ ~/build/avogadro $ make -j2
[ 2%] [ 2%] Generating animation.moc
Generating qrc_pythontool.cxx

[ 58%] Generating ui_pythonterminalwidget.h
[ 58%] Generating moc_pythonterminal.cxx
[ 58%] Generating moc_highlighter.cxx
Scanning dependencies of target pythonterminal
[ 58%] Building CXX object
libavogadro/src/extensions/CMakeFiles/propextension.dir/propextension.cpp.o
[ 58%] Building CXX object
libavogadro/src/extensions/CMakeFiles/pythonterminal.dir/pythonterminal.cpp.o
[ 58%] Building CXX object
libavogadro/src/extensions/CMakeFiles/propextension.dir/__/tools/moc_skeletontree.cxx.o
[ 58%] Building CXX object
libavogadro/src/extensions/CMakeFiles/propextension.dir/moc_propmodel.cxx.o
[ 58%] Building CXX object
libavogadro/src/extensions/CMakeFiles/pythonterminal.dir/highlighter.cpp.o
[ 59%] Building CXX object
libavogadro/src/extensions/CMakeFiles/propextension.dir/moc_propextension.cxx.o
[ 60%] Building CXX object
libavogadro/src/extensions/CMakeFiles/pythonterminal.dir/moc_pythonterminal.cxx.o
Linking CXX shared module …/…/…/lib/propextension.so
[ 60%] Built target propextension
[ 60%] Building CXX object
libavogadro/src/extensions/CMakeFiles/pythonterminal.dir/moc_highlighter.cxx.o
[ 60%] Generating moc_selectextension.cxx
Scanning dependencies of target selectextension
[ 60%] Building CXX object
libavogadro/src/extensions/CMakeFiles/selectextension.dir/selectextension.cpp.o
Linking CXX shared module …/…/…/lib/pythonterminal.so
[ 60%] Built target pythonterminal

[100%] Building CXX object
libavogadro/src/python/CMakeFiles/python-module.dir/std_vector.cpp.o
/Users/mzh/src/avogadro/libavogadro/src/python/sip.cpp: In static member
function ‘static PyObject*
QClass_converters::QClass_to_PyQt::convert(const T&)’:
/Users/mzh/src/avogadro/libavogadro/src/python/sip.cpp:143: error:
‘const struct sipAPIDef’ has no member named ‘api_convert_from_instance’

/Users/mzh/src/avogadro/libavogadro/src/python/sip.cpp:430:
instantiated from here
/Users/mzh/src/avogadro/libavogadro/src/python/sip.cpp:130: warning:
unused parameter ‘object’
make[2]: ***
[libavogadro/src/python/CMakeFiles/python-module.dir/sip.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs…
make[1]: *** [libavogadro/src/python/CMakeFiles/python-module.dir/all]
Error 2
make: *** [all] Error 2

I cant tell for sure, but is this a compiler error?

So if you have any ideas what might be wrong in sip.cpp:143, please let
me know. It would be highly appreciated, since I have absolutly now idea
of how SIP works.

Anyway, I also tried to install it

mzh @ ~/build/avogadro $ sudo make install
Password:
[ 19%] Built target avogadro

[ 60%] Built target pythonterminal

[ 77%] Built target residuecolor
[ 77%] Building CXX object
libavogadro/src/python/CMakeFiles/python-module.dir/sip.cpp.o
/Users/mzh/src/avogadro/libavogadro/src/python/sip.cpp: In static member
function ‘static PyObject*
QClass_converters::QClass_to_PyQt::convert(const T&)’:
/Users/mzh/src/avogadro/libavogadro/src/python/sip.cpp:143: error:
‘const struct sipAPIDef’ has no member named ‘api_convert_from_instance’

/Users/mzh/src/avogadro/libavogadro/src/python/sip.cpp:217:
instantiated from ‘QClass_converters::QClass_converters() [with T =
QActionGroup]’
/Users/mzh/src/avogadro/libavogadro/src/python/sip.cpp:430:
instantiated from here
/Users/mzh/src/avogadro/libavogadro/src/python/sip.cpp:130: warning:
unused parameter ‘object’
make[2]: ***
[libavogadro/src/python/CMakeFiles/python-module.dir/sip.cpp.o] Error 1
make[1]: *** [libavogadro/src/python/CMakeFiles/python-module.dir/all]
Error 2
make: *** [all] Error 2

now i really have no clue. as i said, if I -DENABLE_PYTHON=false, i can
install the release version with no problems.

The next thing I’ll do is to probably try to downgrade to a pre-release
version of the source code and see if the same problems occure there.

Martin