Cmake trouble compiling

Greetings, all!
I’m having a similar error using cmake:

$ cmake -DOPENBABEL2_INCLUDE_DIR=$HOME/local/src/openbabel-2.2/include
-DOPENBABEL2_LIBRARIES=$HOME/local/src/openbabel-2.2/src/.libs/libopenbabel.so
-DOPENBABEL2_VERSION_MET=true $HOME/local/src/avogadro
– The build type is RelWithDebInfo
– Found lupdate: /usr/bin/lupdate-qt4
– Found lrelease: /usr/bin/lrelease-qt4
– Found lconvert: /usr/bin/lconvert
CMake Error at cmake/modules/MacroEnsureVersion.cmake:95
(NORMALIZE_VERSION):
NORMALIZE_VERSION Macro invoked with incorrect arguments for macro named:
NORMALIZE_VERSION
Call Stack (most recent call first):
cmake/modules/FindOpenBabel2.cmake:116 (macro_ensure_version)
CMakeLists.txt:173 (find_package)

I’m not very familiar with pkg-config but setting PKG_CONFIG_PATH to
/usr/lib/pkgconfig doesn’t fix my problem - though I’m not sure if that’s
what was meant by setting the lib prefix.

Thanks in advance.

-da

geoff.hutchison@gmail.com wrote:

This on a fresh fedora 12 install. Any know off the top of their heads
what this could be?

Is pkg-config installed?

Yep.

Ah, apparently 64 bit FC doesn’t even check /usr/lib, only /usr/lib64.
It was a pkg-config issue. Setting lib prefix fixed it.

Hi List,

Yesterday afternoon a coworker tried compiling avogadro from
cryos/master and dlonie/master using openbabel trunk. Running cmake
as:

[baettig@ez05 build]$ cmake …
-DOPENBABEL2_INCLUDE_DIR=/usr/include/openbabel-2.0/openbabel/
-DOPENBABEL2_LIBRARIES=/usr/lib/libopenbabel.so
-DOPENBABEL2_VERSION_MET=true

gave the error:
– Found OpenBabel2 executable: /usr/local/bin/babel
CMake Error at cmake/modules/MacroEnsureVersion.cmake:95 (NORMALIZE_VERSION):
NORMALIZE_VERSION Macro invoked with incorrect arguments for macro named:
NORMALIZE_VERSION
Call Stack (most recent call first):
cmake/modules/FindOpenBabel2.cmake:109 (macro_ensure_version)
CMakeLists.txt:130 (find_package)

This on a fresh fedora 12 install. Any know off the top of their heads
what this could be?

Thanks,
Dave

This on a fresh fedora 12 install. Any know off the top of their heads
what this could be?

Is pkg-config installed?

You don’t mention if you’re using the “superpackage” build, but this also has problems. Marcus, shouldn’t CMake be able to find openbabel properly in a superpackage?

-Geoff

On Fri, Feb 26, 2010 at 10:43 PM, Geoffrey Hutchison
geoff.hutchison@gmail.com wrote:

This on a fresh fedora 12 install. Any know off the top of their heads
what this could be?

Is pkg-config installed?

Yep.

You don’t mention if you’re using the “superpackage” build, but this also has problems. Marcus, shouldn’t CMake be able to find openbabel properly in a superpackage?

This isn’t a superpackage, last I heard they weren’t ready for use.
Are they? That would make things quite a bit easier :smiley: Perhaps someone
with more cmake knowledge could check the trunk detection at the end
of the FindOpenBabel cmake module – it looks ok to me, but I may have
made a mistake when I added it.

Did OB bump a version number lately to prepare for the new release?
Maybe that’s what’s causing it?

Dave

On Sat, Feb 27, 2010 at 10:05 AM, David Lonie loniedavid@gmail.com wrote:

On Fri, Feb 26, 2010 at 10:43 PM, Geoffrey Hutchison
geoff.hutchison@gmail.com wrote:

This on a fresh fedora 12 install. Any know off the top of their heads
what this could be?

Is pkg-config installed?

Yep.

Ah, apparently 64 bit FC doesn’t even check /usr/lib, only /usr/lib64.
It was a pkg-config issue. Setting lib prefix fixed it.

Dave

On Saturday 27 February 2010 11:38:40 David Lonie wrote:

On Sat, Feb 27, 2010 at 10:05 AM, David Lonie loniedavid@gmail.com wrote:

On Fri, Feb 26, 2010 at 10:43 PM, Geoffrey Hutchison

geoff.hutchison@gmail.com wrote:

This on a fresh fedora 12 install. Any know off the top of their heads
what this could be?

Is pkg-config installed?

Yep.

Ah, apparently 64 bit FC doesn’t even check /usr/lib, only /usr/lib64.
It was a pkg-config issue. Setting lib prefix fixed it.

I should try to fix it up to not rely on pkg-config, and use an
OpenBabelConfig.cmake file to find the installed OpenBabel. I need to create
some time, and work on fixing up some issues with the build system…

Need to clear a few things first if things are mostly OK.

Marcus

Hi Daniel,

On Tue, Mar 30, 2010 at 4:35 PM, Daniel Asarnow dasarnow@gmail.com wrote:

Greetings, all!
I’m having a similar error using cmake:

$ cmake -DOPENBABEL2_INCLUDE_DIR=$HOME/local/src/openbabel-2.2/include
-DOPENBABEL2_LIBRARIES=$HOME/local/src/openbabel-2.2/src/.libs/libopenbabel.so
-DOPENBABEL2_VERSION_MET=true $HOME/local/src/avogadro
– The build type is RelWithDebInfo
– Found lupdate: /usr/bin/lupdate-qt4
– Found lrelease: /usr/bin/lrelease-qt4
– Found lconvert: /usr/bin/lconvert
CMake Error at cmake/modules/MacroEnsureVersion.cmake:95
(NORMALIZE_VERSION):
NORMALIZE_VERSION Macro invoked with incorrect arguments for macro named:
NORMALIZE_VERSION
Call Stack (most recent call first):
cmake/modules/FindOpenBabel2.cmake:116 (macro_ensure_version)
CMakeLists.txt:173 (find_package)

If you are using the development (trunk) version of OpenBabel, you can
get passed this error by setting -DOPENBABEL_IS_NEWER_THAN_2_2_99=1 on
the cmake commandline.

If you’re not using trunk openbabel, removing the lines:

Test if we are using trunk

if(NOT OPENBABEL_IS_NEWER_THAN_2_2_99)
macro_ensure_version(“2.2.99” "${OPENBABEL2_VERSION}"
OPENBABEL_IS_NEWER_THAN_2_2_99)
endif(NOT OPENBABEL_IS_NEWER_THAN_2_2_99)
if (OPENBABEL_IS_NEWER_THAN_2_2_99)
add_definitions(-DOPENBABEL_IS_NEWER_THAN_2_2_99)
endif(OPENBABEL_IS_NEWER_THAN_2_2_99)

from cmake/modules/FindOpenBabel2.cmake should fix the issue.

It seems that specifying the the version_met etc break this bit of
cmake logic, since cmake doesn’t search for openbabel and thus never
sets the version number. Marcus – do you know of some cmake magic
that could fix this? I wrote this bit, but I’m afraid that’s as far as
my cmake-fu goes.

Dave

Thanks David, setting -DOPENBABEL_IS_NEWER_THAN_2_2_99=1 allowed cmake to
continue.

-da

On Tue, Mar 30, 2010 at 13:40, David Lonie loniedavid@gmail.com wrote:

Hi Daniel,

On Tue, Mar 30, 2010 at 4:35 PM, Daniel Asarnow dasarnow@gmail.com
wrote:

Greetings, all!
I’m having a similar error using cmake:

$ cmake -DOPENBABEL2_INCLUDE_DIR=$HOME/local/src/openbabel-2.2/include

-DOPENBABEL2_LIBRARIES=$HOME/local/src/openbabel-2.2/src/.libs/libopenbabel.so

-DOPENBABEL2_VERSION_MET=true $HOME/local/src/avogadro
– The build type is RelWithDebInfo
– Found lupdate: /usr/bin/lupdate-qt4
– Found lrelease: /usr/bin/lrelease-qt4
– Found lconvert: /usr/bin/lconvert
CMake Error at cmake/modules/MacroEnsureVersion.cmake:95
(NORMALIZE_VERSION):
NORMALIZE_VERSION Macro invoked with incorrect arguments for macro
named:
NORMALIZE_VERSION
Call Stack (most recent call first):
cmake/modules/FindOpenBabel2.cmake:116 (macro_ensure_version)
CMakeLists.txt:173 (find_package)

If you are using the development (trunk) version of OpenBabel, you can
get passed this error by setting -DOPENBABEL_IS_NEWER_THAN_2_2_99=1 on
the cmake commandline.

If you’re not using trunk openbabel, removing the lines:

Test if we are using trunk

if(NOT OPENBABEL_IS_NEWER_THAN_2_2_99)
macro_ensure_version(“2.2.99” "${OPENBABEL2_VERSION}"
OPENBABEL_IS_NEWER_THAN_2_2_99)
endif(NOT OPENBABEL_IS_NEWER_THAN_2_2_99)
if (OPENBABEL_IS_NEWER_THAN_2_2_99)
add_definitions(-DOPENBABEL_IS_NEWER_THAN_2_2_99)
endif(OPENBABEL_IS_NEWER_THAN_2_2_99)

from cmake/modules/FindOpenBabel2.cmake should fix the issue.

It seems that specifying the the version_met etc break this bit of
cmake logic, since cmake doesn’t search for openbabel and thus never
sets the version number. Marcus – do you know of some cmake magic
that could fix this? I wrote this bit, but I’m afraid that’s as far as
my cmake-fu goes.

Dave