CMake "Detecting CXX compiler ABI info - failed" - gcc

CMake Output:
-- The CXX compiler identification is GNU 11.2.1
-- The C compiler identification is GNU 11.2.1
-- The ASM compiler identification is GNU
-- Found assembler: /home/bob/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
What does "Detecting CXX compiler ABI info - failed" mean - what is the cause of this error, and how is it fixed?

Related

cmake libclang with homebrew llvm on macos

I try to build cquery on macos with cquery with llvm(homebrew), but some lib cannot be found.
$ LDFLAGS="-L/usr/local/opt/llvm/lib"
CPPFLAGS="-I/usr/local/opt/llvm/include"
cmake -DSYSTEM_CLANG=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=$(which clang) -DCMAKE_CXX_COMPILER=$(which clang++) .
-- The CXX compiler identification is Clang 6.0.0
-- Check for working CXX compiler: /usr/local/opt/llvm/bin/clang++
-- Check for working CXX compiler: /usr/local/opt/llvm/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using system Clang
CMake Error at /usr/local/Cellar/cmake/3.11.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find Clang (missing: _libclang_LIBRARY _libclang_INCLUDE_DIR)
(found suitable version "6.0.0", minimum required is "6.0.0")
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.11.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
cmake/FindClang.cmake:93 (find_package_handle_standard_args)
CMakeLists.txt:91 (find_package)
-- Configuring incomplete, errors occurred!
See also "/Users/vonfry/.local/src/cquery/CMakeFiles/CMakeOutput.log".
According to this page, use CMAKE_PREFIX_PATH for find_* function.

CUDA 5.0, CMake and Make failing on OSX 10.8.3

I try to compile a simple CUDA "Hello World" using CMake on my Mac OSX 10.8.3.
Calling cmake . seems to succeed. Here is my CMakeList.txt:
project(HelloWorld)
cmake_minimum_required(VERSION 2.8)
FIND_PACKAGE(CUDA)
CUDA_INCLUDE_DIRECTORIES(/Developer/NVIDIA/CUDA-5.0/samples/common/inc)
CUDA_ADD_EXECUTABLE(helloWorld helloWorld.cu)
... and the output:
-- The C compiler identification is Clang 4.2.0
-- The CXX compiler identification is Clang 4.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found CUDA: /Developer/NVIDIA/CUDA-5.0 (found version "5.0")
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/mennny/Documents/UNI/6_Semester/0_PMPP/1_exercises/cuda-hello-world
But calling make afterwards fails with the following error(s):
[100%] Building NVCC (Device) object CMakeFiles/helloWorld.dir//./helloWorld_generated_helloWorld.cu.o
clang: error: unsupported option '-dumpspecs'
clang: error: no input files
CMake Error at helloWorld_generated_helloWorld.cu.o.cmake:206 (message): Error generating /Users/mennny/Documents/UNI/6_Semester/0_PMPP/1_exercises/cuda-hello-world/CMakeFiles/helloWorld.dir//./helloWorld_generated_helloWorld.cu.o
make[2]: *** [CMakeFiles/helloWorld.dir/./helloWorld_generated_helloWorld.cu.o] Error 1
make[1]: *** [CMakeFiles/helloWorld.dir/all] Error 2
make: *** [all] Error 2
I googled the shown errors but couldn't find any sufficient answers.
Any ideas why make fails, although cmake succeeded.
Thanks for your help.
The default C compiler in XCode changed to CLang in OS X Lion. CLang is incompatible with nvcc, so you need to change the compiler that nvcc uses for non-cuda (host) code. Adding the following to your CMakeList.txt will work:
if (NOT DEFINED CUDA_HOST_COMPILER AND CMAKE_C_COMPILER_ID STREQUAL "Clang" AND EXISTS /usr/bin/gcc)
set(CUDA_HOST_COMPILER /usr/bin/gcc CACHE FILEPATH "Host side compiler used by NVCC")
message(STATUS "Setting CMAKE_HOST_COMPILER to /usr/bin/gcc instead of ${CMAKE_C_COMPILER}.")
endif()
Adjust the path to gcc if necessary.
If you don't want to change your CMakeLists.txt, it works if you set the environment variable CXX to "gcc" (assuming you don't have any other GCC in your path before the one in /usr/bin).
CMake will pick it up automatically.

How does CMake check for a working compiler?

When using CMake, I noticed the output messages:
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
I am just curious about how CMake checks if the compiler works and the ABI information.
You can easily see for yourself. The code is located in CMake modules CMakeDetermineCCompiler.cmake, CMakeDetermineCompilerABI.cmake etc.
You can find these modules in your_cmake_install/share/cmake-2.8/Modules.

Building Luminance HDR on Ubuntu

I'm following the INSTALL for luminance-hdr-2.3.0, building on Ubuntu 12.04, but I'm getting the following error:
root#ben-laptop:/usr/src/luminance# cmake /usr/src/luminance-hdr-2.3.0/src
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at MainWindow/CMakeLists.txt:14 (QT4_WRAP_CPP):
Unnown CMake command "QT4_WRAP_CPP".
Any ideas?

How to compile OpenCV 2.4.0 (beta2) by Cmake on Mac OS X Lion?

I want to use Opencv 2.4.0 (beta2) together with EmguCV and MonoDevelop on my Mac OS X Lion system. But I failed to compile the OpenCV 2.4.0 by Cmake and it shows lacking of some dylib files of highgui.
Anybody can tell me the whole configuration and process to compile OpenCV 2.4.0 in Mac OS X? Thanks.
To eliminate the error concerning the sphinx package for python, install it using
sudo easy_install -U Sphinx
OR if you use MacPorts:
sudo port install py26-sphinx
Before check the version of the default python interpreter "python --version". In my example it is 2.6.
I downloaded OpenCV 2.4.0 sources from the repository (rev 8301) and I had no problems compiling it on Mac OS X 10.7.3:
$ svn info
Path: .
URL: http://code.opencv.org/svn/opencv/tags/2.4.0/opencv
Repository Root: http://code.opencv.org/svn/opencv
Repository UUID: c5418bc3-7546-4aae-8bad-fa6f2f3e53e6
Revision: 8301
Node Kind: directory
Schedule: normal
Last Changed Author: marina.kolpakova
Last Changed Rev: 8282
Last Changed Date: 2012-04-30 16:06:37 -0300 (Mon, 30 Apr 2012)
$ mkdir build
$ cd build
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON -D BUILD_EXAMPLES=ON ..
-- The CXX compiler identification is GNU
-- The C compiler identification is GNU
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detected version of GNU GCC: 42 (402)
-- Extracting svn version, please wait...
-- SVNVERSION: svn:8301
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of off64_t
-- Check size of off64_t - failed
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for assert.h
-- Looking for assert.h - found
-- Looking for fcntl.h
-- Looking for fcntl.h - found
-- Looking for io.h
-- Looking for io.h - not found
-- Looking for jbg_newlen
-- Looking for jbg_newlen - not found
-- Looking for mmap
-- Looking for mmap - found
-- Looking for search.h
-- Looking for search.h - found
-- Looking for string.h
-- Looking for string.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- checking for module 'libavcodec'
-- found libavcodec, version 52.76.0
-- checking for module 'libavformat'
-- found libavformat, version 52.68.0
-- checking for module 'libavutil'
-- found libavutil, version 50.19.0
-- checking for module 'libswscale'
-- found libswscale, version 0.11.0
-- Looking for libavformat/avformat.h
-- Looking for libavformat/avformat.h - found
-- Looking for ffmpeg/avformat.h
-- Looking for ffmpeg/avformat.h - not found
-- checking for module 'libdc1394-2'
-- package 'libdc1394-2' not found
-- checking for module 'libdc1394'
-- package 'libdc1394' not found
-- Found PythonInterp: /usr/bin/python (found suitable version "2.7.1", required is "2.0")
-- Found PythonLibs: /usr/lib/libpython2.7.dylib (Required is at least version "2.7.1")
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named sphinx
-- Could NOT find CUDA: Found unsuitable version "4.0", but required is at least "4.1" (found /usr/local/cuda)
--
-- General configuration for OpenCV 2.4.0 =====================================
-- Version control: svn:8301
--
-- Platform:
-- Host: Darwin 11.3.0 i386
-- CMake: 2.8.6
-- CMake generator: Unix Makefiles
-- CMake build tool: /usr/bin/make
-- Configuration: RELEASE
--
-- C/C++:
-- Built as dynamic libs?: YES
-- C++ Compiler: /usr/bin/c++ (ver 4.2.1)
-- C++ flags (Release): -Wall -pthread -fomit-frame-pointer -msse -msse2 -O3 -DNDEBUG -DNDEBUG
-- C++ flags (Debug): -Wall -pthread -fomit-frame-pointer -msse -msse2 -g -O0 -DDEBUG -D_DEBUG -ggdb3
-- C Compiler: /usr/bin/gcc
-- C flags (Release): -Wall -pthread -fomit-frame-pointer -msse -msse2 -O3 -DNDEBUG -DNDEBUG
-- C flags (Debug): -Wall -pthread -fomit-frame-pointer -msse -msse2 -g -O0 -DDEBUG -D_DEBUG -ggdb3
-- Linker flags (Release):
-- Linker flags (Debug):
--
-- OpenCV modules:
-- To be built: calib3d contrib core features2d flann gpu highgui imgproc legacy ml nonfree objdetect photo python stitching ts video videostab
-- Disabled by user: -
-- Disabled by dependency: -
-- Unavailable: androidcamera java
--
-- GUI:
-- Cocoa: YES
-- OpenGL support: NO
--
-- Media I/O:
-- ZLib: build (ver 1.2.6)
-- JPEG: build (ver 62)
-- PNG: build (ver 1.5.9)
-- TIFF: build (ver 42)
-- JPEG 2000: build (ver 1.900.1)
-- OpenEXR: NO
-- OpenNI: NO
-- OpenNI PrimeSensor Modules: NO
--
-- Video I/O: QTKit
-- FFMPEG: YES
-- codec: YES (ver Unknown)
-- format: YES (ver Unknown)
-- util: YES (ver Unknown)
-- swscale: YES (ver Unknown)
-- gentoo-style: YES
--
-- Other third-party libraries:
-- Use IPP: NO
-- Use TBB: NO
-- Use Cuda: NO
-- Use Eigen: NO
--
-- Python:
-- Interpreter: /usr/bin/python (ver 2.7.1)
-- Libraries: /usr/lib/libpython2.7.dylib
-- numpy: /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include (ver 1.5.1)
-- packages path: lib/python2.7/site-packages
--
-- Documentation:
-- Build Documentation: NO
-- Sphinx: NO
-- PdfLaTeX compiler: NO
--
-- Tests and samples:
-- Tests: YES
-- Performance tests: YES
-- Examples: YES
--
-- Install path: /usr/local
--
-- cvconfig.h is in: /Users/karlphillip/installers/OpenCV-2.4.0/opencv/build
-- -----------------------------------------------------------------
--
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
BUILD_PYTHON_SUPPORT
-- Build files have been written to: /Users/karlphillip/installers/OpenCV-2.4.0/opencv/build
After that, I executed make to compile and that's it.

Resources