Regression: CMake post-3.29: NVHPC: cannot build CMake itself
Using NVHPC 24.1 on Linux I lost the ability to build CMake itself, with changes made in CMake post-3.29 development. This Git bisects to:
cd0b9e54 is the first bad commit
For reference, I also checked with Intel oneAPI and AMD AOCC, each of which continue to build CMake OK on master branch.
Zstd
Since this seems to involve Zstd, I verified I can build the upstream Zstd by itself (master branch or v1.5.5).
git clone https://github.com/facebook/zstd
cmake -S build/cmake -B buildn
-- The C compiler identification is NVHPC 24.1.0
-- The ASM compiler identification is unknown
-- Found assembler: /opt/nvidia/hpc_sdk/Linux_x86_64/2024/compilers/bin/nvc
-- The CXX compiler identification is NVHPC 24.1.0
...
cmake --build buildn
Observe that buildn/programs/zstd program links and runs.
Then I did git switch -d v1.5.5
and successfully build Zstd by itself again as above.
Symptom
Linking final top-level CMake executables, errors like the following -- they're all the same error, so I include one example:
[11/14] Linking CXX executable bin/cmake
FAILED: bin/cmake
: && /opt/nvidia/hpc_sdk/Linux_x86_64/2024/compilers/bin/nvc++ Source/CMakeFiles/cmake.dir/cmakemain.cxx.o Source/CMakeFiles/cmake.dir/cmcmd.cxx.o -o bin/cmake Source/libCMakeLib.a Utilities/std/libcmstd.a Source/kwsys/libcmsys.a Utilities/cmcurl/lib/libcmcurl.a Utilities/cmnghttp2/libcmnghttp2.a Utilities/cmexpat/libcmexpat.a Utilities/cmlibarchive/libarchive/libcmlibarchive.a /usr/lib64/libssl.so /usr/lib64/libcrypto.so Utilities/cmbzip2/libcmbzip2.a Utilities/cmliblzma/libcmliblzma.a Utilities/cmzstd/libcmzstd.a Utilities/cmlibrhash/libcmlibrhash.a Utilities/cmlibuv/libcmlibuv.a -ldl -lrt Utilities/cmzlib/libcmzlib.a Utilities/cmcppdap/libcmcppdap.a Utilities/cmjsoncpp/libcmjsoncpp.a && :
/usr/bin/ld: Utilities/cmzstd/libcmzstd.a(huf_decompress.c.o): in function `HUF_decompress4X1_usingDTable_internal':
cmake/Utilities/cmzstd/lib/decompress/huf_decompress.c:867: undefined reference to `HUF_decompress4X1_usingDTable_internal_fast_asm_loop'
/usr/bin/ld: Utilities/cmzstd/libcmzstd.a(huf_decompress.c.o): in function `HUF_decompress4X2_usingDTable_internal':
cmake/Utilities/cmzstd/lib/decompress/huf_decompress.c:1678: undefined reference to `HUF_decompress4X2_usingDTable_internal_fast_asm_loop'
Edited by scivision