Commit d77edf68 authored by Jussi Enkovaara's avatar Jussi Enkovaara
Browse files

Making parallel_io standalone project

parent 0f6e0812
......@@ -11,7 +11,7 @@
# CMake project
cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR)
project("8_IO" NONE)
include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/common.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/common.cmake)
# ==================================================================================================
......
Copyright 2015
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
# PRACE HPC Kernels
This project is part of PRACE CodeVault providing
example codes of common HPC kernels such as dense and sparse linear
algebra, spectral and N-body methods, structured and unstructured
grids, Monte Carlo methods and parallel I/O. The code samples are
published as open source and can be used both for educational purposes
and as parts of real application suites (as permitted by particular
license).
## How to contribute
Any contributions (new code samples, bug fixes, improvements etc.) are
warmly welcome. In order to contribute, please follow the standard
Gitlab workflow:
1. Fork the project into your personal space
2. Create a feature branch
3. Work on your contributions
4. Push the commit(s) to your fork
5. Submit a merge request to the master branch
## Compilation instructions
The pre-requisites are:
* CMake 2.8.10 or higher. CMake >= 3.0.0 if you want to build everything.
* A C++ compiler
* For advanced examples, C++11/14, OpenMP support, MPI, ISPC, CUDA, OpenCL ...
In order to build the code, follow the typical CMake steps for an
out-of-source build:
```bash
mkdir build
cd build
cmake ..
make
make install # optional
```
......@@ -11,7 +11,7 @@
# CMake project
cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
project("Hermite4" NONE)
include(${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/common.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/common.cmake)
# ==================================================================================================
......
# CorrectWindowsPaths - this module defines one macro
#
# CONVERT_CYGWIN_PATH( PATH )
# This uses the command cygpath (provided by cygwin) to convert
# unix-style paths into paths useable by cmake on windows
macro (CONVERT_CYGWIN_PATH _path)
if (WIN32)
EXECUTE_PROCESS(COMMAND cygpath.exe -m ${${_path}}
OUTPUT_VARIABLE ${_path})
string (STRIP ${${_path}} ${_path})
endif (WIN32)
endmacro (CONVERT_CYGWIN_PATH)
function(clone_source src dst)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${dst}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${src} ${CMAKE_CURRENT_BINARY_DIR}/${dst}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${src}
COMMENT "Clone ${src} to ${dst}"
)
endfunction()
function(dummy_install target_name lib_name)
install(CODE "MESSAGE(\"${target_name} can only be built with ${lib_name}.\")")
endfunction()
macro(get_sources_and_options _sources _option_list _option_name)
set( ${_sources} )
set( ${_option_list} )
set( _found_options False)
foreach(arg ${ARGN})
if ("x${arg}" STREQUAL "x${_option_name}")
set (_found_options True)
else()
if (_found_options)
list(APPEND ${_option_list} ${arg})
else()
list(APPEND ${_sources} ${arg})
endif()
endif()
endforeach()
endmacro()
# MACRO picks correct compiler flags. For example
# select_compiler_flags(cxx_flags
# GNU "-std=c++11 -mnative -Wall -Werror"
# Intel "-std=c++11 -axavx,core-avx2"
# CLANG "-std=c++11 -Weverything"
# PGI "-std=c++11"
# )
macro(select_compiler_flags _flags)
set( ${_flags} )
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(_compiler "GNU")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(_compiler "CLANG")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
set(_compiler "CLANG")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
set(_compiler "Intel")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(_compiler "MSCV")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "PGI")
set(_compiler "PGI")
endif()
set (_found_compiler False)
foreach(arg ${ARGN})
if ("x${arg}" STREQUAL "x${_compiler}")
set(_found_compiler True)
else()
if (_found_compiler)
set(${_flags} ${arg})
set(_found_compiler False)
endif()
endif()
endforeach()
endmacro()
# ==================================================================================================
# This file is part of the CodeVault project. The project is licensed under Apache Version 2.0.
# CodeVault is part of the EU-project PRACE-4IP (WP7.3.C).
#
# Author(s):
# Cedric Nugteren <cedric.nugteren@surfsara.nl>
#
# ==================================================================================================
#
# Defines the following variables:
# FFTW_FOUND Boolean holding whether or not the FFTW3 library was found
# FFTW_INCLUDE_DIRS The FFTW3 include directory
# FFTW_LIBRARIES The FFTW3 library
#
# In case FFTW3 is not installed in the default directory, set the FFTW_ROOT variable to point to
# the root of FFTW3, such that 'fftw3.h' can be found in $FFTW_ROOT/include. This can either be done
# using an environmental variable (e.g. export FFTW_ROOT=/path/to/fftw3) or using a CMake variable
# (e.g. cmake -DFFTW_ROOT=/path/to/fftw3 ..).
#
# ==================================================================================================
# Sets the possible install locations
set(FFTW_HINTS
${FFTW_ROOT}
$ENV{FFTW_ROOT}
)
set(FFTW_PATHS
/usr
/usr/local
)
# Finds the include directories
find_path(FFTW_INCLUDE_DIRS
NAMES fftw3.h
HINTS ${FFTW_HINTS}
PATH_SUFFIXES include api inc include/x86_64 include/x64
PATHS ${FFTW_PATHS}
DOC "FFTW3 include header fftw3.h"
)
mark_as_advanced(FFTW_INCLUDE_DIRS)
# Finds the library
find_library(FFTW_LIBRARIES
NAMES fftw3
HINTS ${FFTW_HINTS}
PATH_SUFFIXES lib lib64 lib/x86_64 lib/x64 lib/x86 lib/Win32
PATHS ${FFTW_PATHS}
DOC "FFTW3 library"
)
mark_as_advanced(FFTW_LIBRARIES)
# ==================================================================================================
# Notification messages
if(NOT FFTW_INCLUDE_DIRS)
message(STATUS "Could NOT find 'fftw3.h', install FFTW3 or set FFTW_ROOT")
endif()
if(NOT FFTW_LIBRARIES)
message(STATUS "Could NOT find the FFTW3 library, install it or set FFTW_ROOT")
endif()
# Determines whether or not FFTW3 was found
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(FFTW DEFAULT_MSG FFTW_INCLUDE_DIRS FFTW_LIBRARIES)
# ==================================================================================================
find_package(Common)
SET(ISPC_VERSION_REQUIRED "1.8.2")
IF (NOT ISPC_EXECUTABLE)
# if ($ENV{ISPC})
# FIND_PROGRAM(ISPC_EXECUTABLE NAME ispc PATH $ENV{ISPC} DOC "Path to the ISPC executable.")
# endif()
FIND_PROGRAM(ISPC_EXECUTABLE ispc DOC "Path to the ISPC executable.")
IF (NOT ISPC_EXECUTABLE)
MESSAGE(STATUS "Intel SPMD Compiler (ISPC) is not found.")
ELSE()
MESSAGE(STATUS "Found Intel SPMD Compiler (ISPC): ${ISPC_EXECUTABLE}")
set(ISPC_FOUND True)
ENDIF()
ENDIF()
if (NOT ISPC_EXECUTABLE)
set(ISPC_FOUND False)
else(NOT ISPC_EXECUTABLE)
set(ISPC_FOUND True)
IF(NOT ISPC_VERSION)
EXECUTE_PROCESS(COMMAND ${ISPC_EXECUTABLE} --version OUTPUT_VARIABLE ISPC_OUTPUT)
STRING(REGEX MATCH " ([0-9]+[.][0-9]+[.][0-9]+)(dev|knl|ptx)? " DUMMY "${ISPC_OUTPUT}")
SET(ISPC_VERSION ${CMAKE_MATCH_1})
#IF (ISPC_VERSION VERSION_LESS ISPC_VERSION_REQUIRED)
# MESSAGE(FATAL_ERROR "Need at least version ${ISPC_VERSION_REQUIRED} of Intel SPMD Compiler (ISPC).")
# ENDIF()
MESSAGE(STATUS "Found ISPC version ${ISPC_VERSION}")
SET(ISPC_VERSION ${ISPC_VERSION} CACHE STRING "ISPC Version")
MARK_AS_ADVANCED(ISPC_VERSION)
MARK_AS_ADVANCED(ISPC_EXECUTABLE)
ENDIF()
function(ispc_compile _obj_list)
get_sources_and_options(sources compile_flags "COMPILE_FLAGS" ${ARGN})
set(__XEON__ True)
IF (__XEON__)
SET (ISPC_TARGET_EXT ${CMAKE_CXX_OUTPUT_EXTENSION})
ELSE()
SET (ISPC_TARGET_EXT .cpp)
SET (ISPC_ADDITIONAL_ARGS ${ISPC_ADDITIONAL_ARGS} --opt=force-aligned-memory)
ENDIF()
IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(ISPC_ARCHITECTURE "x86-64")
ELSE()
SET(ISPC_ARCHITECTURE "x86")
ENDIF()
SET(ISPC_TARGET_DIR ${CMAKE_CURRENT_BINARY_DIR})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${ISPC_TARGET_DIR})
IF(ISPC_INCLUDE_DIR)
STRING(REPLACE ";" ";-I;" ISPC_INCLUDE_DIR_PARMS "${ISPC_INCLUDE_DIR}")
SET(ISPC_INCLUDE_DIR_PARMS "-I" ${ISPC_INCLUDE_DIR_PARMS})
ENDIF()
set(___XEON___ True)
IF (__XEON__)
STRING(REPLACE ";" "," ISPC_TARGET_ARGS "${ISPC_TARGETS}")
ELSE()
# SET(ISPC_TARGET_ARGS generic-16)
#SET(ISPC_ADDITIONAL_ARGS ${ISPC_ADDITIONAL_ARGS} --emit-c++ -D__XEON_PHI__ --c++-include-file=${ISPC_DIR}/examples/intrinsics/knc.h)j
ENDIF()
SET(ISPC_OBJECTS ${${_obj_list}})
foreach (src ${sources})
get_filename_component(fname ${src} NAME_WE)
get_filename_component(dir ${src} PATH)
IF("${dir}" STREQUAL "")
SET(outdir ${ISPC_TARGET_DIR})
ELSE("${dir}" STREQUAL "")
SET(outdir ${ISPC_TARGET_DIR}/${dir})
ENDIF("${dir}" STREQUAL "")
SET(outdirh ${ISPC_TARGET_DIR})
SET(deps "")
IF (EXISTS ${outdir}/${fname}.dev.idep)
FILE(READ ${outdir}/${fname}.dev.idep contents)
STRING(REPLACE " " ";" contents "${contents}")
STRING(REPLACE ";" "\\\\;" contents "${contents}")
STRING(REPLACE "\n" ";" contents "${contents}")
FOREACH(dep ${contents})
IF (EXISTS ${dep})
SET(deps ${deps} ${dep})
ENDIF (EXISTS ${dep})
ENDFOREACH(dep ${contents})
ENDIF ()
SET(results "${outdir}/${fname}.dev${ISPC_TARGET_EXT}")
# if we have multiple targets add additional object files
IF (__XEON__)
LIST(LENGTH ISPC_TARGETS NUM_TARGETS)
IF (NUM_TARGETS GREATER 1)
FOREACH(target ${ISPC_TARGETS})
SET(results ${results} "${outdir}/${fname}.dev_${target}${ISPC_TARGET_EXT}")
ENDFOREACH()
ENDIF()
ENDIF()
IF (WIN32)
SET(ISPC_ADDITIONAL_ARGS ${ISPC_ADDITIONAL_ARGS} --dllexport)
ELSE()
SET(ISPC_ADDITIONAL_ARGS ${ISPC_ADDITIONAL_ARGS} --pic)
ENDIF()
separate_arguments(compile_flags)
ADD_CUSTOM_COMMAND(
OUTPUT ${results} ${outdirh}/${fname}_ispc.h
COMMAND ${CMAKE_COMMAND} -E make_directory ${outdir}
COMMAND ${ISPC_EXECUTABLE}
${compile_flags}
-I ${CMAKE_CURRENT_SOURCE_DIR}
${ISPC_INCLUDE_DIR_PARMS}
--arch=${ISPC_ARCHITECTURE}
# --addressing=${EMBREE_ISPC_ADDRESSING}
# -O3
#--target=${ISPC_TARGET_ARGS}
#--woff
# --opt=fast-math
${ISPC_ADDITIONAL_ARGS}
-h ${outdirh}/${fname}_ispc.h
-MMM ${outdir}/${fname}.dev.idep
-o ${outdir}/${fname}.dev${ISPC_TARGET_EXT}
${CMAKE_CURRENT_SOURCE_DIR}/${src}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${src} ${deps}
COMMENT "Building ISPC object ${outdir}/${fname}.dev${ISPC_TARGET_EXT}"
)
SET(ISPC_OBJECTS ${ISPC_OBJECTS} ${results})
endforeach()
set(${_obj_list} ${ISPC_OBJECTS} PARENT_SCOPE)
endfunction()
endif(NOT ISPC_EXECUTABLE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/Languages")
enable_language(ICPC OPTIONAL)
enable_language(IFORT OPTIONAL)
find_package(Common)
set(ICPC_FOUND True)
if (${CMAKE_ICPC_COMPILER} STREQUAL "CMAKE_ICPC_COMPILER-NOTFOUND")
set(ICPC_FOUND False)
else()
function(icpc_sources)
get_sources_and_options(sources compile_flags "COMPILE_FLAGS" ${ARGN})
set_source_files_properties(${sources} PROPERTIES LANGUAGE ICPC)
foreach (file ${sources})
set_property(SOURCE ${file} APPEND_STRING PROPERTY COMPILE_FLAGS " -I${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_CXX_FLAGS} ${compile_flags} ")
endforeach()
endfunction()
function(icpc_add_executable icpc_target)
get_sources_and_options(sources link_flags "LINK_FLAGS" ${ARGN})
add_executable(${icpc_target} ${sources})
set_target_properties(${icpc_target} PROPERTIES LINKER_LANGUAGE ICPC)
set_property(TARGET ${icpc_target} APPEND_STRING PROPERTY LINK_FLAGS " ${link_flags} ")
endfunction()
endif()
set(IFORT_FOUND True)
if (${CMAKE_IFORT_COMPILER} STREQUAL "CMAKE_IFORT_COMPILER-NOTFOUND")
set(IFORT_FOUND False)
else()
#function(ifort_sources)
#set_source_files_properties(${ARGN} PROPERTIES LANGUAGE IFORT)
#endfunction()
#function(ifort_add_executable ifort_target)
#add_executable(${ifort_target} ${ARGN})
#set_target_properties(${ifort_target} PROPERTIES LINKER_LANGUAGE IFORT)
# endfunction()
function(ifort_sources)
get_sources_and_options(sources compile_flags "COMPILE_FLAGS" ${ARGN})
set_source_files_properties(${sources} PROPERTIES LANGUAGE IFORT)
foreach (file ${sources})
set_property(SOURCE ${file} APPEND_STRING PROPERTY COMPILE_FLAGS " ${compile_flags} ")
endforeach()
endfunction()
function(ifort_add_executable ifort_target)
get_sources_and_options(sources link_flags "LINK_FLAGS" ${ARGN})
add_executable(${ifort_target} ${sources})
set_target_properties(${ifort_target} PROPERTIES LINKER_LANGUAGE IFORT)
set_property(TARGET ${ifort_target} APPEND_STRING PROPERTY LINK_FLAGS " ${link_flags} ")
endfunction()
endif()
#(C) https://github.com/capitalaslash/cmake-modules/blob/master/FindLibmesh.cmake
# (BSD - License)
# - Try to find Libmesh
# Once done this will define
#
# LIBMESH_FOUND - Libmesh has been successfully found
# LIBMESH_INCLUDE_DIRS - Libmesh include directories
# LIBMESH_LIBRARIES - Libmesh libraries
# LIBMESH_DEFINITIONS - Libmesh definitions
# LIBMESH_FLAGS - Libmesh flags
# LIBMESH_VERSION_STRING - Libmesh version
#
# Usage:
# find_package(Libmesh)
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
if("${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE NONE)
endif()
string(TOUPPER ${CMAKE_BUILD_TYPE} BUILD_TYPE_UPPER)
if(${BUILD_TYPE_UPPER} MATCHES DEBUG)
set(METHOD dbg)
else()
set(METHOD opt)
endif()
set(METHOD opt)
#message(STATUS "linking against ${METHOD} libmesh library")
# required for LIBMESH_DEFINITIONS
find_package(PkgConfig REQUIRED)
set(LIBMESH_DIR LIBMESH_DIR-NOTFOUND CACHE PATH "Libmesh installation directory")
if(LIBMESH_DIR)
set(ENV{PKG_CONFIG_PATH} ${LIBMESH_DIR}/lib/pkgconfig)
message($ENV{PKG_CONFIG_PATH})
endif()
pkg_check_modules(PC_LIBMESH libmesh-${METHOD})
#message(STATUS "PC_LIBMESH_FOUND = ${PC_LIBMESH_FOUND}")
#message(STATUS "PC_LIBMESH_LIBRARIES = ${PC_LIBMESH_LIBRARIES}")
#message(STATUS "PC_LIBMESH_LIBRARY_DIRS = ${PC_LIBMESH_LIBRARY_DIRS}")
# distinguish flags and definitions (-D...)
#message(STATUS "PC_LIBMESH_CFLAGS_OTHER = ${PC_LIBMESH_CFLAGS_OTHER}")
foreach(FLAG ${PC_LIBMESH_CFLAGS_OTHER})
if(${FLAG} MATCHES "^[-][D].+")
set(PC_LIBMESH_CFLAGS_DEFS "${PC_LIBMESH_CFLAGS_DEFS} ${FLAG}")
else()
set(PC_LIBMESH_CFLAGS_FLAGS "${PC_LIBMESH_CFLAGS_FLAGS} ${FLAG}")
endif()
endforeach()
set(LIBMESH_DEFINITIONS ${PC_LIBMESH_CFLAGS_DEFS})
set(LIBMESH_FLAGS ${PC_LIBMESH_CFLAGS_FLAGS})
find_path(LIBMESH_INCLUDE_DIR libmesh/libmesh.h
HINTS ${PC_LIBMESH_INCLUDEDIR} ${PC_LIBMESH_INCLUDE_DIRS}
PATH_SUFFIXES libmesh
)
find_library(LIBMESH_LIBRARY
NAMES mesh_${METHOD} libmesh
HINTS ${PC_LIBMESH_LIBDIR} ${PC_LIBMESH_LIBARY_DIRS}
)
set(LIBMESH_LIBRARIES ${LIBMESH_LIBRARY})
set(LIBMESH_INCLUDE_DIRS ${LIBMESH_INCLUDE_DIR})
find_program( LIBMESH_CONFIG_EXECUTABLE
NAMES libmesh-config
HINTS ${LIBMESH_DIR} $ENV{LIBMESH_DIR}
PATH_SUFFIXES bin
DOC "libmesh-config executable"
)
mark_as_advanced( LIBMESH_CONFIG_EXECUTABLE )
exec_program( ${LIBMESH_CONFIG_EXECUTABLE}
ARGS --include
OUTPUT_VARIABLE LMC_INC_FLAG
RETURN_VALUE LMC_INC_RET
)
string(REPLACE " " ";" LMC_INC_LIST ${LMC_INC_FLAG})
foreach( IPATH ${LMC_INC_LIST} )
string(REGEX REPLACE "^-I" "" IPATH ${IPATH})
string(REGEX REPLACE "//" "/" IPATH ${IPATH})
list(APPEND LM_INC ${IPATH})
endforeach()
set(LIBMESH_INCLUDE_DIRS ${LM_INC})
if(PC_LIBMESH_VERSION)
set(LIBMESH_VERSION_STRING ${PC_LIBMESH_VERSION})
endif()
# handle the QUIETLY and REQUIRED arguments and set LIBMESH_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libmesh
FOUND_VAR LIBMESH_FOUND
REQUIRED_VARS LIBMESH_LIBRARIES LIBMESH_INCLUDE_DIRS LIBMESH_DEFINITIONS
LIBMESH_FLAGS
VERSION_VAR LIBMESH_VERSION_STRING
)
mark_as_advanced(
LIBMESH_INCLUDE_DIR
LIBMESH_LIBRARIES
LIBMESH_CONFIG_EXECUTABLE
)
\ No newline at end of file
# a simple cmake script to locate Intel Math Kernel Library
# This script looks for two places:
# - the environment variable MKLROOT
# - the directory /opt/intel/mkl
# Stage 1: find the root directory
set(MKLROOT_PATH $ENV{MKLROOT})
if (NOT MKLROOT_PATH)
# try to find at /opt/intel/mkl
if (EXISTS "/opt/intel/mkl")
set(MKLROOT_PATH "/opt/intel/mkl")
endif (EXISTS "/opt/intel/mkl")
endif (NOT MKLROOT_PATH)
# Stage 2: find include path and libraries
if (MKLROOT_PATH)
# root-path found
set(EXPECT_MKL_INCPATH "${MKLROOT_PATH}/include")
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(EXPECT_MKL_LIBPATH "${MKLROOT_PATH}/lib")
endif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(EXPECT_ICC_LIBPATH "$ENV{ICC_LIBPATH}")
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
if (CMAKE_SIZEOF_VOID_P MATCHES 8)
set(EXPECT_MKL_LIBPATH "${MKLROOT_PATH}/lib/intel64")
else (CMAKE_SIZEOF_VOID_P MATCHES 8)
set(EXPECT_MKL_LIBPATH "${MKLROOT_PATH}/lib/ia32")
endif (CMAKE_SIZEOF_VOID_P MATCHES 8)
endif (CMAKE_SYSTEM_NAME MATCHES "Linux")
# set include
if (IS_DIRECTORY ${EXPECT_MKL_INCPATH})
set(MKL_INCLUDE_DIR ${EXPECT_MKL_INCPATH})
endif (IS_DIRECTORY ${EXPECT_MKL_INCPATH})
if (IS_DIRECTORY ${EXPECT_MKL_LIBPATH})
set(MKL_LIBRARY_DIR ${EXPECT_MKL_LIBPATH})
endif (IS_DIRECTORY ${EXPECT_MKL_LIBPATH})
# find specific library files
find_library(LIB_MKL_RT NAMES mkl_rt HINTS ${MKL_LIBRARY_DIR})
find_library(LIB_PTHREAD NAMES pthread)
endif (MKLROOT_PATH)
set(MKL_LIBRARY
${LIB_MKL_RT}
${LIB_PTHREAD})
# deal with QUIET and REQUIRED argument
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MKL DEFAULT_MSG
MKL_LIBRARY_DIR
LIB_MKL_RT
LIB_PTHREAD
MKL_INCLUDE_DIR)
mark_as_advanced(LIB_MKL_RT LIB_PTHREAD MKL_INCLUDE_DIR)