find_library fails to locate multiarch libraries

Bug #737137 reported by Felix Geyer
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
cmake (Debian)
Fix Released
Unknown
cmake (Ubuntu)
Fix Released
High
Unassigned
Natty
Fix Released
High
Unassigned

Bug Description

Binary package hint: cmake

find_library() doesn't search in multiarch paths (e.g. /lib/x86_64-linux-gnu) and thus fails to find those libraries.
As a result many packages that use cmake ftbfs (including most of KDE).

koffice has a workaround applied which disable the find_library() check:
http://launchpadlibrarian.net/66504983/koffice_1%3A2.3.3-0ubuntu1_1%3A2.3.3-0ubuntu2.diff.gz

Related branches

Felix Geyer (debfx)
tags: added: kubuntu multiarch
Changed in cmake (Ubuntu):
importance: Undecided → High
milestone: none → ubuntu-11.04-beta-1
Revision history for this message
Walther Zwart (wahez) wrote :

Created a file that solves the issue. Not sure if it is the "right thing to do".
Save it as /usr/share/cmake-2.8/Modules/Platform/Linux-GNU-C-x86_64.cmake

Revision history for this message
Steve Langasek (vorlon) wrote :

It's not the right thing to do because this is not an issue that's specific to x86_64; it affects cmake on *all* architectures for which Ubuntu builds, so the correct path needs to be picked up at cmake build time based on the dpkg environment ($DEB_HOST_MULTIARCH).

Also, /usr/lib64/x86_64-linux-gnu shouldn't be in this list. You only want /lib/$triplet and /usr/lib/$triplet for multiarch.

And for consistent semantics, this should prepend to the system path rather than append, if that's an option. The multiarch directories are first on the linker path.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cmake - 2.8.3-3ubuntu4

---------------
cmake (2.8.3-3ubuntu4) natty; urgency=low

  * Prepend multiarch directories in
    ubuntu_multiarch_library_directory.diff LP: #737137
 -- Jonathan Riddell <email address hidden> Fri, 18 Mar 2011 17:53:13 +0000

Changed in cmake (Ubuntu Natty):
status: New → Fix Released
Changed in cmake (Debian):
status: Unknown → New
Revision history for this message
Peng (pengwg) wrote :

I still have problem with CMake 2.8.3 on Natty x64:

make[2]: *** No rule to make target `/usr/lib/libpng.so', needed by `Project.so'. Stop.

CMakeLists.txt has been processed without warning or error. And my project has been built to [100%] but the error appeared at link time. libpng.so resides in /usr/lib/x86_64-linux-gnu/ folder.

Actually the link command with '-lpng' in CMakeFiles/Project.dir/link.txt can be just run fine if invoked manually because g++ is multiarch aware.

Revision history for this message
Steve Langasek (vorlon) wrote :

> make[2]: *** No rule to make target `/usr/lib/libpng.so', needed by `Project.so'. Stop.

This looks like a wrong dependency declaration in your local rules, not a bug in cmake. From what I can see, /usr/share/cmake-2.8/Modules/FindPNG.cmake uses find_library correctly, and find_library in the Ubuntu cmake-data package works correctly now.

If you can reproduce this failure when trying to build a package from the Ubuntu archive, please let us know which one. Otherwise, I'm happy to help you figure out how to make your local rules work under multiarch (by private mail), but I think that's off-topic for this bug.

Changed in cmake (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.