Jan 30, 2013

openSUSE Forums: Update cmake to >= 2.8.9 in openSUSE-12.2-Update

openSUSE Forums
openSUSE Forums
Update cmake to >= 2.8.9 in openSUSE-12.2-Update
Jan 30th 2013, 10:52

I'm looking to post this for the openSUSE administrators, please move the thread it it's in the wrong section. I wish to request updating cmake (currently at version 2.8.8) to 2.8.9 or later in the openSUSE-12.2-Update repository. That's because 2.8.9 introduced a compile flag which some projects are already using, called SONAME_FLAG. Without it, cmake will generate an incorrect linker setup, and gcc will fail to link libraries upon compile. I was told the openSUSE policy is to update package versions when a critical change is out, which this is probably the case. I posted about the issue here: 0013884: SONAME_FLAG incorrectly prefixed to libraries in link.txt & relink.txt, causes linker to fail - MantisBT Here's a quote of my original bug report and the reply I got from one of the cmake devs:

Quote:

I discovered a major problem while configuring two C++ projects with cmake. When Generating the configuration, cmake adds the word SONAME_FLAG before the name of each library in link.txt and relink.txt once. This causes the linker to fail when compiling with make. Here's the error I get with the OGRE engine:

c++: error: SONAME_FLAGlibOgreMain.so.1.9.0: No such file or directory
make[2]: *** [lib/libOgreMain.so.1.9.0] Error 1
make[1]: *** [OgreMain/CMakeFiles/OgreMain.dir/all] Error 2
make: *** [all] Error 2

After hours of digging into the issue, I found where it happens and what goes wrong. Here's the OGRE and libOgreMain example, but the problem happens with each library of projects that are affected:

- After you generate your cmake configuration, open the file .../OGRE/build/OgreMain/CMakeFiles/OgreMain.dir/link.txt

- Somewhere within this file, you will find the following part: -shared SONAME_FLAGlibOgreMain.so.1.9.0

- To fix it, you must manually change that to: -shared -Wl,-soname,libOgreMain.so.1.9.0

To reproduce the issue:

- Get the source of one of the projects affected by the issue. I only noticed it with OGRE and PolyVox, other C++ codes work fine.

- Unpack it and run cmake (in my case I use cmake-gui). Specify "Unix makefiles" with "Default native compilers". If the main folder is OGRE set the build folder to OGRE/build. Leave all cmake options to their defaults and Configure then Generate. Normally you should see no errors or warnings.

- Now go to OGRE/build and run "make". It will start to compile, but when it gets to linking the first library you get the error: c++: error: SONAME_FLAGlibWhatever.so.1.2.3: No such file or directory

Experienced with cmake 2.8.8. Operating system is Linux openSUSE 12.2 KDE 4.9.5.
Quote:

The SONAME_FLAG rule variable placeholder was added in CMake 2.8.9 here:

cmake.org Git - cmake.git/commitdiff [^]

and is not available in 2.8.8. Since the source code to CMake 2.8.8 doesn't even mention it the string must be coming from the project itself. I suspect these projects are trying to use custom link rule variables without updating their minimum required version of CMake to a sufficiently new version to have the features they use.

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions

No comments: