FindMPI: Hangs on // in path
When building libsupermesh, cmake hangs and keeps creating forks in the background. Only happens if there are double slashes (//
) in some paths.
Affected:
- cmake 3.16.3
- cmake 3.24.1
Not affected:
- cmake 3.2.3
Tested on system:
- Ubuntu 20.04.4 LTS
- gcc 9.4.0-1ubuntu1~20.04.1
- mpich 3.3.2-2build1
Symptoms:
Cmake hangs in FindMPI, creating subprocesses in the background. Last lines printed:
-- Found MPI_C: /usr/lib/x86_64-linux-gnu/libmpich.so (found version "3.1")
-- Found MPI_CXX: /usr/bin/mpicxx (found version "3.1")
Steps to reproduce:
wget https://bitbucket.org/libsupermesh/libsupermesh/get/69012e50dc6b.tar.bz2 -O libsupermesh-69012e50dc6b.tar.bz2
tar xf libsupermesh-69012e50dc6b.tar.bz2
cd libsupermesh-libsupermesh-69012e50dc6b/build
export CXX=/usr/bin/mpicxx
# Note the double slash in the path
MPI_BIN=/usr//bin
cmake .. \
-DMPI_C_COMPILER=$MPI_BIN/mpicc \
-DMPI_CXX_COMPILER=$MPI_BIN/mpicxx \
-DMPI_Fortran_COMPILER=$MPI_BIN/mpif90 \
-DCMAKE_Fortran_COMPILER=$MPI_BIN/mpif90
Edited by Brad King