Fujitsu: Fortran+Ninja does not work
Consider the following CMakeLists.txt:
cmake_minimum_required(VERSION 3.20)
project(Fugaku LANGUAGES Fortran)
find_package(OpenMP COMPONENTS Fortran)
find_package(MPI COMPONENTS Fortran)
On Fugaku,
- CC/CXX/FC: Fujitsu compilers
- cmake: 4e5893b6
- ninja: 1.10.1
OpenMP and MPI Fortran components are successfully found with Unix Makefiles
generator, the default,
whereas not with Ninja
;
C/C++ ones are successfully found with the both generators.
language | generator | FindOpenMP | FindMPI |
---|---|---|---|
C | Unix Makefiles | Y | Y |
C | Ninja | Y | Y |
CXX | Unix Makefiles | Y | Y |
CXX | Ninja | Y | Y |
Fortran | Unix Makefiles | Y | Y |
Fortran | Ninja | N | N |
Here I don’t put the detailed output because they are perhaps confidential.
It seems that:
-
CMAKE_Fortran_VERBOSE_FLAG
is set to-###
; if the flag is supplied, Fujitsu Fortran compiler, frtpx, prints the executed commands to stdout - Fujitsu Fortran compiler prints preprocessed Fortran source code to stdout, which is redirected to a file used by Ninja; the commands in 1 are also redirected
- Consequently, FindOpenMP and FindMPI fail due to compilation error
Edited by Brad King