Error if CMake tries to configure with read-only source directory
We maintain our internal test suites under Perforce. We have a test suite that builds and tests ScaLAPACK with the NVHPC compilers.
Our suite runs CMake in a separate directory from the source tree, which is stored in the source repo with read-only permissions. When CMake runs this way, we see the following error:
CMake Error: Unable to (re)create the private pkgRedirects directory:
/proj/ta/tests/techtips_repo/src/scalapack-2.2.2/BLACS/INSTALL/CMakeFiles/pkgRedirects
This may be caused by not having read/write access to the build directory.
Try specifying a location with read/write access like:
cmake -B build
If using a CMake presets file, ensure that preset parameter
'binaryDir' expands to a writable directory.
CMake Error at CMAKE/FortranMangling.cmake:33 (MESSAGE):
Configure in the BLACS INSTALL directory FAILED
Call Stack (most recent call first):
CMakeLists.txt:133 (COMPILE)
-- Configuring incomplete, errors occurred!
I am working around this for the moment by copying the source tree to a writable location. However, would you consider reworking this to allow configuration against a read-only source tree? Thanks in advance.
Can you expand on what the configure command was used, and is it reproducible with the latest branch (I don't think I've touched that, so maybe it still is). It might be resolved after having bumped the CMake policies though.
This still seems to be a problem with a TOT pull of ScaLAPACK from github:
cparrott@ice4 /tmp/foo $ git clone https://github.com/Reference-ScaLAPACK/scalapack.git Cloning into 'scalapack'... remote: Enumerating objects: 4933, done. remote: Counting objects: 100% (2064/2064), done. remote: Compressing objects: 100% (343/343), done. remote: Total 4933 (delta 1840), reused 1721 (delta 1721), pack-reused 2869 (from 1) Receiving objects: 100% (4933/4933), 3.89 MiB | 30.44 MiB/s, done. Resolving deltas: 100% (3952/3952), done. cparrott@ice4 /tmp/foo $ chmod -R a-w scalapack cparrott@ice4 /tmp/foo $ mkdir build cparrott@ice4 /tmp/foo $ cd build cparrott@ice4 /tmp/foo/build $ cmake -DBLAS_blas_LIBRARY="/proj/nv/Linux_x86_64/dev/compilers/lib/libblas.so" -DBUILD_TESTING=ON -DCDEFS=Add_ -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=nvc -DCMAKE_C_FLAGS_RELEASE="-O1 -DNDEBUG" -DCMAKE_Fortran_COMPILER=nvfortran -DCMAKE_Fortran_FLAGS_RELEASE="-O1 " -DCMAKE_INSTALL_PREFIX="/tmp/qa/techtips_scalapack-2.2.2_0/scalapack" -DLAPACK_lapack_LIBRARY="/proj/nv/Linux_x86_64/dev/compilers/lib/liblapack.so" -DMPI_C_COMPILER=mpicc -DMPI_Fortran_COMPILER=mpifort -DSCALAPACK_BUILD_TESTS=ON ../scalapack -- The C compiler identification is NVHPC 99.99.283802 -- The Fortran compiler identification is NVHPC 99.99.283802 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /proj/nv/Linux_x86_64/dev/compilers/bin/nvc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting Fortran compiler ABI info -- Detecting Fortran compiler ABI info - done -- Check for working Fortran compiler: /proj/nv/Linux_x86_64/dev/compilers/bin/nvfortran - skipped -- Found MPI_C: /proj/nv/Linux_x86_64/283802-dev/comm_libs/12.9/hpcx/hpcx-2.24/ompi/lib/libmpi.so (found version "3.1") -- Found MPI_Fortran: /proj/nv/Linux_x86_64/283802-dev/comm_libs/12.9/hpcx/hpcx-2.24/ompi/lib/libmpi_usempif08.so (found version "3.1") -- Found MPI: TRUE (found version "3.1") -- Found MPI_LIBRARY : TRUE -- --> MPI C Compiler : /proj/nv/Linux_x86_64/dev/comm_libs/mpi/bin/mpicc -- --> C Compiler : /proj/nv/Linux_x86_64/dev/compilers/bin/nvc -- --> MPI Fortran Compiler : /proj/nv/Linux_x86_64/dev/comm_libs/mpi/bin/mpifort -- --> Fortran Compiler : /proj/nv/Linux_x86_64/dev/compilers/bin/nvfortran -- ========= -- CHECKING BLAS AND LAPACK LIBRARIES -- --> Searching for optimized LAPACK and BLAS libraries on your machine. -- Looking for Fortran sgemm -- Looking for Fortran sgemm - not found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success -- Found Threads: TRUE -- Looking for Fortran sgemm -- Looking for Fortran sgemm - found -- Found BLAS: /proj/nv/Linux_x86_64/dev/compilers/lib/libblas.so -- Looking for Fortran cheev -- Looking for Fortran cheev - not found -- Looking for Fortran cheev -- Looking for Fortran cheev - found -- Found LAPACK: /proj/nv/Linux_x86_64/dev/compilers/lib/liblapack.so;/proj/nv/Linux_x86_64/dev/compilers/lib/libblas.so;-fortranlibs -- BLAS library: /proj/nv/Linux_x86_64/dev/compilers/lib/libblas.so -- LAPACK library: /proj/nv/Linux_x86_64/dev/compilers/lib/liblapack.so;/proj/nv/Linux_x86_64/dev/compilers/lib/libblas.so;-fortranlibs -- ========= CMake Error at PBLAS/TESTING/CMakeLists.txt:1 (file): file COPY cannot copy file "/tmp/foo/scalapack/PBLAS/TESTING/../SRC/PTOOLS/PB_Cwarn.c" to "/tmp/foo/scalapack/PBLAS/TESTING/PB_Cwarn.c": Permission denied.
CMake Error at PBLAS/TESTING/CMakeLists.txt:2 (file): file COPY cannot copy file "/tmp/foo/scalapack/PBLAS/TESTING/../SRC/PTOOLS/PB_Cabort.c" to "/tmp/foo/scalapack/PBLAS/TESTING/PB_Cabort.c": Permission denied.
CMake Error at PBLAS/TIMING/CMakeLists.txt:1 (file): file COPY cannot copy file "/tmp/foo/scalapack/PBLAS/TIMING/../SRC/PTOOLS/PB_Cwarn.c" to "/tmp/foo/scalapack/PBLAS/TIMING/PB_Cwarn.c": Permission denied.
CMake Error at PBLAS/TIMING/CMakeLists.txt:2 (file): file COPY cannot copy file "/tmp/foo/scalapack/PBLAS/TIMING/../SRC/PTOOLS/PB_Cabort.c" to "/tmp/foo/scalapack/PBLAS/TIMING/PB_Cabort.c": Permission denied.
-- Configuring incomplete, errors occurred!