Skip to content

Commit 4dc9c6b

Browse files
committed
cmake: Check Fortran compiler earlier in configuration.
1 parent 46bfee6 commit 4dc9c6b

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,17 @@ endif()
9393

9494
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.")
9595

96+
if(NOT NOFORTRAN)
97+
# Check for working Fortran compiler
98+
include(CheckLanguage)
99+
check_language(Fortran)
100+
if(CMAKE_Fortran_COMPILER)
101+
enable_language(Fortran)
102+
else()
103+
set (NOFORTRAN 1)
104+
endif()
105+
endif()
106+
96107
include("${PROJECT_SOURCE_DIR}/cmake/utils.cmake")
97108
include("${PROJECT_SOURCE_DIR}/cmake/system.cmake")
98109

cmake/f_check.cmake

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,7 @@
2020
# NEEDBUNDERSCORE
2121
# NEED2UNDERSCORES
2222

23-
include(CheckLanguage)
24-
check_language(Fortran)
25-
if(CMAKE_Fortran_COMPILER)
26-
enable_language(Fortran)
27-
else()
28-
set (NOFORTRAN 1)
23+
if(NOT CMAKE_Fortran_COMPILER)
2924
if (NOT NO_LAPACK)
3025
if (NOT XXXXX)
3126
message(STATUS "No Fortran compiler found, can build only BLAS and f2c-converted LAPACK")

0 commit comments

Comments
 (0)