mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-06 14:19:59 -05:00
CMakeDetermineCompilerABI: Revert "Parse library arch from versioned paths"
The change in commit 657fc3a9a7 (CMakeDetermineCompilerABI: Parse
library arch from versioned paths, 2021-02-03, v3.20.0-rc1~40^2) caused
`CMAKE_LIBRARY_ARCHITECTURE` to be populated on non-multiarch platforms
if their compilers happen to use `$arch/$version` library directories.
Revert the use of versioned library paths.
Fixes: #22024
This commit is contained in:
committed by
Brad King
parent
b7b0fb4303
commit
5d44d73bbe
@@ -22,17 +22,6 @@ function(cmake_parse_library_architecture implicit_dirs output_var)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(CMAKE_LIBRARY_ARCHITECTURE_REGEX_VERSIONED AND NOT library_arch)
|
||||
foreach(dir ${implicit_dirs})
|
||||
if("${dir}" MATCHES "/${CMAKE_LIBRARY_ARCHITECTURE_REGEX_VERSIONED}$")
|
||||
get_filename_component(arch "${dir}" DIRECTORY)
|
||||
get_filename_component(arch "${arch}" NAME)
|
||||
set(library_arch "${arch}")
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL QCC)
|
||||
foreach(dir ${implicit_dirs})
|
||||
if (dir MATCHES "/lib$")
|
||||
|
||||
@@ -48,7 +48,6 @@ endif()
|
||||
|
||||
# Match multiarch library directory names.
|
||||
set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-linux-gnu[a-z0-9_]*")
|
||||
set(CMAKE_LIBRARY_ARCHITECTURE_REGEX_VERSIONED "gcc/[a-z0-9_]+(-[a-z0-9_]+)?-linux(-gnu)?/[0-9]+(\\.[0-9]+\\.[0-9]+)*")
|
||||
|
||||
include(Platform/UnixPaths)
|
||||
|
||||
|
||||
@@ -104,10 +104,8 @@ endfunction()
|
||||
function(load_platform_info target)
|
||||
if(target MATCHES "linux-")
|
||||
set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-linux-gnu[a-z0-9_]*" PARENT_SCOPE)
|
||||
set(CMAKE_LIBRARY_ARCHITECTURE_REGEX_VERSIONED "gcc/[a-z0-9_]+(-[a-z0-9_]+)?-linux(-gnu)?/[0-9]+(\\.[0-9]+\\.[0-9]+)*" PARENT_SCOPE)
|
||||
else()
|
||||
unset(CMAKE_LIBRARY_ARCHITECTURE_REGEX PARENT_SCOPE)
|
||||
unset(CMAKE_LIBRARY_ARCHITECTURE_REGEX_VERSIONED PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
@@ -165,7 +163,7 @@ foreach(t ${targets})
|
||||
message("${t} parse failed: state=${state}, '${idirs}' does not match '${idirs_output}'")
|
||||
elseif(NOT "${implicit_libs}" STREQUAL "${implicit_lib_output}")
|
||||
message("${t} parse failed: state=${state}, '${implicit_libs}' does not match '${implicit_lib_output}'")
|
||||
elseif(library_arch AND NOT "${library_arch}" STREQUAL "${library_arch_output}")
|
||||
elseif((library_arch OR library_arch_output) AND NOT "${library_arch}" STREQUAL "${library_arch_output}")
|
||||
message("${t} parse failed: state=${state}, '${library_arch}' does not match '${library_arch_output}'")
|
||||
endif()
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
libs=imf;svml;irng;m;ipgo;decimal;cilkrts;stdc++;gcc;gcc_s;irc;svml;c;gcc;gcc_s;irc_s;dl;c
|
||||
dirs=/opt/intel/compilers_and_libraries_2018.0.128/linux/ipp/lib/intel64;/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/intel64_lin;/opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/lib/intel64_lin;/opt/intel/compilers_and_libraries_2018.0.128/linux/tbb/lib/intel64/gcc4.7;/usr/lib/gcc/x86_64-redhat-linux/4.8.5;/usr/lib64;/lib64;/usr/lib;/lib
|
||||
library_arch=x86_64-redhat-linux
|
||||
library_arch=
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
libs=pgmp;numa;pthread;pgmath;nspgc;pgc;m;gcc;c;gcc;gcc_s
|
||||
dirs=/mnt/pgi/linux86-64/18.10/lib;/usr/lib64;/usr/lib/gcc/x86_64-linux-gnu/7
|
||||
library_arch=x86_64-linux-gnu
|
||||
library_arch=
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
libs=xlopt;xl;dl;gcc_s;gcc;m;c;gcc_s;gcc
|
||||
dirs=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64;/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64;/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64;/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64;/usr/lib/gcc/ppc64-redhat-linux/4.4.7;/usr/lib64;/lib64;/usr/lib
|
||||
library_arch=ppc64-redhat-linux
|
||||
library_arch=
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
libs=xlopt;xl;dl;gcc_s;pthread;gcc;m;c;gcc_s;gcc
|
||||
dirs=/opt/ibm/xlsmp/5.1.0/lib;/opt/ibm/xlmass/9.1.0/lib;/opt/ibm/xlC/16.1.0/lib;/usr/lib/gcc/ppc64le-redhat-linux/4.8.5;/usr/lib64;/lib64;/usr/lib
|
||||
library_arch=ppc64le-redhat-linux
|
||||
library_arch=
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
libs=cudadevrt;cudart_static;rt;pthread;dl;xlopt;xl;ibmc++;stdc++;m;dl;gcc_s;gcc;pthread;m;c;gcc_s;gcc
|
||||
dirs=/sw/summit/cuda/10.1.168/targets/ppc64le-linux/lib/stubs;/sw/summit/cuda/10.1.168/targets/ppc64le-linux/lib;/autofs/nccs-svm1_sw/summit/.swci/1-compute/opt/spack/20180914/linux-rhel7-ppc64le/xl-16.1.1-3/spectrum-mpi-10.3.0.1-20190611-aqjt3jo53mogrrhcrd2iufr435azcaha/lib;/autofs/nccs-svm1_sw/summit/.swci/1-compute/opt/spack/20180914/linux-rhel7-ppc64le/gcc-4.8.5/darshan-runtime-3.1.7-csygoqyym3m3ysoaperhxlhoiluvpa2u/lib;/autofs/nccs-svm1_sw/summit/xl/16.1.1-3/xlsmp/5.1.1/lib;/autofs/nccs-svm1_sw/summit/xl/16.1.1-3/xlmass/9.1.1/lib;/autofs/nccs-svm1_sw/summit/xl/16.1.1-3/xlC/16.1.1/lib;/usr/lib/gcc/ppc64le-redhat-linux/4.8.5;/usr/lib64;/lib64;/autofs/nccs-svm1_sw/peak/.swci/1-compute/opt/spack/20180914/linux-rhel7-ppc64le/gcc-4.8.5/darshan-runtime-3.1.7-ytwv7xbkub6mqnpvygdthwqa7mhjqbc5/lib;/usr/lib
|
||||
library_arch=ppc64le-redhat-linux
|
||||
library_arch=
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
libs=imf;svml;irng;stdc++;m;ipgo;decimal;cilkrts;stdc++;gcc;gcc_s;irc;svml;c;gcc;gcc_s;irc_s;dl;c
|
||||
dirs=/opt/intel/compilers_and_libraries_2018.0.128/linux/ipp/lib/intel64;/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/intel64_lin;/opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/lib/intel64_lin;/opt/intel/compilers_and_libraries_2018.0.128/linux/tbb/lib/intel64/gcc4.7;/usr/lib/gcc/x86_64-redhat-linux/4.8.5;/usr/lib64;/lib64;/usr/lib;/lib
|
||||
library_arch=x86_64-redhat-linux
|
||||
library_arch=
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
libs=atomic;pgatm;stdc++;pgmp;numa;pthread;pgmath;nspgc;pgc;m;gcc;c;gcc;gcc_s
|
||||
dirs=/mnt/pgi/linux86-64/18.10/lib;/usr/lib64;/usr/lib/gcc/x86_64-linux-gnu/7
|
||||
library_arch=x86_64-linux-gnu
|
||||
library_arch=
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
libs=xlopt;xl;ibmc++;xlopt;xl;stdc++;m;dl;gcc_s;gcc;m;c;gcc_s;gcc;dl;gcc_s;gcc;m;c;gcc_s;gcc
|
||||
dirs=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64;/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64;/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64;/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64;/usr/lib/gcc/ppc64-redhat-linux/4.4.7;/usr/lib64;/lib64;/usr/lib
|
||||
library_arch=ppc64-redhat-linux
|
||||
library_arch=
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
libs=xlopt;xl;ibmc++;stdc++;m;dl;gcc_s;gcc;pthread;m;c;gcc_s;gcc
|
||||
dirs=/opt/ibm/xlsmp/5.1.0/lib;/opt/ibm/xlmass/9.1.0/lib;/opt/ibm/xlC/16.1.0/lib;/usr/lib/gcc/ppc64le-redhat-linux/4.8.5;/usr/lib64;/lib64;/usr/lib
|
||||
library_arch=ppc64le-redhat-linux
|
||||
library_arch=
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
libs=pgf90rtl;pgf90;pgf90_rpm1;pgf902;pgf90rtl;pgftnrtl;pgmp;numa;pthread;pgmath;nspgc;pgc;rt;pthread;m;gcc;c;gcc;gcc_s
|
||||
dirs=/mnt/pgi/linux86-64/18.10/lib;/usr/lib64;/usr/lib/gcc/x86_64-linux-gnu/7
|
||||
library_arch=x86_64-linux-gnu
|
||||
library_arch=
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
libs=xlf90;xlopt;xlomp_ser;xl;xlfmath;gcc_s;dl;rt;pthread;gcc;m;c;gcc_s;gcc
|
||||
dirs=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64;/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64;/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/lib64;/usr/lib/gcc/ppc64-redhat-linux/4.4.7;/usr/lib64;/lib64;/usr/lib
|
||||
library_arch=ppc64-redhat-linux
|
||||
library_arch=
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
libs=pgmp;numa;pthread;pgmath;nspgc;pgc;m;gcc;c;gcc;gcc_s
|
||||
dirs=/mnt/pgi/linux86-64/18.10/lib;/usr/lib64;/usr/lib/gcc/x86_64-linux-gnu/7
|
||||
library_arch=x86_64-linux-gnu2
|
||||
library_arch=
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
libs=xlopt;xl;dl;gcc_s;gcc;m;c;gcc_s;gcc
|
||||
dirs=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64;/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64;/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64;/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64;/usr/lib/gcc/ppc64-redhat-linux/4.4.7;/usr/lib64;/lib64;/usr/lib
|
||||
library_arch=ppc64-redhat-linux
|
||||
library_arch=
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
libs=atomic;pgatm;stdc++;pgmp;numa;pthread;pgmath;nspgc;pgc;m;gcc;c;gcc;gcc_s
|
||||
dirs=/mnt/pgi/linux86-64/18.10/lib;/usr/lib64;/usr/lib/gcc/x86_64-linux-gnu/7
|
||||
library_arch=x86_64-linux-gnu
|
||||
library_arch=
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
libs=xlopt;xl;ibmc++;xlopt;xl;stdc++;m;dl;gcc_s;gcc;m;c;gcc_s;gcc;dl;gcc_s;gcc;m;c;gcc_s;gcc
|
||||
dirs=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64;/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64;/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64;/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64;/usr/lib/gcc/ppc64-redhat-linux/4.4.7;/usr/lib64;/lib64;/usr/lib
|
||||
library_arch=ppc64-redhat-linux
|
||||
library_arch=
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
libs=pgf90rtl;pgf90;pgf90_rpm1;pgf902;pgf90rtl;pgftnrtl;pgmp;numa;pthread;pgmath;nspgc;pgc;rt;pthread;m;gcc;c;gcc;gcc_s
|
||||
dirs=/mnt/pgi/linux86-64/18.10/lib;/usr/lib64;/usr/lib/gcc/x86_64-linux-gnu/7
|
||||
library_arch=x86_64-linux-gnu
|
||||
library_arch=
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
libs=xlopt;xl;dl;gcc_s;gcc;m;c;gcc_s;gcc
|
||||
dirs=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64;/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64;/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64;/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64;/usr/lib/gcc/ppc64-redhat-linux/4.4.7;/usr/lib64;/lib64;/usr/lib
|
||||
library_arch=ppc64-redhat-linux
|
||||
library_arch=
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
libs=pgftnrtl;pgmp;numa;pthread;pgmath;nspgc;pgc;rt;pthread;m;gcc;c;gcc;gcc_s
|
||||
dirs=/mnt/pgi/linux86-64/18.10/lib;/usr/lib64;/usr/lib/gcc/x86_64-linux-gnu/7
|
||||
library_arch=x86_64-linux-gnu
|
||||
library_arch=
|
||||
|
||||
Reference in New Issue
Block a user