diff --git a/NCEP_gfsio/CMakeLists.txt b/NCEP_gfsio/CMakeLists.txt index 92a5412..b09b7ed 100644 --- a/NCEP_gfsio/CMakeLists.txt +++ b/NCEP_gfsio/CMakeLists.txt @@ -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}") diff --git a/NCEP_sp/CMakeLists.txt b/NCEP_sp/CMakeLists.txt index 725d20b..20b3a36 100644 --- a/NCEP_sp/CMakeLists.txt +++ b/NCEP_sp/CMakeLists.txt @@ -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