Seemingly incorrect find_package(OpenMP)
This leads to a failure if the C compiler does not support OpenMP (clang
on macOS in the default set-up). The next line suggests that the OpenMP support for C compiler is not even needed. Hence, it should not be checked for: find_package(OpenMP COMPONENTS Fortran REQUIRED)
.
Also, the modification of CMAKE_Fortran_FLAGS
is plain wrong. Never do that, please. The best alternative in this case is probably using OpenMP::OpenMP_Fortran
.