cmake: Check for Fortran compiler early on

This commit is contained in:
Markus Mützel 2023-08-05 13:32:20 +02:00
parent 138ed79fe7
commit f047ca3111
2 changed files with 12 additions and 6 deletions

View File

@ -93,6 +93,17 @@ endif()
message(WARNING "CMake support is experimental. It does not yet support all build options and may not produce the same Makefiles that OpenBLAS ships with.")
if(NOT NOFORTRAN)
# Check for working Fortran compiler
include(CheckLanguage)
check_language(Fortran)
if(CMAKE_Fortran_COMPILER)
enable_language(Fortran)
else()
set(NOFORTRAN 1)
endif()
endif()
include("${PROJECT_SOURCE_DIR}/cmake/utils.cmake")
include("${PROJECT_SOURCE_DIR}/cmake/system.cmake")

View File

@ -20,12 +20,7 @@
# NEEDBUNDERSCORE
# NEED2UNDERSCORES
include(CheckLanguage)
check_language(Fortran)
if(CMAKE_Fortran_COMPILER)
enable_language(Fortran)
else()
set (NOFORTRAN 1)
if(NOT CMAKE_Fortran_COMPILER)
if (NOT NO_LAPACK)
if (NOT XXXXX)
message(STATUS "No Fortran compiler found, can build only BLAS and f2c-converted LAPACK")