Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for optional MKL and support for aarch64 #115

Merged
merged 9 commits into from
Sep 22, 2020
11 changes: 8 additions & 3 deletions GNU.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,12 @@ set (GEOS_Fortran_Debug_FPE_Flags "${common_Fortran_fpe_flags}")

# GEOS Release
# ------------
set (GEOS_Fortran_Release_Flags "${FOPT3} -march=westmere -mtune=generic -funroll-loops ${DEBINFO}")
if ( ${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL aarch64 )
set(GNU_TARGET_ARCH "armv8.2-a+crypto+crc+fp16+rcpc+dotprod")
else ()
set(GNU_TARGET_ARCH "westmere")
endif ()
set (GEOS_Fortran_Release_Flags "${FOPT3} -march=${GNU_TARGET_ARCH} -mtune=generic -funroll-loops ${DEBINFO}")
set (GEOS_Fortran_Release_FPE_Flags "${common_Fortran_fpe_flags}")

# GEOS Vectorize
Expand All @@ -135,11 +140,11 @@ set (GEOS_Fortran_Release_FPE_Flags "${common_Fortran_fpe_flags}")

# Options per Jerry DeLisle on GCC Fortran List
#set (GEOS_Fortran_Vect_Flags "${FOPT2} -march=native -ffast-math -ftree-vectorize -funroll-loops --param max-unroll-times=4 -mprefer-avx128 -mno-fma")
#set (GEOS_Fortran_Vect_FPE_Flags "${DEBINFO} ${TRACEBACK}")
#set (GEOS_Fortran_Vect_FPE_Flags "${DEBINFO} ${TRACEBACK} ${MISMATCH} ${ALLOW_BOZ}")

# Options per Jerry DeLisle on GCC Fortran List with SVML (does not seem to help)
#set (GEOS_Fortran_Vect_Flags "-O2 -march=native -ffast-math -ftree-vectorize -funroll-loops --param max-unroll-times=4 -mprefer-avx128 -mno-fma -mveclibabi=svml")
#set (GEOS_Fortran_Vect_FPE_Flags "${DEBINFO} ${TRACEBACK}")
#set (GEOS_Fortran_Vect_FPE_Flags "${DEBINFO} ${TRACEBACK} ${MISMATCH} ${ALLOW_BOZ}")

# Until good options can be found, make vectorize equal common flags
set (GEOS_Fortran_Vect_Flags ${GEOS_Fortran_Release_Flags})
Expand Down
41 changes: 30 additions & 11 deletions esma.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,37 @@ set(MPI_DETERMINE_LIBRARY_VERSION TRUE)
find_package (MPI REQUIRED)

if (APPLE)
if (DEFINED ENV{MKLROOT})
set (MKL_Fortran True)
find_package (MKL REQUIRED)
else ()
if ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
#USE FRAMEWORK
message(STATUS "Found macOS and gfortran, using framework Accelerate")
link_libraries("-framework Accelerate")
endif ()
endif ()
else ()
find_package (MKL REQUIRED)
endif ()
find_package(MKL)
if (MKL_FOUND)
ecbuild_info("Found MKL:")
ecbuild_info(" MKL_INCLUDE_DIRS: ${MKL_INCLUDE_DIRS}")
ecbuild_info(" MKL_LIBRARIES: ${MKL_LIBRARIES}")

set(BLA_VENDOR Intel10_64lp_seq)
endif ()

find_package(LAPACK REQUIRED)
if (LAPACK_FOUND)
ecbuild_info("Found LAPACK:")
ecbuild_info(" LAPACK_LINKER_FLAGS: ${LAPACK_LINKER_FLAGS}")
ecbuild_info(" LAPACK_LIBRARIES: ${LAPACK_LIBRARIES}")
if (LAPACK95_FOUND)
ecbuild_info("Found LAPACK95:")
ecbuild_info(" LAPACK95_LIBRARIES: ${LAPACK95_LIBRARIES}")
endif ()
endif ()

find_package(BLAS REQUIRED)
if (BLAS_FOUND)
ecbuild_info("Found BLAS:")
ecbuild_info(" BLAS_LINKER_FLAGS: ${BLAS_LINKER_FLAGS}")
ecbuild_info(" BLAS_LIBRARIES: ${BLAS_LIBRARIES}")
if (BLAS95_FOUND)
ecbuild_info("Found BLAS95:")
ecbuild_info(" BLAS95_LIBRARIES: ${BLAS95_LIBRARIES}")
endif ()
endif ()

option (ESMA_ALLOW_DEPRECATED "suppress warnings about deprecated features" ON)
Expand Down