Skip to content

Commit

Permalink
Merge pull request #8 from GEOS-ESM/feature/mathomp4/mkl-is-optional
Browse files Browse the repository at this point in the history
Updates to allow GEOS to build without MKL
  • Loading branch information
tclune authored Sep 22, 2020
2 parents eb7b411 + 8b22490 commit 1d84126
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
14 changes: 13 additions & 1 deletion NCEP_gfsio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,19 @@ esma_set_this ()

esma_add_library (${this}
SRCS gfsio_module.f90 gfsio_solve_axb.F90
DEPENDENCIES GMAO_mpeu NCEP_bacio_r4i4 NCEP_w3_r4i4 ${MKL_LIBRARIES}
DEPENDENCIES GMAO_mpeu NCEP_bacio_r4i4 NCEP_w3_r4i4
)

if (APPLE)
set(MKL_Fortran TRUE)
endif ()
find_package(MKL)
if (MKL_FOUND)
set(BLA_VENDOR Intel10_64lp_seq)
target_link_libraries(${this} PRIVATE ${MKL_LIBRARIES})
else ()
find_package(LAPACK REQUIRED)
target_link_libraries(${this} PRIVATE ${LAPACK_LIBRARIES})
endif ()

set (CMAKE_Fortran_FLAGS_RELEASE "-O3 ${BIG_ENDIAN} ${common_Fortran_flags} ${GEOS_Fortran_Release_FPE_Flags} ${ALIGNCOM}")
12 changes: 11 additions & 1 deletion NCEP_sp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,17 @@ set (CMAKE_Fortran_FLAGS_RELEASE "-O2 ${GEOS_Fortran_Release_FPE_Flags} ${EXTEND

esma_add_library (${this} SRCS ${srcs} DEPENDENCIES NCEP_w3_${precision})

target_link_libraries(${this} PUBLIC ${MKL_LIBRARIES})
if (APPLE)
set(MKL_Fortran TRUE)
endif ()
find_package(MKL)
if (MKL_FOUND)
set(BLA_VENDOR Intel10_64lp_seq)
target_link_libraries(${this} PRIVATE ${MKL_LIBRARIES})
else ()
find_package(LAPACK REQUIRED)
target_link_libraries(${this} PRIVATE ${LAPACK_LIBRARIES})
endif ()

if (precision MATCHES "r4i4")
# use default real/int precisions
Expand Down

0 comments on commit 1d84126

Please sign in to comment.