Last active
October 18, 2018 17:08
-
-
Save scivision/bddf416190320e844bd6b5f9846b1396 to your computer and use it in GitHub Desktop.
Minimal Fortran Intel MKL CMake -- assuming you want MKL BLAS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.1) | |
project(mytest Fortran) | |
# NOTE: -fdefault-integer-8 -m64 are crucial for MKL to avoid SIGSEGV at runtime! | |
add_compile_options(-fdefault-integer-8 -m64) | |
add_executable(inteld intel_dgemm.f90) | |
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") | |
# https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor | |
find_package(MKL) | |
if(MKL_FOUND) | |
include_directories(${MKL_INCLUDE_DIRS}) | |
target_link_libraries(inteld ${MKL_LIBRARIES} pthread dl) | |
else() | |
find_package(BLAS REQUIRED) | |
target_link_libraries(inteld blas) | |
endif() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Requires https://gist.github.com/scivision/5108cf6ab1515f581a84cd9ad1ef72aa
See https://github.com/scivision/python-performance for a full demo