MantisBT - CMake
View Issue Details
0011375CMakeCMakepublic2010-10-28 05:252016-06-10 14:31
Matthieu Volat 
Bill Hoffman 
normalmajoralways
closedmoved 
 
 
0011375: CMake searching of library path on AMD64 architectures with GNU/Linux
When searching for libraries in pure CXX projects in Linux on 64 bits systems, the lib64 directories are not searched, even with the FIND_LIBRARY_USE_LIB64_PATHS macro set. Adding the 64 prefix works in pure C or hybrid C/CXX projects.
The file hierarchy standard (http://www.pathname.com/fhs/pub/fhs-2.3.html#LIB64 [^]) specifies that the "lib" directories will house 32bits binaries on PPC64, s390x, sparc64 and AMD64 architectures running GNU/Linux.

While the FIND_LIBRARY_USE_LIB64_PATHS property allows to mitigate this problem, it still has a few quircks :
* Even setting the property at global level do not seem to apply to subsequent find_package calls
* If a 32bit library with the adequate name is found in "lib" directories, it will be used instead of the native version
No tags attached.
Issue History
2010-10-28 05:25Matthieu VolatNew Issue
2010-11-02 07:29Matthieu VolatNote Added: 0022770
2011-01-17 16:53David ColeNote Added: 0024831
2011-01-17 17:00David ColeAssigned To => Bill Hoffman
2011-01-17 17:00David ColeStatusnew => assigned
2011-01-21 10:56Matthieu VolatNote Added: 0024993
2011-01-21 11:03David ColeDescription Updatedbug_revision_view_page.php?rev_id=151#r151
2016-06-10 14:28Kitware RobotNote Added: 0041759
2016-06-10 14:28Kitware RobotStatusassigned => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0022770)
Matthieu Volat   
2010-11-02 07:29   
Hmm, it seems that my test was a bit hasty:
The problem was observed with a pure C++ project (using the macro PROJECT(myproject CXX) at the begining of the CMakeLists.txt).

Tracking the issue, i went into the cmFindLibraryCommand.cxx file and saw at begining of the cmFindLibraryCommand::AddLib64Paths() function that searching for lib64 variants is only enabled when project is C-enabled.

Transforming it in a C/CXX enabled project is a workaround. I tried enlarging the conditional to allow CXX projects, but it was a mitigated success since some findpackages calls requires a C compiler to build their internal test programs. Maybe this bug should be closed and reopened with a proper description of the problem?
(0024831)
David Cole   
2011-01-17 16:53   
You don't need to close and re-open the bug. As the reporter of a still open bug, you should be able to edit the summary and description fields to reflect reality.

Would you mind re-phrasing this issue to tell us exactly what the problem is and what you think should be done to fix it?

Thanks.
(0024993)
Matthieu Volat   
2011-01-21 10:56   
I'm sorry, I can't find where to edit the description of the bug report. A correct rephrasement of the issue should be :

"When searching for libraries in pure CXX projects in Linux on 64 bits systems, the lib64 directories are not searched, even with the FIND_LIBRARY_USE_LIB64_PATHS macro set. Adding the 64 prefix works in pure C or hybrid C/CXX projects."
(0041759)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.