Compilation of Avogadro on Mac OS 10.6

Hi there,

I’m trying to compile Avogadro on Mac OS 10.6 and have so far succeeded in
generating an executable which can launch without crashing using gcc-4.2.1
and forcing 32 bit compilation with the appropriate C_FLAGS, CXX_FLAGS set
to “-m32”. This works - so far so good.

Although the “recommended” way of compiling Avogadro is the "superpackage"
way, I’ve never gotten around successfully compiling it using that method.
Instead, the traditional linux approach with compiling (and installing) the
following components

gcc
cmake (2.8.x)
Eigen
OpenBabel (trunk)
Qt (4.6.3)

followed by Avogadro (latest git snapshot) has shown to be the most
successful so far. My problem, and question is thus, that with the following
flags for cmake
cmake -DOPENBABEL2_INCLUDE_DIR=/Users/cstein/programs/include/openbabel-2.0
-DOPENBABEL2_LIBRARIES=/Users/cstein/programs/lib/libopenbabel.dylib
-DOPENBABEL2_VERSION_MET=true -DCMAKE_OSX_ARCHITECTURES:STRING=i386
-DCMAKE_OSX_SYSROOT:PATH=/Developer/SDKs/MacOSX10.6.sdk
-DENABLE_AVO_PACKAGE=true -DENABLE_VERSIONED_PLUGIN_DIR=false
-DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 …

followed by make and ultimately “sudo make install”, the openbabel files,
which are supposed to be located in:
BABEL_LIBDIR /Applications/Avogadro.app/Contents/MacOS/…/lib/openbabel
BABEL_DATADIR /Applications/Avogadro.app/Contents/MacOS/…/share/openbabel/

are not copied over to the Avogadro.app folder as intended. Instead, I can
make symbolic links or copy the files manually but I think this defeats the
purpose of cmake’s job. Unfortunately, my skills in cmake are horrible so I
have no clue where to look. Any pointers or a fix would be
greatly appreciated.

cheers,

Casper

I’m trying to compile Avogadro on Mac OS 10.6 and have so far succeeded in generating an executable which can launch without crashing using gcc-4.2.1 and forcing 32 bit compilation with the appropriate C_FLAGS, CXX_FLAGS set to “-m32”. This works - so far so good.

Huh? I compile pretty much all the time on my laptop with no issues. On the laptop, I also do not use the “superpackage” build.

cmake -DOPENBABEL2_INCLUDE_DIR=/Users/cstein/programs/include/openbabel-2.0 -DOPENBABEL2_LIBRARIES=/Users/cstein/programs/lib/libopenbabel.dylib -DOPENBABEL2_VERSION_MET=true -DCMAKE_OSX_ARCHITECTURES:STRING=i386 -DCMAKE_OSX_SYSROOT:PATH=/Developer/SDKs/MacOSX10.6.sdk -DENABLE_AVO_PACKAGE=true -DENABLE_VERSIONED_PLUGIN_DIR=false -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 …

Ok, no problem so far. (I typically install Open Babel into /usr/local so I don’t need the -DOPENBABEL… flags.)

followed by make and ultimately “sudo make install”, the openbabel files, which are supposed to be located in:
BABEL_LIBDIR /Applications/Avogadro.app/Contents/MacOS/…/lib/openbabel
BABEL_DATADIR /Applications/Avogadro.app/Contents/MacOS/…/share/openbabel/

You don’t need these. If you’ve built Open Babel correctly, the library has a compiled-in path to the plugins and data. On Mac, the path to libopenbabel should be similarly compiled into Avogadro.app.

In short, why are you worried about the BABEL_LIBDIR parts?

-Geoff