Problem building avogadro since switch to OpenBabel 2.2

Hello!

I’ve just tried rebuilding Avogadro as it sounds like a lot of
interesting new stuff has gone into over the past few weeks that I’d
like to try out.

I’m using the trunk version of openbabel
(https://openbabel.svn.sourceforge.net/svnroot/openbabel/openbabel/trunk)
and have updated this to revision 2167 and have updated my version of
Avogadro to revision 917.

I’m running cmake as follows:

cmake --debug-output
-DOPENBABEL2_INCLUDE_DIR=/openbabel/include
-DOPENBABEL2_LIBRARIES=/openbabel/src/.libs/libopenbabel.so
-DEIGEN_INCLUDE_DIR=/eigen/src
-DOPENBABEL2_EXECUTABLE:FILEPATH=/openbabel/tools/babel

This now fails with:
CMake Error: Error in cmake code at
/avogadro/cmake/modules/FindOpenBabel2.cmake:77:
MESSAGE Could NOT find OpenBabel 2.2 or later
Current CMake stack:

I assume I’m running with openbabel 2.2 as I’m using the trunk version,
but the library that’s built in openbabel/src/.libs is libopenbabel.so.2.1.1

Am I running with the wrong version of openbabel or is there something
else I’m doing wrong?

Many thanks,

Jens

Jens Thomas, email: j.m.h.thomas@dl.ac.uk
STFC Daresbury Lab, tel: +44-1925-603849
Warrington, fax: +44-1925-603634
WA4 4AD, UK. http: http://www.cse.scitech.ac.uk

Hi Jens,

MESSAGE Could NOT find OpenBabel 2.2 or later
Current CMake stack:

I assume I’m running with openbabel 2.2 as I’m using the trunk
version,
but the library that’s built in openbabel/src/.libs is
libopenbabel.so.2.1.1

The library version number doesn’t have anything to do with the Open
Babel release number. (In this case, there was a lucky coincidence,
but it won’t continue.)

First off, did you run “make install” for Open Babel from trunk? This
could be one of your problems.

But I do know that the CMake script needs a bit of work. Right now, it
fails if pkg-config isn’t installed. (This could also be your
problem.) I’d like to do a test using “babel” in the path to get the
version number if pkg-config can’t be found.

So I’d check if you’ve installed the trunk version of babel and I’d
install pkg-config if you don’t have it right now.

Cheers,
-Geoff

This is a problem. The CMAKE FindOpenBabel2.cmake file got updated to
test for a minimum version and when you statically define those
parameters it gets screwed up.

As a temporary fix, add ‘-DOPENBABEL_MINI_FOUND=true’ to your cmake
command. I’ll fix the script as soon as possible.

(Wed, Dec 05, 2007 at 04:01:52PM +0000) Jens Thomas j.m.h.thomas@dl.ac.uk:

Hello!

I’ve just tried rebuilding Avogadro as it sounds like a lot of
interesting new stuff has gone into over the past few weeks that I’d
like to try out.

I’m using the trunk version of openbabel
(https://openbabel.svn.sourceforge.net/svnroot/openbabel/openbabel/trunk)
and have updated this to revision 2167 and have updated my version of
Avogadro to revision 917.

I’m running cmake as follows:

cmake --debug-output
-DOPENBABEL2_INCLUDE_DIR=/openbabel/include
-DOPENBABEL2_LIBRARIES=/openbabel/src/.libs/libopenbabel.so
-DEIGEN_INCLUDE_DIR=/eigen/src
-DOPENBABEL2_EXECUTABLE:FILEPATH=/openbabel/tools/babel

This now fails with:
CMake Error: Error in cmake code at
/avogadro/cmake/modules/FindOpenBabel2.cmake:77:
MESSAGE Could NOT find OpenBabel 2.2 or later
Current CMake stack:

I assume I’m running with openbabel 2.2 as I’m using the trunk version,
but the library that’s built in openbabel/src/.libs is libopenbabel.so.2.1.1

Am I running with the wrong version of openbabel or is there something
else I’m doing wrong?

Many thanks,

Jens

Jens Thomas, email: j.m.h.thomas@dl.ac.uk
STFC Daresbury Lab, tel: +44-1925-603849
Warrington, fax: +44-1925-603634
WA4 4AD, UK. http: http://www.cse.scitech.ac.uk


SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4


Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avogadro-devel

Hi Geoff,

Thanks for getting back to me.

Geoffrey Hutchison wrote:

First off, did you run “make install” for Open Babel from trunk? This
could be one of your problems.

But I do know that the CMake script needs a bit of work. Right now, it
fails if pkg-config isn’t installed. (This could also be your
problem.) I’d like to do a test using “babel” in the path to get the
version number if pkg-config can’t be found.

So I’d check if you’ve installed the trunk version of babel and I’d
install pkg-config if you don’t have it right now.
Currently I’m trying to keep everything in a sandbox as I’d like to get
up to speed enough to do some development and therefore want to have svn
versions of openbabel and avogadro that I can meddle with without having
to install anything.

I must be misreading your email though, as it sounds like your saying
that I need to install openbabel into the system for this to work?

However, following stuff from other messages on the list I was able to
get the configure to work by setting -DOPENBABEL_MINI_FOUND:BOOL=TRUE
when I ran cmake (this is as well as the -DOPENBABEL2_INCLUDE_DIR and
-DOPENBABEL2_LIBRARIES macros).

To get the build to work after the configure (again following the
instructions on the wiki, so I’m doing the build in a separate directory
to the source), I had to edit the files glwidget.cpp and
painterengine.cpp to change the includes at the top of the files as, for
(e.g. painterengine.cpp), they are:

#include <avogadro/sphere.h>
#include <avogadro/cylinder.h>
#include <avogadro/textrenderer.h>
#include <avogadro/glwidget.h>

but I needed to change them to:

#include “sphere.h”
#include “cylinder.h”
#include “textrenderer.h”
#include “glwidget.h”

to get it to compile.

I can now get avogardo to work (and I must say that I really do like the
new layout that you guys have come up with), but I’m hitting problems
trying to use the AutoOptimization tool.

I’m using the following script to start avogadro and point it at the
files it needs:

export AVOGADRO_ENGINES=/avogadro/build/libavogadro/src/engines
export AVOGADRO_TOOLS=/avogadro/build/libavogadro/src/tools
export AVOGADRO_EXTENSIONS=/avogadro/build/avogadro/src/extensions
export
BABEL_LIBDIR=/openbabel/src/formats/.libs:/c/ccg/share/software/avogadro/openbabel/src/formats/xml/.libs
export LD_PRELOAD=/openbabel/src/.libs/libopenbabel.so.2

/avogadro/build/avogadro/src/avogadro

but, if I try to use the UFF optimiser it complains:

==============================
*** Open Babel Error in ParseParamFile
Cannot open UFF.prm

size=0

==============================
*** Open Babel Error in SetTypes
Cannot open UFF.prm
GhemicalCommand: Could not set up force field on
Avogadro::Molecule(0x82f8908)

UFF.prm is sat in: /openbabel/data/

so is there some additional environment variable I need to set for
thisto be found?

If this isn’t the way that I should be running, then I’d appreciate any
tips on how you guys work when you’re developing the code and making
changes to both avogadro and openbabel.

Best wishes,

Jens

I must be misreading your email though, as it sounds like your
saying that I need to install openbabel into the system for this to
work?

I never said install into the system. I just said it’s easier if you
run “make install.” If you’re nervous about the system, you can always
build and install into a separate directory. For example:

Open Babel

./configure --prefix=/tmp/openbabel-2.2/
make -j2
make install

To get the build to work after the configure (again following the
instructions on the wiki, so I’m doing the build in a separate
directory to the source), I had to edit the files glwidget.cpp and
painterengine.cpp to change the includes at the top of the files as,
for (e.g. painterengine.cpp), they are:

Aha. That’s certainly how we’ve set up the Cmake scripts. That’s good
to know – but were the rest of the files OK? (i.e., did you only need
to edit those two?)

export BABEL_LIBDIR=/openbabel/src/formats/.libs:/c/ccg/share/
software/avogadro/openbabel/src/formats/xml/.libs
export LD_PRELOAD=/openbabel/src/.libs/libopenbabel.so.2

UFF.prm is sat in: /openbabel/data/

export BABEL_DATADIR=/openbabel/data

Cheers,
-Geoff