CheckCXXCompilerFlag broken in 3.19 when variable "CXX" is set
There seems to be an undocumented backwards incompatible change in cmake 3.19, that results in a build failure with the root 5 project.
curl -L https://github.com/root-project/root/archive/v5-34-00-patches.tar.gz | tar xz
mkdir root5-build
cd root5-build
cmake -S ../root-34-00-patches -B . -DCMAKE_CXX_STANDARD=11
results in
This output:
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The Fortran compiler identification is GNU 10.2.0
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /usr/bin/gfortran - skipped
-- Checking whether /usr/bin/gfortran supports Fortran 90
-- Checking whether /usr/bin/gfortran supports Fortran 90 - yes
-- Found GCC. Major version 10, minor version 2
-- CMAKE_BUILD_TYPE: RelWithDebInfo
CMake Error at /usr/share/cmake-3.19/Modules/Internal/CheckSourceCompiles.cmake:35 (message):
check_source_compiles: CXX: unknown language.
Call Stack (most recent call first):
/usr/share/cmake-3.19/Modules/CheckCXXSourceCompiles.cmake:72 (cmake_check_source_compiles)
cmake/modules/CheckCXXCompilerFlag.cmake:29 (CHECK_CXX_SOURCE_COMPILES)
cmake/modules/CheckCompiler.cmake:93 (CHECK_CXX_COMPILER_FLAG)
CMakeLists.txt:33 (include)
CMake Error at /usr/share/cmake-3.19/Modules/Internal/CheckSourceCompiles.cmake:35 (message):
check_source_compiles: CXX: unknown language.
Call Stack (most recent call first):
/usr/share/cmake-3.19/Modules/CheckCXXSourceCompiles.cmake:72 (cmake_check_source_compiles)
cmake/modules/CheckCXXCompilerFlag.cmake:29 (CHECK_CXX_SOURCE_COMPILES)
cmake/modules/CheckCompiler.cmake:94 (CHECK_CXX_COMPILER_FLAG)
CMakeLists.txt:33 (include)
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found a 64bit system
-- Found GNU compiler collection
CMake Error at /usr/share/cmake-3.19/Modules/Internal/CheckSourceCompiles.cmake:35 (message):
check_source_compiles: CXX: unknown language.
Call Stack (most recent call first):
/usr/share/cmake-3.19/Modules/CheckCXXSourceCompiles.cmake:72 (cmake_check_source_compiles)
cmake/modules/CheckCXXCompilerFlag.cmake:29 (CHECK_CXX_SOURCE_COMPILES)
cmake/modules/RootNewMacros.cmake:758 (CHECK_CXX_COMPILER_FLAG)
cmake/modules/CheckCompiler.cmake:124 (ROOT_ADD_CXX_FLAG)
CMakeLists.txt:33 (include)
-- ROOT Platform: linux
-- ROOT Architecture: linuxx8664gcc
-- Build Type: RelWithDebInfo
-- Compiler Flags: -pipe -m64 -Wall -W -Woverloaded-virtual -fPIC -pthread -O2 -g -DNDEBUG
-- Looking for ZLib
-- Found ZLIB: /usr/lib/libz.so (found version "1.2.11")
-- Looking for Freetype
-- Found Freetype: /usr/lib/libfreetype.so (found version "2.10.4")
-- Looking for PCRE
-- Found PCRE version 8.44 using /usr/bin/pcre-config
-- Looking for LZMA
-- Found LZMA includes at /usr/include
-- Found LZMA library at /usr/lib/liblzma.so
-- Looking for LZ4
-- Found LZ4 includes at /usr/include
-- Found LZ4 library at /usr/lib/liblz4.so
-- Found xxhash include at /usr/include
-- Looking for X11
-- Found X11: /usr/include
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- X11_INCLUDE_DIR: /usr/include
-- X11_LIBRARIES: /usr/lib/libSM.so;/usr/lib/libICE.so;/usr/lib/libX11.so;/usr/lib/libXext.so
-- X11_Xpm_INCLUDE_PATH: /usr/include
-- X11_Xpm_LIB: /usr/lib/libXpm.so
-- X11_Xft_INCLUDE_PATH: /usr/include
-- X11_Xft_LIB: /usr/lib/libXft.so
-- X11_Xext_INCLUDE_PATH: /usr/include
-- X11_Xext_LIB: /usr/lib/libXext.so
-- Found GIF: /usr/lib/libgif.so (found version "5.2.1")
-- Found TIFF: /usr/lib/libtiff.so (found version "4.1.0")
CMake Warning (dev) at /usr/share/cmake-3.19/Modules/FindTIFF.cmake:124 (if):
Policy CMP0054 is not set: Only interpret if() arguments as variables or
keywords when unquoted. Run "cmake --help-policy CMP0054" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
Quoted variables like "CXX" will no longer be dereferenced when the policy
is set to NEW. Since the policy is not set the OLD behavior will be used.
Call Stack (most recent call first):
cmake/modules/SearchInstalledSoftware.cmake:248 (find_Package)
CMakeLists.txt:46 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found PNG: /usr/lib/libpng.so (found version "1.6.37")
-- Found JPEG: /usr/lib/libjpeg.so (found version "80")
-- Looking for GSL
-- Found GSL: /usr/include (found suitable version "2.6", minimum required is "1.10")
-- Looking for Python
-- Found PythonInterp: /usr/bin/python (found version "3.8.6")
-- Found Python interpreter version 3.8
-- Found PythonLibs: /usr/lib/libpython3.8.so (found version "3.8.6")
-- Looking for GCCXML
-- Looking for OpenGL
CMake Warning (dev) at /usr/share/cmake-3.19/Modules/FindOpenGL.cmake:293 (message):
Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
available. Run "cmake --help-policy CMP0072" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
FindOpenGL found both a legacy GL library:
OPENGL_gl_LIBRARY: /usr/lib/libGL.so
and GLVND libraries for OpenGL and GLX:
OPENGL_opengl_LIBRARY: /usr/lib/libOpenGL.so
OPENGL_glx_LIBRARY: /usr/lib/libGLX.so
OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
cmake/modules/SearchInstalledSoftware.cmake:366 (find_package)
CMakeLists.txt:46 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found OpenGL: /usr/lib/libOpenGL.so
-- Looking for Graphviz
CMake Warning (dev) at /usr/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:424 (message):
The package name passed to `find_package_handle_standard_args` (GRAPHVIZ)
does not match the name of the calling package (Graphviz). This can lead
to problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
cmake/modules/FindGraphviz.cmake:19 (find_package_handle_standard_args)
cmake/modules/SearchInstalledSoftware.cmake:381 (find_package)
CMakeLists.txt:46 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Could NOT find GRAPHVIZ (missing: GRAPHVIZ_INCLUDE_DIR GRAPHVIZ_cdt_LIBRARY GRAPHVIZ_gvc_LIBRARY GRAPHVIZ_graph_LIBRARY GRAPHVIZ_pathplan_LIBRARY)
-- Graphviz not found. Switching off gviz option
-- Looking for Bonjour
-- Checking whether Bonjour/Avahi is supported
-- Looking for Kerberos 5
CMake Warning (dev) at /usr/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:424 (message):
The package name passed to `find_package_handle_standard_args` (KRB5) does
not match the name of the calling package (Kerberos5). This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
cmake/modules/FindKerberos5.cmake:36 (find_package_handle_standard_args)
cmake/modules/SearchInstalledSoftware.cmake:428 (find_package)
CMakeLists.txt:46 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found KRB5: /usr/lib/libkrb5.so
-- Looking for LibXml2
-- Found LibXml2: /usr/lib/libxml2.so (found version "2.9.10")
-- Looking for OpenSSL
-- Found OpenSSL: /usr/lib/libcrypto.so (found version "1.1.1h")
-- Looking for Castor
CMake Warning (dev) at /usr/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:424 (message):
The package name passed to `find_package_handle_standard_args` (CASTOR)
does not match the name of the calling package (Castor). This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
cmake/modules/FindCastor.cmake:43 (find_package_handle_standard_args)
cmake/modules/SearchInstalledSoftware.cmake:501 (find_package)
CMakeLists.txt:46 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Could NOT find CASTOR (missing: CASTOR_shift_LIBRARY CASTOR_INCLUDE_DIR)
-- Castor not found. Switching off castor/rfio option
-- Looking for MySQL
CMake Warning (dev) at /usr/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:424 (message):
The package name passed to `find_package_handle_standard_args` (MYSQL) does
not match the name of the calling package (MySQL). This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
cmake/modules/FindMySQL.cmake:37 (find_package_handle_standard_args)
cmake/modules/SearchInstalledSoftware.cmake:516 (find_package)
CMakeLists.txt:46 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Could NOT find MYSQL (missing: MYSQL_INCLUDE_DIR MYSQL_LIBRARIES)
-- MySQL not found. Switching off mysql option
-- Looking for Oracle
-- Oracle not found.
-- Oracle: You can specify includes: -DORACLE_PATH_INCLUDES=/usr/include/oracle/10.2.0.3/client
-- currently found includes:
-- Oracle: You can specify libs: -DORACLE_PATH_LIB=/usr/lib/oracle/10.2.0.3/client/lib
-- currently found libs: ORACLE_LIBRARY_OCCI-NOTFOUND;ORACLE_LIBRARY_CLNTSH-NOTFOUND;ORACLE_LIBRARY_LNNZ-NOTFOUND
-- Oracle not found. Switching off oracle option
-- Looking for ODBC
-- Found ODBC: /usr/include
-- Looking for PostgreSQL
-- Found PostgreSQL: /usr/include
-- Looking for SQLite
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.7.3")
-- Found Sqlite: /usr/include
-- Looking for Pythia6
-- Pythia6 not found. Switching off pythia6 option
-- Looking for Pythia8
-- Could NOT find Pythia8 (missing: PYTHIA8_INCLUDE_DIR PYTHIA8_LIBRARY)
-- Pythia8 not found. Switching off pythia8 option
-- Looking for FFTW3
-- Found fftw3 includes at /usr/include
-- Found fftw3 library at /usr/lib/libfftw3.so
-- Looking for CFITSIO
-- Found CFITSIO: /usr/include
-- Found CFITSIO version: 3.49
-- Alien API not found. Set variable ALIEN_DIR to point to your Alien installation
-- For the time being switching OFF 'alien' option
-- Monalisa not found. Set variable MONALISA_DIR to point to your Monalisa installation
-- For the time being switching OFF 'monalisa' option
-- Could NOT find GFAL (missing: GFAL_INCLUDE_DIR SRM_IFCE_INCLUDE_DIR GFAL_LIBRARY)
-- GFAL library not found. Set variable GFAL_DIR to point to your gfal installation
and the variable SRM_IFCE_DIR to the srm_ifce installation
-- For the time being switching OFF 'gfal' option
-- Could NOT find DCAP (missing: DCAP_INCLUDE_DIR DCAP_LIBRARY)
-- dCap library not found. Set variable DCAP_DIR to point to your dCache installation
-- For the time being switching OFF 'dcache' option
CMake Warning (dev) at /usr/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:424 (message):
The package name passed to `find_package_handle_standard_args` (LDAP) does
not match the name of the calling package (Ldap). This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
cmake/modules/FindLdap.cmake:21 (find_package_handle_standard_args)
cmake/modules/SearchInstalledSoftware.cmake:780 (find_package)
CMakeLists.txt:46 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found LDAP: /usr/include
-- Looking for DAVIX
CMake Warning (dev) at /usr/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:424 (message):
The package name passed to `find_package_handle_standard_args` (DAVIX) does
not match the name of the calling package (Davix). This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
cmake/modules/FindDavix.cmake:17 (find_package_handle_standard_args)
cmake/modules/SearchInstalledSoftware.cmake:878 (find_package)
CMakeLists.txt:46 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Could NOT find DAVIX (missing: DAVIX_INCLUDE_DIRS DAVIX_LIBRARIES)
-- Davix not found. You can enable the option 'builtin_davix' to build the library internally'
-- For the time being switching off 'davix' option
-- >>> Option 'chirp' not implemented yet! Signal your urgency to pere.mato@cern.ch
-- >>> Option 'glite' not implemented yet! Signal your urgency to pere.mato@cern.ch
-- >>> Option 'hdfs' not implemented yet! Signal your urgency to pere.mato@cern.ch
-- >>> Option 'pch' not implemented yet! Signal your urgency to pere.mato@cern.ch
-- >>> Option 'sapdb' not implemented yet! Signal your urgency to pere.mato@cern.ch
-- >>> Option 'srp' not implemented yet! Signal your urgency to pere.mato@cern.ch
-- Enabled support for: asimage astiff bonjour builtin_afterimage builtin_ftgl builtin_glew cintex exceptions explicitlink fftw3 fitsio fortran genvector krb5 ldap mathmore memstat minuit2 odbc opengl pgsql python reflex shadowpw shared sqlite ssl thread tmva vdt xft xml x11
CMake Error at /usr/share/cmake-3.19/Modules/Internal/CheckSourceCompiles.cmake:35 (message):
check_source_compiles: CXX: unknown language.
Call Stack (most recent call first):
/usr/share/cmake-3.19/Modules/CheckCXXSourceCompiles.cmake:72 (cmake_check_source_compiles)
cmake/modules/CheckCXXCompilerFlag.cmake:29 (CHECK_CXX_SOURCE_COMPILES)
cmake/modules/RootNewMacros.cmake:758 (CHECK_CXX_COMPILER_FLAG)
cint/cint/CMakeLists.txt:130 (ROOT_ADD_CXX_FLAG)
CMake Error at /usr/share/cmake-3.19/Modules/Internal/CheckSourceCompiles.cmake:35 (message):
check_source_compiles: CXX: unknown language.
Call Stack (most recent call first):
/usr/share/cmake-3.19/Modules/CheckCXXSourceCompiles.cmake:72 (cmake_check_source_compiles)
cmake/modules/CheckCXXCompilerFlag.cmake:29 (CHECK_CXX_SOURCE_COMPILES)
cmake/modules/RootNewMacros.cmake:758 (CHECK_CXX_COMPILER_FLAG)
cint/ROOT/CMakeLists.txt:84 (ROOT_ADD_CXX_FLAG)
CMake Error at /usr/share/cmake-3.19/Modules/Internal/CheckSourceCompiles.cmake:35 (message):
check_source_compiles: CXX: unknown language.
Call Stack (most recent call first):
/usr/share/cmake-3.19/Modules/CheckCXXSourceCompiles.cmake:72 (cmake_check_source_compiles)
cmake/modules/CheckCXXCompilerFlag.cmake:29 (CHECK_CXX_SOURCE_COMPILES)
cmake/modules/RootNewMacros.cmake:758 (CHECK_CXX_COMPILER_FLAG)
cint/ROOT/CMakeLists.txt:85 (ROOT_ADD_CXX_FLAG)
CMake Error at /usr/share/cmake-3.19/Modules/Internal/CheckSourceCompiles.cmake:35 (message):
check_source_compiles: CXX: unknown language.
Call Stack (most recent call first):
/usr/share/cmake-3.19/Modules/CheckCXXSourceCompiles.cmake:72 (cmake_check_source_compiles)
cmake/modules/CheckCXXCompilerFlag.cmake:29 (CHECK_CXX_SOURCE_COMPILES)
cmake/modules/RootNewMacros.cmake:758 (CHECK_CXX_COMPILER_FLAG)
cint/ROOT/CMakeLists.txt:87 (ROOT_ADD_CXX_FLAG)
CMake Error at /usr/share/cmake-3.19/Modules/Internal/CheckSourceCompiles.cmake:35 (message):
check_source_compiles: CXX: unknown language.
Call Stack (most recent call first):
/usr/share/cmake-3.19/Modules/CheckCXXSourceCompiles.cmake:72 (cmake_check_source_compiles)
cmake/modules/CheckCXXCompilerFlag.cmake:29 (CHECK_CXX_SOURCE_COMPILES)
cmake/modules/RootNewMacros.cmake:758 (CHECK_CXX_COMPILER_FLAG)
cint/reflex/CMakeLists.txt:18 (ROOT_ADD_CXX_FLAG)
Running /home/maxnoe/.local/root-5-34-00-patches/build/unix/compiledata.sh
Making include/compiledata.h
-- Configuring incomplete, errors occurred!
See also "/home/maxnoe/.local/root5-build/CMakeFiles/CMakeOutput.log".
See also "/home/maxnoe/.local/root5-build/CMakeFiles/CMakeError.log".