libPAW not compiling with Ninja

@mnguye1 When using Ninja as the build tool (instead of make), the PAW code doesn't compile.

This points to a problem in the CMake or in the logic of the build instructions.

This works:

cmake .. --install-prefix=$HOME -DCMAKE_BUILD_TYPE=Release  # uses GNU make
make

This doesn't work:

cmake .. -G Ninja --install-prefix=$HOME -DCMAKE_BUILD_TYPE=Release
ninja

I get

[471/665] Building Fortran object external_libs/libpaw_interface/CMakeFiles/paw_xc.dir/m_pawxc.F90.o
FAILED: external_libs/libpaw_interface/CMakeFiles/paw_xc.dir/m_pawxc.F90.o external_libs/libpaw_interface/m_pawxc.mod 
/usr/bin/gfortran -I/home/correaa/inq/external_libs/libpaw_interface -I/home/correaa/inq/build/external_libs/libpaw_interface/abi_xc_lowlevel -O3 -DNDEBUG -O3 -Jexternal_libs/libpaw_interface -fPIC -fpreprocessed -c external_libs/libpaw_interface/CMakeFiles/paw_xc.dir/m_pawxc.F90-pp.f90 -o external_libs/libpaw_interface/CMakeFiles/paw_xc.dir/m_pawxc.F90.o
/home/correaa/inq/external_libs/libpaw_interface/m_pawxc.F90:39:6:

   39 |  use m_drivexc,     only : drivexc,size_dvxc,xcmult,mkdenpos
      |      1
Fatal Error: Cannot open module file ‘m_drivexc.mod’ for reading at (1): No such file or directory
compilation terminated.
[484/665] Building Fortran object external_libs/l...erface/CMakeFiles/paw_level3.dir/m_pawrhoij.F90.o
ninja: build stopped: subcommand failed.

Digging deeper this error happens at the level of libpaw_interface already:

correaa@proart-linux:~/inq/external_libs/libpaw_interface/build$ cmake .. -G Ninja
CMake Warning (dev) at CMakeLists.txt:1 (project):
  cmake_minimum_required() should be called prior to this top-level project()
  call.  Please see the cmake-commands(7) manual for usage documentation of
  both commands.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is GNU 13.3.0
-- The CXX compiler identification is GNU 13.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The Fortran compiler identification is GNU 13.3.0
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /usr/bin/gfortran - skipped
-- Downloading Catch2 v3p3p2 for gpurun
-- Populating catch2
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/correaa/inq/external_libs/libpaw_interface/build/_deps/catch2-subbuild
[1/9] Creating directories for 'catch2-populate'
[1/9] Performing download step (git clone) for 'catch2-populate'
Cloning into 'catch2-src'...
remote: Enumerating objects: 8746, done.        
remote: Counting objects: 100% (8746/8746), done.        
remote: Compressing objects: 100% (5345/5345), done.        
remote: Total 8746 (delta 6709), reused 4622 (delta 3233), pack-reused 0 (from 0)        
Receiving objects: 100% (8746/8746), 6.70 MiB | 1.43 MiB/s, done.
Resolving deltas: 100% (6709/6709), done.
HEAD is now at 3f0283d v3.3.2
[2/9] Performing disconnected update step for 'catch2-populate'
[3/9] No patch_disconnected step for 'catch2-populate'
[5/9] No configure step for 'catch2-populate'
[6/9] No build step for 'catch2-populate'
[7/9] No install step for 'catch2-populate'
[8/9] No test step for 'catch2-populate'
[9/9] Completed 'catch2-populate'
-- Performing Test HAVE_FLAG__ffile_prefix_map__home_correaa_inq_external_libs_libpaw_interface_build__deps_catch2_src__
-- Performing Test HAVE_FLAG__ffile_prefix_map__home_correaa_inq_external_libs_libpaw_interface_build__deps_catch2_src__ - Success
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1") 
-- Checking for one of the modules 'fftw3'
-- 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: /usr/lib/x86_64-linux-gnu/libopenblas.so  
-- Looking for Fortran cheev
-- Looking for Fortran cheev - found
-- Found LAPACK: /usr/lib/x86_64-linux-gnu/libopenblas.so;-lm;-ldl  
-- Found MPI_CXX: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so (found version "3.1") 
-- Found MPI: TRUE (found version "3.1") found components: CXX 
-- Configuring done (10.8s)
-- Generating done (0.0s)
-- Build files have been written to: /home/correaa/inq/external_libs/libpaw_interface/build
correaa@proart-linux:~/inq/external_libs/libpaw_interface/build$ ninja
[24/257] Building Fortran object CMakeFiles/paw_libxc.dir/m_libpaw_libxc.F90.o
FAILED: CMakeFiles/paw_libxc.dir/m_libpaw_libxc.F90.o m_libpaw_libxc.mod m_libpaw_libxc_funcs.mod 
/usr/bin/gfortran -I/home/correaa/inq/external_libs/libpaw_interface -fPIC -fpreprocessed -c CMakeFiles/paw_libxc.dir/m_libpaw_libxc.F90-pp.f90 -o CMakeFiles/paw_libxc.dir/m_libpaw_libxc.F90.o
/home/correaa/inq/external_libs/libpaw_interface/m_libpaw_libxc.F90:37:6:

   37 |  USE_DEFS
      |      1
Fatal Error: Cannot open module file ‘m_libpaw_defs.mod’ for reading at (1): No such file or directory
compilation terminated.
[29/257] Building Fortran object CMakeFiles/paw_mpi.dir/m_libpaw_mpi.F90.o
FAILED: CMakeFiles/paw_mpi.dir/m_libpaw_mpi.F90.o m_libpaw_mpi.mod 
/usr/bin/gfortran -I/home/correaa/inq/external_libs/libpaw_interface -fPIC -fpreprocessed -c CMakeFiles/paw_mpi.dir/m_libpaw_mpi.F90-pp.f90 -o CMakeFiles/paw_mpi.dir/m_libpaw_mpi.F90.o
/home/correaa/inq/external_libs/libpaw_interface/m_libpaw_mpi.F90:28:6:

   28 |  USE_DEFS
      |      1
Fatal Error: Cannot open module file ‘m_libpaw_defs.mod’ for reading at (1): No such file or directory
compilation terminated.
[30/257] Building Fortran object CMakeFiles/paw_tools.dir/m_libpaw_tools.F90.o
FAILED: CMakeFiles/paw_tools.dir/m_libpaw_tools.F90.o m_libpaw_tools.mod 
/usr/bin/gfortran -I/home/correaa/inq/external_libs/libpaw_interface -fPIC -fpreprocessed -c CMakeFiles/paw_tools.dir/m_libpaw_tools.F90-pp.f90 -o CMakeFiles/paw_tools.dir/m_libpaw_tools.F90.o
/home/correaa/inq/external_libs/libpaw_interface/m_libpaw_tools.F90:26:6:

   26 |  USE_DEFS
      |      1
Fatal Error: Cannot open module file ‘m_libpaw_defs.mod’ for reading at (1): No such file or directory
compilation terminated.
[34/257] Building Fortran object CMakeFiles/paw_level1.dir/m_paral_atom.F90.o
FAILED: CMakeFiles/paw_level1.dir/m_paral_atom.F90.o m_paral_atom.mod 
/usr/bin/gfortran -I/home/correaa/inq/external_libs/libpaw_interface -fPIC -fpreprocessed -c CMakeFiles/paw_level1.dir/m_paral_atom.F90-pp.f90 -o CMakeFiles/paw_level1.dir/m_paral_atom.F90.o
/home/correaa/inq/external_libs/libpaw_interface/m_paral_atom.F90:27:6:

   27 |  USE_MSG_HANDLING
      |      1
Fatal Error: Cannot open module file ‘m_libpaw_tools.mod’ for reading at (1): No such file or directory
compilation terminated.
[35/257] Building Fortran object CMakeFiles/paw_level1.dir/m_paw_numeric.F90.o
FAILED: CMakeFiles/paw_level1.dir/m_paw_numeric.F90.o m_paw_numeric.mod 
/usr/bin/gfortran -I/home/correaa/inq/external_libs/libpaw_interface -fPIC -fpreprocessed -c CMakeFiles/paw_level1.dir/m_paw_numeric.F90-pp.f90 -o CMakeFiles/paw_level1.dir/m_paw_numeric.F90.o
/home/correaa/inq/external_libs/libpaw_interface/m_paw_numeric.F90:25:6:

   25 |  USE_MSG_HANDLING
      |      1
Fatal Error: Cannot open module file ‘m_libpaw_tools.mod’ for reading at (1): No such file or directory
compilation terminated.
[37/257] Building Fortran object CMakeFiles/paw_defs.dir/m_libpaw_defs.F90.o
ninja: build stopped: subcommand failed.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information