4.2.0 build fails with clang as the base compilers
I am trying to build mpich/4.2.0 with clang as the base compilers for C/C++ and CUDA. The machine is Perlmutter.
Versions used: cuda/12.2 clang/17.0.6
However, I got the same issue even when using cuda/11.7 and clang/17.0.2
configure fails with the following error message:
checking cuda_runtime_api.h usability... yes
checking cuda_runtime_api.h presence... yes
checking for cuda_runtime_api.h... yes
checking for cudaStreamSynchronize in -lcudart... yes
configure: WARNING: Using user-provided nvcc: 'clang++'
checking whether nvcc works... no
configure: error: CUDA was requested but it is not functional
configure: error: YAKSA configure failed
Here is my configure command:
./configure --prefix=path-to-install --enable-fast=O2 --with-pm=no --with-pmi=cray --with-xpmem=/opt/cray/xpmem/default --with-wrapper-dl-type=rpath --enable-threads=multiple --enable-shared=yes --enable-static=no --with-namepublisher=file --with-libfabric=/opt/cray/libfabric/1.15.2.0 --with-libfabric-include=/opt/cray/libfabric/1.15.2.0/include --with-libfabric-lib=/opt/cray/libfabric/1.15.2.0/lib64 --with-device=ch4:ofi --with-ch4-shmmods=posix,xpmem --enable-thread-cs=per-vci --with-cuda=/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/cuda/12.2 CC=clang CXX=clang++ NVCC=clang++ NVCC_FLAGS=-allow-unsupported-compiler --disable-fortran CPPFLAGS=-I/opt/cray/pe/pmi/default/include 'LDFLAGS=-L/opt/cray/pe/pmi/default/lib -L/opt/cray/libfabric/1.15.2.0/lib64 -L/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/cuda/12.2/lib64 -fPIE' 'LIBS=-lpmi -lpmi2 -Wl,--as-needed,-l cudart,--no-as-needed -lcuda' MPICHLIB_CFLAGS=-fPIC MPICHLIB_CXXFLAGS=-fPIC
Is there a specific configure option other than NVCC=clang++ NVCC_FLAGS=-allow-unsupported-compiler that is necessary for the configuration to work?
@rgayatri23 Does remove the custom NVCC and NVCC_FLAGS (thus using native nvcc) work?
@hzhou - No it gives a similar error
checking alignment of double... 8
checking alignment of long double... 16
checking cuda_runtime_api.h usability... yes
checking cuda_runtime_api.h presence... yes
checking for cuda_runtime_api.h... yes
checking for cudaStreamSynchronize in -lcudart... yes
checking whether nvcc works... no
configure: error: CUDA was requested but it is not functional
configure: error: YAKSA configure failed
@rgayatri23 could you share the modules loaded?
@thomasgillis here are the moduels in my env:
1) craype-x86-milan 3) craype-network-ofi 5) perftools-base/23.03.0 7) craype-accel-nvidia80 9) mpich/4.1.1 (mpi) 11) cudatoolkit/11.7 (g)
2) libfabric/1.15.2.0 4) xpmem/2.6.2-2.5_2.33__gd067c3f.shasta 6) cpe/23.03 8) gpu/1.0 10) PrgEnv-llvm/0.1 12) llvm/17.0.6 (c)
FYI - The issue does not happen if I use llvm/16 versions.