View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014457CMakeCMakepublic2013-10-03 03:182016-06-10 14:31
ReporterZachary Deretsky 
Assigned ToKitware Robot 
PriorityhighSeveritymajorReproducibilityalways
StatusclosedResolutionmoved 
PlatformLinuxOSUbuntuOS Version12.04
Product VersionCMake 2.8.11 
Target VersionFixed in Version 
Summary0014457: CMAKE_CXX_LIBRARY_ARCHITECTURE variable is not getting populated
DescriptionThe simple test case was created after many iterations by Stephen Kelly:

This CMakeLists.txt
zach@cloud1-12:~/QT/build$ cat ../CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
set(CMAKE_C_COMPILER $ENV{AZ_TOOL_PATH}/bin/gcc)
project(qtgui)
find_library(TEST_Qt5Gui_GL_LIBRARY GL)
message("TEST_Qt5Gui_GL_LIBRARY : ${TEST_Qt5Gui_GL_LIBRARY}")
message("CMAKE_CXX_LIBRARY_ARCHITECTURE ${CMAKE_CXX_LIBRARY_ARCHITECTURE}")

produces this result:
zach@cloud1-12:~/QT/build$ cmake ..
-- The C compiler identification is GNU 4.6.3
-- The CXX compiler identification is GNU 4.6.3
-- Check for working C compiler: /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/bin/gcc
-- Check for working C compiler: /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/bin/c++
-- Check for working CXX compiler: /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
TEST_Qt5Gui_GL_LIBRARY : TEST_Qt5Gui_GL_LIBRARY-NOTFOUND
CMAKE_CXX_LIBRARY_ARCHITECTURE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/zach/QT/build

If I set CMAKE_CXX_LIBRARY_ARCHITECTURE in this CMakeLists.txt

cmake_minimum_required(VERSION 2.8)
set(CMAKE_C_COMPILER $ENV{AZ_TOOL_PATH}/bin/gcc)
set(CMAKE_CXX_LIBRARY_ARCHITECTURE x86_64-linux-gnu)
project(qtgui)
find_library(TEST_Qt5Gui_GL_LIBRARY GL)
message("TEST_Qt5Gui_GL_LIBRARY : ${TEST_Qt5Gui_GL_LIBRARY}")
message("CMAKE_CXX_LIBRARY_ARCHITECTURE ${CMAKE_CXX_LIBRARY_ARCHITECTURE}")

I obtain:

zach@cloud1-12:~/QT/build$ cmake ..
-- The C compiler identification is GNU 4.6.3
-- The CXX compiler identification is GNU 4.6.3
-- Check for working C compiler: /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/bin/gcc
-- Check for working C compiler: /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/bin/c++
-- Check for working CXX compiler: /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
TEST_Qt5Gui_GL_LIBRARY : /usr/lib/x86_64-linux-gnu/libGL.so
CMAKE_CXX_LIBRARY_ARCHITECTURE x86_64-linux-gnu
-- Configuring done
-- Generating done
-- Build files have been written to: /home/zach/QT/build


TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0033968)
Zachary Deretsky (reporter)
2013-10-03 03:33

Is the problem that I need to set
CMAKE_CXX_LIBRARY_ARCHITECTURE to x86_64-linux-gnu
because
zach@cloud1-12:~/QT/build$ ls -l /usr/lib/x86_64-linux-gnu/libGL.so
lrwxrwxrwx 1 root root 13 Jun 18 13:54 /usr/lib/x86_64-linux-gnu/libGL.so -> mesa/libGL.so

but

/AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/bin/c++ -dumpmachine
x86_64-unknown-linux-gnu


x86_64-linux-gnu versus x86_64-unknown-linux-gnu ???
(0033970)
Brad King (manager)
2013-10-03 08:08

The code that populates the library architecture is here:

 http://cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/CMakeDetermineCompilerABI.cmake;hb=v2.8.11.2#l117 [^]
 # Detect library architecture directory name.

Look at CMakeFiles/<cmake-version>/CMakeCXXCompiler.cmake for the value determined for CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES. CMake tries matching paths containing the arch triplet from that list of directories. If your toolchain is not configured to search /usr/lib/x86_64-linux-gnu implicitly then CMake won't pick it up automatically either.
(0042383)
Kitware Robot (administrator)
2016-06-10 14:29

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.

 Issue History
Date Modified Username Field Change
2013-10-03 03:18 Zachary Deretsky New Issue
2013-10-03 03:33 Zachary Deretsky Note Added: 0033968
2013-10-03 08:08 Brad King Note Added: 0033970
2016-06-10 14:29 Kitware Robot Note Added: 0042383
2016-06-10 14:29 Kitware Robot Status new => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team