diff options
author | Robert Maynard <rmaynard@nvidia.com> | 2021-04-05 19:28:54 (GMT) |
---|---|---|
committer | Robert Maynard <rmaynard@nvidia.com> | 2021-04-05 21:41:10 (GMT) |
commit | 764606e25616e9f47eceb3227a3b38fcef544820 (patch) | |
tree | 7a37b1499cf84a1da7fbae42f84c460f2c645eaf /Tests/RunCMake/ParseImplicitLinkInfo | |
parent | 5d44d73bbeaf04412aa744354cca9de8376cdfed (diff) | |
download | CMake-764606e25616e9f47eceb3227a3b38fcef544820.zip CMake-764606e25616e9f47eceb3227a3b38fcef544820.tar.gz CMake-764606e25616e9f47eceb3227a3b38fcef544820.tar.bz2 |
CMakeDetermineCompilerABI: Extract lib arch from implicit object file paths
The NVHPC compiler does not have any implicit link directories that can
be used to detect `CMAKE_LIBRARY_ARCHITECTURE`, but it does have
implicit object files. Extract implicit object file paths from link
lines and check them for the `CMAKE_LIBRARY_ARCHITECTURE` pattern.
Issue: #22024
Diffstat (limited to 'Tests/RunCMake/ParseImplicitLinkInfo')
6 files changed, 14 insertions, 5 deletions
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake index 87feda9..1f3468b 100644 --- a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake +++ b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake @@ -28,6 +28,7 @@ set(targets linux-Fortran-PGI-18.10.1 linux_pgf77-Fortran-PGI-18.10.1 linux_nostdinc-C-PGI-18.10.1 linux_nostdinc-CXX-PGI-18.10.1 linux_nostdinc-Fortran-PGI-18.10.1 + linux-C-NVHPC-21.1.0 linux-CXX-NVHPC-21.1.0 linux-C-XL-12.1.0 linux-CXX-XL-12.1.0 linux-Fortran-XL-14.1.0 linux_nostdinc-C-XL-12.1.0 linux_nostdinc-CXX-XL-12.1.0 linux_nostdinc_i-C-XL-12.1.0 linux_nostdinc-CXX-XL-12.1.0 @@ -132,6 +133,7 @@ foreach(t ${targets}) # Need to handle files with empty entries for both libs or dirs set(implicit_lib_output "") set(idirs_output "") + set(implicit_objs "") set(library_arch_output "") file(STRINGS ${outfile} outputs) foreach(line IN LISTS outputs) @@ -147,10 +149,11 @@ foreach(t ${targets}) endforeach() cmake_parse_implicit_link_info("${input}" implicit_libs idirs implicit_fwks log - "${CMAKE_${lang}_IMPLICIT_OBJECT_REGEX}") + "${CMAKE_${lang}_IMPLICIT_OBJECT_REGEX}" + COMPUTE_IMPLICIT_OBJECTS implicit_objs) set(library_arch) - cmake_parse_library_architecture("${idirs}" library_arch) + cmake_parse_library_architecture(${lang} "${idirs}" "${implicit_objs}" library_arch) # File format # file(WRITE ${outfile} "libs=${implicit_libs}\ndirs=${idirs}\nlibrary_arch=${library_arch}") diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-NVHPC-21.1.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-NVHPC-21.1.0.output new file mode 100644 index 0000000..e932be9 --- /dev/null +++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-NVHPC-21.1.0.output @@ -0,0 +1,3 @@ +libs=nvomp;dl;nvhpcatm;atomic;pthread;nvcpumath;nsnvc;nvc;m;gcc;c;gcc;gcc_s +dirs=/opt/nvidia/hpc_sdk/Linux_x86_64/21.1/compilers/lib;/usr/lib64;/usr/lib/gcc/x86_64-linux-gnu/9 +library_arch=x86_64-linux-gnu diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-PGI-18.10.1.output index dc17ce7..7931102 100644 --- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-PGI-18.10.1.output +++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-PGI-18.10.1.output @@ -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= +library_arch=x86_64-linux-gnu diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-NVHPC-21.1.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-NVHPC-21.1.0.output new file mode 100644 index 0000000..e7f7d05 --- /dev/null +++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-NVHPC-21.1.0.output @@ -0,0 +1,3 @@ +libs=atomic;nvhpcatm;stdc++;nvomp;dl;nvhpcatm;atomic;pthread;nvcpumath;nsnvc;nvc;m;gcc;c;gcc;gcc_s +dirs=/opt/nvidia/hpc_sdk/Linux_x86_64/21.1/compilers/lib;/usr/lib64;/usr/lib/gcc/x86_64-linux-gnu/9 +library_arch=x86_64-linux-gnu diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-PGI-18.10.1.output index a7c14d2..cd15054 100644 --- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-PGI-18.10.1.output +++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-PGI-18.10.1.output @@ -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= +library_arch=x86_64-linux-gnu diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-PGI-18.10.1.output index 955d540..f3cc551 100644 --- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-PGI-18.10.1.output +++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-PGI-18.10.1.output @@ -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= +library_arch=x86_64-linux-gnu |