Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
morse_cmake
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
solverstack
morse_cmake
Compare Revisions
376ef84365284898e734d4d8e17359981cae8b7f...33a182878f9049c47af1fce3e86e72b9a10e7f7a
Source
33a182878f9049c47af1fce3e86e72b9a10e7f7a
Select Git revision
...
Target
376ef84365284898e734d4d8e17359981cae8b7f
Select Git revision
Compare
Commits (2)
add ARMPL detection in blas
· 34e2b383
PRUVOST Florent
authored
Mar 08, 2019
34e2b383
Add MPI_COMPLEX64 for pastix and future chameleon
· 33a18287
Mathieu Faverge
authored
Mar 08, 2019
33a18287
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
893 additions
and
791 deletions
+893
-791
modules/find/FindBLAS.cmake
modules/find/FindBLAS.cmake
+892
-791
modules/precision_generator/subs.py
modules/precision_generator/subs.py
+1
-0
No files found.
modules/find/FindBLAS.cmake
View file @
33a18287
...
...
@@ -74,7 +74,7 @@
## Intel10_32 (intel mkl v10 32 bit), Intel10_64lp (intel mkl v10 64 bit,lp thread model, lp64 model),
## Intel10_64lp_seq (intel mkl v10 64 bit,sequential code, lp64 model),
## Intel( older versions of mkl 32 and 64 bit),
## ACML, ACML_MP, ACML_GPU, Apple, NAS, Generic, User (see BLAS_LIBRARIES_USER)
## A
RMPL, A
CML, ACML_MP, ACML_GPU, Apple, NAS, Generic, User (see BLAS_LIBRARIES_USER)
# C/CXX should be enabled to use Intel mkl
###
# We handle different modes to find the dependency
...
...
@@ -161,6 +161,7 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
set
(
${
LIBRARIES
}
)
set
(
_combined_name
)
set
(
ENV_MKLROOT
"$ENV{MKLROOT}"
)
set
(
ENV_ARMPL
"$ENV{ARMPL_DIR}"
)
set
(
ENV_BLAS_DIR
"$ENV{BLAS_DIR}"
)
set
(
ENV_BLAS_LIBDIR
"$ENV{BLAS_LIBDIR}"
)
if
(
NOT _libdir
)
...
...
@@ -170,11 +171,11 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
list
(
APPEND _libdir
"
${
BLAS_DIR
}
"
)
list
(
APPEND _libdir
"
${
BLAS_DIR
}
/lib"
)
if
(
"
${
CMAKE_SIZEOF_VOID_P
}
"
EQUAL
"8"
)
list
(
APPEND _libdir
"
${
BLAS_DIR
}
/lib64"
)
list
(
APPEND _libdir
"
${
BLAS_DIR
}
/lib/intel64"
)
list
(
APPEND _libdir
"
${
BLAS_DIR
}
/lib64"
)
list
(
APPEND _libdir
"
${
BLAS_DIR
}
/lib/intel64"
)
else
()
list
(
APPEND _libdir
"
${
BLAS_DIR
}
/lib32"
)
list
(
APPEND _libdir
"
${
BLAS_DIR
}
/lib/ia32"
)
list
(
APPEND _libdir
"
${
BLAS_DIR
}
/lib32"
)
list
(
APPEND _libdir
"
${
BLAS_DIR
}
/lib/ia32"
)
endif
()
elseif
(
ENV_BLAS_LIBDIR
)
list
(
APPEND _libdir
"
${
ENV_BLAS_LIBDIR
}
"
)
...
...
@@ -182,30 +183,33 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
list
(
APPEND _libdir
"
${
ENV_BLAS_DIR
}
"
)
list
(
APPEND _libdir
"
${
ENV_BLAS_DIR
}
/lib"
)
if
(
"
${
CMAKE_SIZEOF_VOID_P
}
"
EQUAL
"8"
)
list
(
APPEND _libdir
"
${
ENV_BLAS_DIR
}
/lib64"
)
list
(
APPEND _libdir
"
${
ENV_BLAS_DIR
}
/lib/intel64"
)
list
(
APPEND _libdir
"
${
ENV_BLAS_DIR
}
/lib64"
)
list
(
APPEND _libdir
"
${
ENV_BLAS_DIR
}
/lib/intel64"
)
else
()
list
(
APPEND _libdir
"
${
ENV_BLAS_DIR
}
/lib32"
)
list
(
APPEND _libdir
"
${
ENV_BLAS_DIR
}
/lib/ia32"
)
list
(
APPEND _libdir
"
${
ENV_BLAS_DIR
}
/lib32"
)
list
(
APPEND _libdir
"
${
ENV_BLAS_DIR
}
/lib/ia32"
)
endif
()
else
()
if
(
ENV_MKLROOT
)
list
(
APPEND _libdir
"
${
ENV_MKLROOT
}
/lib"
)
if
(
"
${
CMAKE_SIZEOF_VOID_P
}
"
EQUAL
"8"
)
list
(
APPEND _libdir
"
${
ENV_MKLROOT
}
/lib64"
)
list
(
APPEND _libdir
"
${
ENV_MKLROOT
}
/lib/intel64"
)
else
()
list
(
APPEND _libdir
"
${
ENV_MKLROOT
}
/lib32"
)
list
(
APPEND _libdir
"
${
ENV_MKLROOT
}
/lib/ia32"
)
endif
()
list
(
APPEND _libdir
"
${
ENV_MKLROOT
}
/lib"
)
if
(
"
${
CMAKE_SIZEOF_VOID_P
}
"
EQUAL
"8"
)
list
(
APPEND _libdir
"
${
ENV_MKLROOT
}
/lib64"
)
list
(
APPEND _libdir
"
${
ENV_MKLROOT
}
/lib/intel64"
)
else
()
list
(
APPEND _libdir
"
${
ENV_MKLROOT
}
/lib32"
)
list
(
APPEND _libdir
"
${
ENV_MKLROOT
}
/lib/ia32"
)
endif
()
endif
()
if
(
ENV_ARMPL
)
list
(
APPEND _libdir
"
${
ENV_ARMPL
}
/lib"
)
endif
()
list
(
APPEND _libdir
"$ENV{LIBRARY_PATH}"
)
if
(
WIN32
)
string
(
REPLACE
":"
";"
_libdir2
"$ENV{LIB}"
)
string
(
REPLACE
":"
";"
_libdir2
"$ENV{LIB}"
)
elseif
(
APPLE
)
string
(
REPLACE
":"
";"
_libdir2
"$ENV{DYLD_LIBRARY_PATH}"
)
string
(
REPLACE
":"
";"
_libdir2
"$ENV{DYLD_LIBRARY_PATH}"
)
else
()
string
(
REPLACE
":"
";"
_libdir2
"$ENV{LD_LIBRARY_PATH}"
)
string
(
REPLACE
":"
";"
_libdir2
"$ENV{LD_LIBRARY_PATH}"
)
endif
()
list
(
APPEND _libdir
"
${
_libdir2
}
"
)
list
(
APPEND _libdir
"
${
CMAKE_C_IMPLICIT_LINK_DIRECTORIES
}
"
)
...
...
@@ -221,33 +225,33 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
if
(
_libraries_work
)
if
(
BLA_STATIC
)
if
(
WIN32
)
set
(
CMAKE_FIND_LIBRARY_SUFFIXES .lib
${
CMAKE_FIND_LIBRARY_SUFFIXES
}
)
endif
()
if
(
APPLE
)
set
(
CMAKE_FIND_LIBRARY_SUFFIXES .lib
${
CMAKE_FIND_LIBRARY_SUFFIXES
}
)
else
()
set
(
CMAKE_FIND_LIBRARY_SUFFIXES .a
${
CMAKE_FIND_LIBRARY_SUFFIXES
}
)
endif
()
if
(
WIN32
)
set
(
CMAKE_FIND_LIBRARY_SUFFIXES .lib
${
CMAKE_FIND_LIBRARY_SUFFIXES
}
)
endif
()
if
(
APPLE
)
set
(
CMAKE_FIND_LIBRARY_SUFFIXES .lib
${
CMAKE_FIND_LIBRARY_SUFFIXES
}
)
else
()
set
(
CMAKE_FIND_LIBRARY_SUFFIXES .a
${
CMAKE_FIND_LIBRARY_SUFFIXES
}
)
endif
()
else
()
if
(
CMAKE_SYSTEM_NAME STREQUAL
"Linux"
)
# for ubuntu's libblas3gf and liblapack3gf packages
set
(
CMAKE_FIND_LIBRARY_SUFFIXES
${
CMAKE_FIND_LIBRARY_SUFFIXES
}
.so.3gf
)
endif
()
if
(
CMAKE_SYSTEM_NAME STREQUAL
"Linux"
)
# for ubuntu's libblas3gf and liblapack3gf packages
set
(
CMAKE_FIND_LIBRARY_SUFFIXES
${
CMAKE_FIND_LIBRARY_SUFFIXES
}
.so.3gf
)
endif
()
endif
()
if
(
EXISTS
${
_library
}
)
set
(
${
_prefix
}
_
${
_library
}
_LIBRARY
${
_library
}
)
set
(
${
_prefix
}
_
${
_library
}
_LIBRARY
${
_library
}
)
else
()
find_library
(
${
_prefix
}
_
${
_library
}
_LIBRARY
NAMES
${
_library
}
HINTS
${
_libdir
}
)
find_library
(
${
_prefix
}
_
${
_library
}
_LIBRARY
NAMES
${
_library
}
HINTS
${
_libdir
}
)
endif
()
mark_as_advanced
(
${
_prefix
}
_
${
_library
}
_LIBRARY
)
# Print status if not found
# -------------------------
if
(
NOT
${
_prefix
}
_
${
_library
}
_LIBRARY AND NOT BLAS_FIND_QUIETLY AND BLAS_VERBOSE
)
Print_Find_Library_Blas_Status
(
blas
${
_library
}
${
_libdir
}
)
Print_Find_Library_Blas_Status
(
blas
${
_library
}
${
_libdir
}
)
endif
()
set
(
${
LIBRARIES
}
${${
LIBRARIES
}}
${${
_prefix
}
_
${
_library
}
_LIBRARY
}
)
set
(
_libraries_work
${${
_prefix
}
_
${
_library
}
_LIBRARY
}
)
...
...
@@ -265,8 +269,8 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
set
(
CMAKE_REQUIRED_FLAGS
"
${
BLAS_CFLAGS_OTHER
}
"
)
if
(
BLAS_VERBOSE
)
message
(
"
${
Cyan
}
BLAS libs found for BLA_VENDOR
${
BLA_VENDOR
}
."
"Try to compile symbol
${
_name
}
with following libraries:"
"
${
CMAKE_REQUIRED_LIBRARIES
}
"
)
"Try to compile symbol
${
_name
}
with following libraries:"
"
${
CMAKE_REQUIRED_LIBRARIES
}
"
)
endif
()
if
(
NOT BLAS_FOUND
)
unset
(
${
_prefix
}${
_combined_name
}
_WORKS CACHE
)
...
...
@@ -361,30 +365,30 @@ if( PKG_CONFIG_EXECUTABLE AND NOT BLAS_GIVEN_BY_USER AND BLA_PREFER_PKGCONFIG)
endif
()
elseif
(
BLA_VENDOR STREQUAL
"All"
)
if
((
NOT BLAS_FOUND
)
AND
(
NOT BLA_F95
)
AND NOT
((
_LANGUAGES_ MATCHES Fortran
)
AND
(
CMAKE_Fortran_COMPILER_ID STREQUAL
"GNU"
))
AND
NOT
(
CMAKE_C_COMPILER_ID STREQUAL
"GNU"
))
(
NOT BLA_F95
)
AND NOT
((
_LANGUAGES_ MATCHES Fortran
)
AND
(
CMAKE_Fortran_COMPILER_ID STREQUAL
"GNU"
))
AND
NOT
(
CMAKE_C_COMPILER_ID STREQUAL
"GNU"
))
pkg_search_module
(
BLAS mkl-
${
MKL_STR_BLA_STATIC
}
-lp64-iomp
)
if
(
BLAS_FOUND
)
set
(
BLAS_VENDOR_FOUND
"Intel MKL Multithreaded"
)
set
(
BLAS_LIBRARIES_PAR
"
${
BLAS_LIBRARIES
}
"
)
set
(
BLAS_VENDOR_FOUND
"Intel MKL Multithreaded"
)
set
(
BLAS_LIBRARIES_PAR
"
${
BLAS_LIBRARIES
}
"
)
endif
()
pkg_search_module
(
BLAS mkl-
${
MKL_STR_BLA_STATIC
}
-lp64-seq
)
if
(
BLAS_FOUND
)
set
(
BLAS_VENDOR_FOUND
"Intel MKL Sequential"
)
set
(
BLAS_LIBRARIES_SEQ
"
${
BLAS_LIBRARIES
}
"
)
set
(
BLAS_VENDOR_FOUND
"Intel MKL Sequential"
)
set
(
BLAS_LIBRARIES_SEQ
"
${
BLAS_LIBRARIES
}
"
)
endif
()
endif
()
if
(
NOT BLAS_FOUND
)
pkg_search_module
(
BLAS openblas
)
if
(
BLAS_FOUND
)
set
(
BLAS_VENDOR_FOUND
"Openblas"
)
set
(
BLAS_VENDOR_FOUND
"Openblas"
)
endif
()
endif
()
if
(
NOT BLAS_FOUND
)
pkg_search_module
(
BLAS blas
)
if
(
BLAS_FOUND
)
set
(
BLAS_VENDOR_FOUND
"Netlib or other Generic libblas"
)
set
(
BLAS_VENDOR_FOUND
"Netlib or other Generic libblas"
)
endif
()
endif
()
endif
()
...
...
@@ -394,8 +398,8 @@ if( PKG_CONFIG_EXECUTABLE AND NOT BLAS_GIVEN_BY_USER AND BLA_PREFER_PKGCONFIG)
message
(
STATUS
"Looking for BLAS - found using PkgConfig"
)
else
()
message
(
STATUS
"
${
Magenta
}
Looking for BLAS - not found using PkgConfig."
"
\n
Perhaps you should add the directory containing blas.pc to"
"
\n
the PKG_CONFIG_PATH environment variable.
${
ColourReset
}
"
)
"
\n
Perhaps you should add the directory containing blas.pc to"
"
\n
the PKG_CONFIG_PATH environment variable.
${
ColourReset
}
"
)
endif
()
endif
()
...
...
@@ -423,28 +427,28 @@ if( (NOT BLAS_FOUND_WITH_PKGCONFIG) OR BLAS_GIVEN_BY_USER )
set
(
ENV_BLAS_DIR
"$ENV{BLAS_DIR}"
)
set
(
ENV_BLAS_INCDIR
"$ENV{BLAS_INCDIR}"
)
if
(
ENV_BLAS_INCDIR
)
list
(
APPEND _inc_env
"
${
ENV_BLAS_INCDIR
}
"
)
list
(
APPEND _inc_env
"
${
ENV_BLAS_INCDIR
}
"
)
elseif
(
ENV_BLAS_DIR
)
list
(
APPEND _inc_env
"
${
ENV_BLAS_DIR
}
"
)
list
(
APPEND _inc_env
"
${
ENV_BLAS_DIR
}
/include"
)
list
(
APPEND _inc_env
"
${
ENV_BLAS_DIR
}
"
)
list
(
APPEND _inc_env
"
${
ENV_BLAS_DIR
}
/include"
)
else
()
if
(
ENV_MKLROOT
)
list
(
APPEND _inc_env
"
${
ENV_MKLROOT
}
/include"
)
endif
()
# system variables
if
(
WIN32
)
string
(
REPLACE
":"
";"
_path_env
"$ENV{INCLUDE}"
)
list
(
APPEND _inc_env
"
${
_path_env
}
"
)
else
()
string
(
REPLACE
":"
";"
_path_env
"$ENV{INCLUDE}"
)
list
(
APPEND _inc_env
"
${
_path_env
}
"
)
string
(
REPLACE
":"
";"
_path_env
"$ENV{C_INCLUDE_PATH}"
)
list
(
APPEND _inc_env
"
${
_path_env
}
"
)
string
(
REPLACE
":"
";"
_path_env
"$ENV{CPATH}"
)
list
(
APPEND _inc_env
"
${
_path_env
}
"
)
string
(
REPLACE
":"
";"
_path_env
"$ENV{INCLUDE_PATH}"
)
list
(
APPEND _inc_env
"
${
_path_env
}
"
)
endif
()
if
(
ENV_MKLROOT
)
list
(
APPEND _inc_env
"
${
ENV_MKLROOT
}
/include"
)
endif
()
# system variables
if
(
WIN32
)
string
(
REPLACE
":"
";"
_path_env
"$ENV{INCLUDE}"
)
list
(
APPEND _inc_env
"
${
_path_env
}
"
)
else
()
string
(
REPLACE
":"
";"
_path_env
"$ENV{INCLUDE}"
)
list
(
APPEND _inc_env
"
${
_path_env
}
"
)
string
(
REPLACE
":"
";"
_path_env
"$ENV{C_INCLUDE_PATH}"
)
list
(
APPEND _inc_env
"
${
_path_env
}
"
)
string
(
REPLACE
":"
";"
_path_env
"$ENV{CPATH}"
)
list
(
APPEND _inc_env
"
${
_path_env
}
"
)
string
(
REPLACE
":"
";"
_path_env
"$ENV{INCLUDE_PATH}"
)
list
(
APPEND _inc_env
"
${
_path_env
}
"
)
endif
()
endif
()
list
(
APPEND _inc_env
"
${
CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
}
"
)
list
(
REMOVE_DUPLICATES _inc_env
)
...
...
@@ -452,48 +456,48 @@ if( (NOT BLAS_FOUND_WITH_PKGCONFIG) OR BLAS_GIVEN_BY_USER )
# set paths where to look for
set
(
PATH_TO_LOOK_FOR
"
${
_inc_env
}
"
)
# Try to find the
fftw
header in the given paths
# Try to find the
mkl
header in the given paths
# -------------------------------------------------
# call cmake macro to find the header path
if
(
BLAS_INCDIR
)
set
(
BLAS_mkl.h_DIRS
"BLAS_mkl.h_DIRS-NOTFOUND"
)
find_path
(
BLAS_mkl.h_DIRS
NAMES mkl.h
HINTS
${
BLAS_INCDIR
}
)
set
(
BLAS_mkl.h_DIRS
"BLAS_mkl.h_DIRS-NOTFOUND"
)
find_path
(
BLAS_mkl.h_DIRS
NAMES mkl.h
HINTS
${
BLAS_INCDIR
}
)
else
()
if
(
BLAS_DIR
)
set
(
BLAS_mkl.h_DIRS
"BLAS_mkl.h_DIRS-NOTFOUND"
)
find_path
(
BLAS_mkl.h_DIRS
NAMES mkl.h
HINTS
${
BLAS_DIR
}
PATH_SUFFIXES
"include"
)
else
()
set
(
BLAS_mkl.h_DIRS
"BLAS_mkl.h_DIRS-NOTFOUND"
)
find_path
(
BLAS_mkl.h_DIRS
NAMES mkl.h
HINTS
${
PATH_TO_LOOK_FOR
}
)
endif
()
if
(
BLAS_DIR
)
set
(
BLAS_mkl.h_DIRS
"BLAS_mkl.h_DIRS-NOTFOUND"
)
find_path
(
BLAS_mkl.h_DIRS
NAMES mkl.h
HINTS
${
BLAS_DIR
}
PATH_SUFFIXES
"include"
)
else
()
set
(
BLAS_mkl.h_DIRS
"BLAS_mkl.h_DIRS-NOTFOUND"
)
find_path
(
BLAS_mkl.h_DIRS
NAMES mkl.h
HINTS
${
PATH_TO_LOOK_FOR
}
)
endif
()
endif
()
mark_as_advanced
(
BLAS_mkl.h_DIRS
)
# If found, add path to cmake variable
# ------------------------------------
if
(
BLAS_mkl.h_DIRS
)
set
(
BLAS_INCLUDE_DIRS
"
${
BLAS_mkl.h_DIRS
}
"
)
set
(
BLAS_INCLUDE_DIRS
"
${
BLAS_mkl.h_DIRS
}
"
)
else
()
set
(
BLAS_INCLUDE_DIRS
"BLAS_INCLUDE_DIRS-NOTFOUND"
)
if
(
NOT BLAS_FIND_QUIETLY
)
message
(
STATUS
"Looking for BLAS -- mkl.h not found"
)
endif
()
set
(
BLAS_INCLUDE_DIRS
"BLAS_INCLUDE_DIRS-NOTFOUND"
)
if
(
NOT BLAS_FIND_QUIETLY
)
message
(
STATUS
"Looking for BLAS -- mkl.h not found"
)
endif
()
endif
()
list
(
APPEND _libdir
"$ENV{LIBRARY_PATH}"
)
if
(
WIN32
)
string
(
REPLACE
":"
";"
_libdir2
"$ENV{LIB}"
)
string
(
REPLACE
":"
";"
_libdir2
"$ENV{LIB}"
)
elseif
(
APPLE
)
string
(
REPLACE
":"
";"
_libdir2
"$ENV{DYLD_LIBRARY_PATH}"
)
string
(
REPLACE
":"
";"
_libdir2
"$ENV{DYLD_LIBRARY_PATH}"
)
else
()
string
(
REPLACE
":"
";"
_libdir2
"$ENV{LD_LIBRARY_PATH}"
)
string
(
REPLACE
":"
";"
_libdir2
"$ENV{LD_LIBRARY_PATH}"
)
endif
()
list
(
APPEND _libdir
"
${
_libdir2
}
"
)
list
(
APPEND _libdir
"
${
CMAKE_C_IMPLICIT_LINK_DIRECTORIES
}
"
)
...
...
@@ -501,347 +505,347 @@ if( (NOT BLAS_FOUND_WITH_PKGCONFIG) OR BLAS_GIVEN_BY_USER )
# --------
set
(
OMP_iomp5_LIBRARY
"OMP_iomp5_LIBRARY-NOTFOUND"
)
find_library
(
OMP_iomp5_LIBRARY
NAMES iomp5
HINTS
${
_libdir
}
)
NAMES iomp5
HINTS
${
_libdir
}
)
mark_as_advanced
(
OMP_iomp5_LIBRARY
)
set
(
OMP_LIB
""
)
# libgomp
# -------
set
(
OMP_gomp_LIBRARY
"OMP_gomp_LIBRARY-NOTFOUND"
)
find_library
(
OMP_gomp_LIBRARY
NAMES gomp
HINTS
${
_libdir
}
)
NAMES gomp
HINTS
${
_libdir
}
)
mark_as_advanced
(
OMP_gomp_LIBRARY
)
# choose one or another depending on the compilo
if
(
CMAKE_C_COMPILER_ID STREQUAL
"GNU"
)
if
(
OMP_gomp_LIBRARY
)
set
(
OMP_LIB
"
${
OMP_gomp_LIBRARY
}
"
)
endif
()
if
(
OMP_gomp_LIBRARY
)
set
(
OMP_LIB
"
${
OMP_gomp_LIBRARY
}
"
)
endif
()
else
(
CMAKE_C_COMPILER_ID STREQUAL
"Intel"
)
if
(
OMP_iomp5_LIBRARY
)
set
(
OMP_LIB
"
${
OMP_iomp5_LIBRARY
}
"
)
endif
()
if
(
OMP_iomp5_LIBRARY
)
set
(
OMP_LIB
"
${
OMP_iomp5_LIBRARY
}
"
)
endif
()
endif
()
if
(
UNIX AND NOT WIN32
)
# m
find_library
(
M_LIBRARY
NAMES m
HINTS
${
_libdir
}
)
mark_as_advanced
(
M_LIBRARY
)
if
(
M_LIBRARY
)
set
(
LM
"
${
M_LIBRARY
}
"
)
else
()
set
(
LM
""
)
endif
()
# dl
find_library
(
DL_LIBRARY
NAMES dl
HINTS
${
_libdir
}
)
mark_as_advanced
(
DL_LIBRARY
)
if
(
DL_LIBRARY
)
set
(
LDL
"
${
DL_LIBRARY
}
"
)
else
()
set
(
LDL
""
)
endif
()
# Fortran
set
(
LGFORTRAN
""
)
if
(
CMAKE_C_COMPILER_ID MATCHES
"GNU"
)
find_library
(
FORTRAN_gfortran_LIBRARY
NAMES gfortran
HINTS
${
_libdir
}
)
mark_as_advanced
(
FORTRAN_gfortran_LIBRARY
)
if
(
FORTRAN_gfortran_LIBRARY
)
set
(
LGFORTRAN
"
${
FORTRAN_gfortran_LIBRARY
}
"
)
endif
()
elseif
(
CMAKE_C_COMPILER_ID MATCHES
"Intel"
)
find_library
(
FORTRAN_ifcore_LIBRARY
NAMES ifcore
HINTS
${
_libdir
}
)
mark_as_advanced
(
FORTRAN_ifcore_LIBRARY
)
if
(
FORTRAN_ifcore_LIBRARY
)
set
(
LGFORTRAN
"{FORTRAN_ifcore_LIBRARY}"
)
endif
()
endif
()
set
(
BLAS_CFLAGS_OTHER
""
)
# OpenMP
if
(
BLA_VENDOR STREQUAL
"Intel10_64lp"
)
find_package
(
OpenMP REQUIRED
)
endif
()
if
(
OPENMP_C_FLAGS
)
list
(
APPEND BLAS_CFLAGS_OTHER
"
${
OPENMP_C_FLAGS
}
"
)
endif
()
if
(
CMAKE_C_COMPILER_ID STREQUAL
"GNU"
)
if
(
BLA_VENDOR STREQUAL
"Intel10_32"
)
list
(
APPEND BLAS_CFLAGS_OTHER
"-m32"
)
else
()
list
(
APPEND BLAS_CFLAGS_OTHER
"-m64"
)
endif
()
endif
()
set
(
additional_flags
""
)
if
(
CMAKE_C_COMPILER_ID STREQUAL
"GNU"
AND CMAKE_SYSTEM_NAME STREQUAL
"Linux"
)
set
(
additional_flags
"-Wl,--no-as-needed"
)
endif
()
# m
find_library
(
M_LIBRARY
NAMES m
HINTS
${
_libdir
}
)
mark_as_advanced
(
M_LIBRARY
)
if
(
M_LIBRARY
)
set
(
LM
"
${
M_LIBRARY
}
"
)
else
()
set
(
LM
""
)
endif
()
# dl
find_library
(
DL_LIBRARY
NAMES dl
HINTS
${
_libdir
}
)
mark_as_advanced
(
DL_LIBRARY
)
if
(
DL_LIBRARY
)
set
(
LDL
"
${
DL_LIBRARY
}
"
)
else
()
set
(
LDL
""
)
endif
()
# Fortran
set
(
LGFORTRAN
""
)
if
(
CMAKE_C_COMPILER_ID MATCHES
"GNU"
)
find_library
(
FORTRAN_gfortran_LIBRARY
NAMES gfortran
HINTS
${
_libdir
}
)
mark_as_advanced
(
FORTRAN_gfortran_LIBRARY
)
if
(
FORTRAN_gfortran_LIBRARY
)
set
(
LGFORTRAN
"
${
FORTRAN_gfortran_LIBRARY
}
"
)
endif
()
elseif
(
CMAKE_C_COMPILER_ID MATCHES
"Intel"
)
find_library
(
FORTRAN_ifcore_LIBRARY
NAMES ifcore
HINTS
${
_libdir
}
)
mark_as_advanced
(
FORTRAN_ifcore_LIBRARY
)
if
(
FORTRAN_ifcore_LIBRARY
)
set
(
LGFORTRAN
"{FORTRAN_ifcore_LIBRARY}"
)
endif
()
endif
()
set
(
BLAS_CFLAGS_OTHER
""
)
# OpenMP
if
(
BLA_VENDOR STREQUAL
"Intel10_64lp"
)
find_package
(
OpenMP REQUIRED
)
endif
()
if
(
OPENMP_C_FLAGS
)
list
(
APPEND BLAS_CFLAGS_OTHER
"
${
OPENMP_C_FLAGS
}
"
)
endif
()
if
(
CMAKE_C_COMPILER_ID STREQUAL
"GNU"
)
if
(
BLA_VENDOR STREQUAL
"Intel10_32"
)
list
(
APPEND BLAS_CFLAGS_OTHER
"-m32"
)
else
()
list
(
APPEND BLAS_CFLAGS_OTHER
"-m64"
)
endif
()
endif
()
set
(
additional_flags
""
)
if
(
CMAKE_C_COMPILER_ID STREQUAL
"GNU"
AND CMAKE_SYSTEM_NAME STREQUAL
"Linux"
)
set
(
additional_flags
"-Wl,--no-as-needed"
)
endif
()
endif
()
if
(
_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX
)
find_package
(
Threads
)
if
(
THREADS_FOUND
)
libraries_absolute_path
(
CMAKE_THREAD_LIBS_INIT
""
)
endif
()
set
(
BLAS_SEARCH_LIBS
""
)
if
(
BLA_F95
)
set
(
BLAS_mkl_SEARCH_SYMBOL sgemm_f95
)
set
(
_LIBRARIES BLAS95_LIBRARIES
)
if
(
WIN32
)
if
(
BLA_STATIC
)
set
(
BLAS_mkl_DLL_SUFFIX
""
)
else
()
set
(
BLAS_mkl_DLL_SUFFIX
"_dll"
)
endif
()
# Find the main file (32-bit or 64-bit)
set
(
BLAS_SEARCH_LIBS_WIN_MAIN
""
)
if
(
BLA_VENDOR STREQUAL
"Intel10_32"
OR BLA_VENDOR STREQUAL
"All"
)
list
(
APPEND BLAS_SEARCH_LIBS_WIN_MAIN
"mkl_blas95
${
BLAS_mkl_DLL_SUFFIX
}
mkl_intel_c
${
BLAS_mkl_DLL_SUFFIX
}
"
)
endif
()
if
(
BLA_VENDOR STREQUAL
"Intel10_64lp*"
OR BLA_VENDOR STREQUAL
"All"
)
list
(
APPEND BLAS_SEARCH_LIBS_WIN_MAIN
"mkl_blas95_lp64
${
BLAS_mkl_DLL_SUFFIX
}
mkl_intel_lp64
${
BLAS_mkl_DLL_SUFFIX
}
"
)
endif
()
# Add threading/sequential libs
set
(
BLAS_SEARCH_LIBS_WIN_THREAD
""
)
if
(
BLA_VENDOR STREQUAL
"*_seq"
OR BLA_VENDOR STREQUAL
"All"
)
list
(
APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"mkl_sequential
${
BLAS_mkl_DLL_SUFFIX
}
"
)
endif
()
if
(
NOT BLA_VENDOR STREQUAL
"*_seq"
OR BLA_VENDOR STREQUAL
"All"
)
# old version
list
(
APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"libguide40 mkl_intel_thread
${
BLAS_mkl_DLL_SUFFIX
}
"
)
# mkl >= 10.3
# sequential version
list
(
APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"mkl_sequential
${
BLAS_mkl_DLL_SUFFIX
}
"
)
# multithreaded version
list
(
APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"libiomp5md mkl_intel_thread
${
BLAS_mkl_DLL_SUFFIX
}
"
)
endif
()
# Cartesian product of the above
foreach
(
MAIN
${
BLAS_SEARCH_LIBS_WIN_MAIN
}
)
foreach
(
THREAD
${
BLAS_SEARCH_LIBS_WIN_THREAD
}
)
list
(
APPEND BLAS_SEARCH_LIBS
"
${
MAIN
}
${
THREAD
}
mkl_core
${
BLAS_mkl_DLL_SUFFIX
}
"
)
endforeach
()
endforeach
()
else
(
WIN32
)
if
(
_LANGUAGES_ MATCHES Fortran
)
if
(
CMAKE_Fortran_COMPILER_ID STREQUAL
"GNU"
)
set
(
BLAS_mkl_intface
"gf"
)
else
()
set
(
BLAS_mkl_intface
"intel"
)
endif
()
else
()
set
(
BLAS_mkl_intface
"intel"
)
endif
()
if
(
CMAKE_C_COMPILER_ID STREQUAL
"GNU"
)
set
(
BLAS_mkl_threading
"gnu"
)
else
()
set
(
BLAS_mkl_threading
"intel"
)
endif
()
if
(
BLA_VENDOR STREQUAL
"Intel10_32"
OR BLA_VENDOR STREQUAL
"All"
)
list
(
APPEND BLAS_SEARCH_LIBS
"mkl_blas95 mkl_
${
BLAS_mkl_intface
}
mkl_
${
BLAS_mkl_threading
}
_thread mkl_core"
)
endif
()
if
(
BLA_VENDOR STREQUAL
"Intel10_64lp"
OR BLA_VENDOR STREQUAL
"All"
)
# old version
list
(
APPEND BLAS_SEARCH_LIBS
"mkl_blas95 mkl_
${
BLAS_mkl_intface
}
_lp64 mkl_
${
BLAS_mkl_threading
}
_thread mkl_core guide"
)
# mkl >= 10.3
# sequential version
list
(
APPEND BLAS_SEARCH_LIBS
"mkl_blas95_lp64 mkl_
${
BLAS_mkl_intface
}
_lp64 mkl_sequential mkl_core"
)
# multithreaded version
list
(
APPEND BLAS_SEARCH_LIBS
"mkl_blas95_lp64 mkl_
${
BLAS_mkl_intface
}
_lp64 mkl_
${
BLAS_mkl_threading
}
_thread mkl_core"
)
endif
()
if
(
BLA_VENDOR STREQUAL
"Intel10_64lp_seq"
OR BLA_VENDOR STREQUAL
"All"
)
list
(
APPEND BLAS_SEARCH_LIBS
"mkl_blas95_lp64 mkl_
${
BLAS_mkl_intface
}
_lp64 mkl_sequential mkl_core"
)
if
(
BLA_VENDOR STREQUAL
"Intel10_64lp_seq"
)
set
(
OMP_LIB
""
)
endif
()
endif
()
endif
(
WIN32
)
else
(
BLA_F95
)
set
(
BLAS_mkl_SEARCH_SYMBOL sgemm
)
set
(
_LIBRARIES BLAS_LIBRARIES
)
if
(
WIN32
)
if
(
BLA_STATIC
)
set
(
BLAS_mkl_DLL_SUFFIX
""
)
else
()
set
(
BLAS_mkl_DLL_SUFFIX
"_dll"
)
endif
()
# Find the main file (32-bit or 64-bit)
set
(
BLAS_SEARCH_LIBS_WIN_MAIN
""
)
if
(
BLA_VENDOR STREQUAL
"Intel10_32"
OR BLA_VENDOR STREQUAL
"All"
)
list
(
APPEND BLAS_SEARCH_LIBS_WIN_MAIN
"mkl_intel_c
${
BLAS_mkl_DLL_SUFFIX
}
"
)
endif
()
if
(
BLA_VENDOR STREQUAL
"Intel10_64lp*"
OR BLA_VENDOR STREQUAL
"All"
)
list
(
APPEND BLAS_SEARCH_LIBS_WIN_MAIN
"mkl_intel_lp64
${
BLAS_mkl_DLL_SUFFIX
}
"
)
endif
()
# Add threading/sequential libs
set
(
BLAS_SEARCH_LIBS_WIN_THREAD
""
)
if
(
NOT BLA_VENDOR STREQUAL
"*_seq"
OR BLA_VENDOR STREQUAL
"All"
)
# old version
list
(
APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"libguide40 mkl_intel_thread
${
BLAS_mkl_DLL_SUFFIX
}
"
)
# mkl >= 10.3
# sequential version
list
(
APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"mkl_sequential
${
BLAS_mkl_DLL_SUFFIX
}
"
)
# multithreaded version
list
(
APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"libiomp5md mkl_intel_thread
${
BLAS_mkl_DLL_SUFFIX
}
"
)
endif
()
if
(
BLA_VENDOR STREQUAL
"*_seq"
OR BLA_VENDOR STREQUAL
"All"
)
list
(
APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"mkl_sequential
${
BLAS_mkl_DLL_SUFFIX
}
"
)
endif
()
# Cartesian product of the above
foreach
(
MAIN
${
BLAS_SEARCH_LIBS_WIN_MAIN
}
)
foreach
(
THREAD
${
BLAS_SEARCH_LIBS_WIN_THREAD
}
)
list
(
APPEND BLAS_SEARCH_LIBS
"
${
MAIN
}
${
THREAD
}
mkl_core
${
BLAS_mkl_DLL_SUFFIX
}
"
)
endforeach
()
endforeach
()
else
(
WIN32
)
if
(
_LANGUAGES_ MATCHES Fortran
)
if
(
CMAKE_Fortran_COMPILER_ID STREQUAL
"GNU"
)
set
(
BLAS_mkl_intface
"gf"
)
else
()
set
(
BLAS_mkl_intface
"intel"
)
endif
()
else
()
set
(
BLAS_mkl_intface
"intel"
)
endif
()
if
(
CMAKE_C_COMPILER_ID STREQUAL
"GNU"
)
set
(
BLAS_mkl_threading
"gnu"
)
else
()
set
(
BLAS_mkl_threading
"intel"
)
endif
()
if
(
BLA_VENDOR STREQUAL
"Intel10_32"
OR BLA_VENDOR STREQUAL
"All"
)
list
(
APPEND BLAS_SEARCH_LIBS
"mkl_
${
BLAS_mkl_intface
}
mkl_
${
BLAS_mkl_threading
}
_thread mkl_core"
)
endif
()
if
(
BLA_VENDOR STREQUAL
"Intel10_64lp"
OR BLA_VENDOR STREQUAL
"All"
)
# old version
list
(
APPEND BLAS_SEARCH_LIBS
"mkl_
${
BLAS_mkl_intface
}
_lp64 mkl_
${
BLAS_mkl_threading
}
_thread mkl_core guide"
)
# mkl >= 10.3
# sequential version
list
(
APPEND BLAS_SEARCH_LIBS
"mkl_
${
BLAS_mkl_intface
}
_lp64 mkl_sequential mkl_core"
)
# multithreaded version
list
(
APPEND BLAS_SEARCH_LIBS
"mkl_
${
BLAS_mkl_intface
}
_lp64 mkl_
${
BLAS_mkl_threading
}
_thread mkl_core"
)
endif
()
if
(
BLA_VENDOR STREQUAL
"Intel10_64lp_seq"
OR BLA_VENDOR STREQUAL
"All"
)
list
(
APPEND BLAS_SEARCH_LIBS
"mkl_
${
BLAS_mkl_intface
}
_lp64 mkl_sequential mkl_core"
)
if
(
BLA_VENDOR STREQUAL
"Intel10_64lp_seq"
)
set
(
OMP_LIB
""
)
endif
()
endif
()
#older versions of intel mkl libs
if
(
BLA_VENDOR STREQUAL
"Intel"
OR BLA_VENDOR STREQUAL
"All"
)
list
(
APPEND BLAS_SEARCH_LIBS
"mkl"
)
list
(
APPEND BLAS_SEARCH_LIBS
"mkl_ia32"
)
list
(
APPEND BLAS_SEARCH_LIBS
"mkl_em64t"
)
endif
()
endif
(
WIN32
)
endif
(
BLA_F95
)
foreach
(
IT
${
BLAS_SEARCH_LIBS
}
)
string
(
REPLACE
" "
";"
SEARCH_LIBS
${
IT
}
)
# determine if we look at a sequential or multithreaded version
set
(
MKL_MT OFF
)
foreach
(
_lib
${
SEARCH_LIBS
}
)
if
(
${
_lib
}
MATCHES
"thread"
)
set
(
MKL_MT ON
)
endif
()
endforeach
()
if
(
MKL_MT
)
check_fortran_libraries
(
${
_LIBRARIES
}
BLAS
${
BLAS_mkl_SEARCH_SYMBOL
}
"
${
additional_flags
}
"
"
${
SEARCH_LIBS
}
"
"
${
OMP_LIB
}
;
${
CMAKE_THREAD_LIBS_INIT
}
;
${
LM
}
;
${
LDL
}
"
)
else
()
check_fortran_libraries
(
${
_LIBRARIES
}
BLAS
${
BLAS_mkl_SEARCH_SYMBOL
}
"
${
additional_flags
}
"
"
${
SEARCH_LIBS
}
"
"
${
CMAKE_THREAD_LIBS_INIT
}
;
${
LM
}
;
${
LDL
}
"
)
endif
()
if
(
${
_LIBRARIES
}
)
set
(
BLAS_LDFLAGS_OTHER
"
${
additional_flags
}
"
)
if
(
MKL_MT
)
set
(
BLAS_LIBRARIES_PAR
"
${${
_LIBRARIES
}}
"
)
else
()
set
(
BLAS_LIBRARIES_SEQ
"
${${
_LIBRARIES
}}
"
)
endif
()
set
(
${
_LIBRARIES
}
_COPY
"
${${
_LIBRARIES
}}
"
)
endif
()
endforeach
()
if
(
${
_LIBRARIES
}
_COPY
)
set
(
${
_LIBRARIES
}
"
${${
_LIBRARIES
}
_COPY
}
"
)
endif
()
if
(
NOT BLAS_FIND_QUIETLY
)
if
(
${
_LIBRARIES
}
)
message
(
STATUS
"Looking for MKL BLAS: found"
)
else
()
message
(
STATUS
"Looking for MKL BLAS: not found"
)
endif
()
endif
()
if
(
${
_LIBRARIES
}
)
set
(
BLAS_VENDOR_FOUND
"Intel MKL"
)
endif
()
find_package
(
Threads
)
if
(
THREADS_FOUND
)
libraries_absolute_path
(
CMAKE_THREAD_LIBS_INIT
""
)
endif
()
set
(
BLAS_SEARCH_LIBS
""
)
if
(
BLA_F95
)
set
(
BLAS_mkl_SEARCH_SYMBOL sgemm_f95
)
set
(
_LIBRARIES BLAS95_LIBRARIES
)
if
(
WIN32
)
if
(
BLA_STATIC
)
set
(
BLAS_mkl_DLL_SUFFIX
""
)
else
()
set
(
BLAS_mkl_DLL_SUFFIX
"_dll"
)
endif
()
# Find the main file (32-bit or 64-bit)
set
(
BLAS_SEARCH_LIBS_WIN_MAIN
""
)
if
(
BLA_VENDOR STREQUAL
"Intel10_32"
OR BLA_VENDOR STREQUAL
"All"
)
list
(
APPEND BLAS_SEARCH_LIBS_WIN_MAIN
"mkl_blas95
${
BLAS_mkl_DLL_SUFFIX
}
mkl_intel_c
${
BLAS_mkl_DLL_SUFFIX
}
"
)
endif
()
if
(
BLA_VENDOR STREQUAL
"Intel10_64lp*"
OR BLA_VENDOR STREQUAL
"All"
)
list
(
APPEND BLAS_SEARCH_LIBS_WIN_MAIN
"mkl_blas95_lp64
${
BLAS_mkl_DLL_SUFFIX
}
mkl_intel_lp64
${
BLAS_mkl_DLL_SUFFIX
}
"
)
endif
()
# Add threading/sequential libs
set
(
BLAS_SEARCH_LIBS_WIN_THREAD
""
)
if
(
BLA_VENDOR STREQUAL
"*_seq"
OR BLA_VENDOR STREQUAL
"All"
)
list
(
APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"mkl_sequential
${
BLAS_mkl_DLL_SUFFIX
}
"
)
endif
()
if
(
NOT BLA_VENDOR STREQUAL
"*_seq"
OR BLA_VENDOR STREQUAL
"All"
)
# old version
list
(
APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"libguide40 mkl_intel_thread
${
BLAS_mkl_DLL_SUFFIX
}
"
)
# mkl >= 10.3
# sequential version
list
(
APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"mkl_sequential
${
BLAS_mkl_DLL_SUFFIX
}
"
)
# multithreaded version
list
(
APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"libiomp5md mkl_intel_thread
${
BLAS_mkl_DLL_SUFFIX
}
"
)
endif
()
# Cartesian product of the above
foreach
(
MAIN
${
BLAS_SEARCH_LIBS_WIN_MAIN
}
)
foreach
(
THREAD
${
BLAS_SEARCH_LIBS_WIN_THREAD
}
)
list
(
APPEND BLAS_SEARCH_LIBS
"
${
MAIN
}
${
THREAD
}
mkl_core
${
BLAS_mkl_DLL_SUFFIX
}
"
)
endforeach
()
endforeach
()
else
(
WIN32
)
if
(
_LANGUAGES_ MATCHES Fortran
)
if
(
CMAKE_Fortran_COMPILER_ID STREQUAL
"GNU"
)
set
(
BLAS_mkl_intface
"gf"
)
else
()
set
(
BLAS_mkl_intface
"intel"
)
endif
()
else
()
set
(
BLAS_mkl_intface
"intel"
)
endif
()
if
(
CMAKE_C_COMPILER_ID STREQUAL
"GNU"
)
set
(
BLAS_mkl_threading
"gnu"
)
else
()
set
(
BLAS_mkl_threading
"intel"
)
endif
()
if
(
BLA_VENDOR STREQUAL
"Intel10_32"
OR BLA_VENDOR STREQUAL
"All"
)
list
(
APPEND BLAS_SEARCH_LIBS
"mkl_blas95 mkl_
${
BLAS_mkl_intface
}
mkl_
${
BLAS_mkl_threading
}
_thread mkl_core"
)
endif
()
if
(
BLA_VENDOR STREQUAL
"Intel10_64lp"
OR BLA_VENDOR STREQUAL
"All"
)
# old version
list
(
APPEND BLAS_SEARCH_LIBS
"mkl_blas95 mkl_
${
BLAS_mkl_intface
}
_lp64 mkl_
${
BLAS_mkl_threading
}
_thread mkl_core guide"
)
# mkl >= 10.3
# sequential version
list
(
APPEND BLAS_SEARCH_LIBS
"mkl_blas95_lp64 mkl_
${
BLAS_mkl_intface
}
_lp64 mkl_sequential mkl_core"
)
# multithreaded version
list
(
APPEND BLAS_SEARCH_LIBS
"mkl_blas95_lp64 mkl_
${
BLAS_mkl_intface
}
_lp64 mkl_
${
BLAS_mkl_threading
}
_thread mkl_core"
)
endif
()
if
(
BLA_VENDOR STREQUAL
"Intel10_64lp_seq"
OR BLA_VENDOR STREQUAL
"All"
)
list
(
APPEND BLAS_SEARCH_LIBS
"mkl_blas95_lp64 mkl_
${
BLAS_mkl_intface
}
_lp64 mkl_sequential mkl_core"
)
if
(
BLA_VENDOR STREQUAL
"Intel10_64lp_seq"
)
set
(
OMP_LIB
""
)
endif
()
endif
()
endif
(
WIN32
)
else
(
BLA_F95
)
set
(
BLAS_mkl_SEARCH_SYMBOL sgemm
)
set
(
_LIBRARIES BLAS_LIBRARIES
)
if
(
WIN32
)
if
(
BLA_STATIC
)
set
(
BLAS_mkl_DLL_SUFFIX
""
)
else
()
set
(
BLAS_mkl_DLL_SUFFIX
"_dll"
)
endif
()
# Find the main file (32-bit or 64-bit)
set
(
BLAS_SEARCH_LIBS_WIN_MAIN
""
)
if
(
BLA_VENDOR STREQUAL
"Intel10_32"
OR BLA_VENDOR STREQUAL
"All"
)
list
(
APPEND BLAS_SEARCH_LIBS_WIN_MAIN
"mkl_intel_c
${
BLAS_mkl_DLL_SUFFIX
}
"
)
endif
()
if
(
BLA_VENDOR STREQUAL
"Intel10_64lp*"
OR BLA_VENDOR STREQUAL
"All"
)
list
(
APPEND BLAS_SEARCH_LIBS_WIN_MAIN
"mkl_intel_lp64
${
BLAS_mkl_DLL_SUFFIX
}
"
)
endif
()
# Add threading/sequential libs
set
(
BLAS_SEARCH_LIBS_WIN_THREAD
""
)
if
(
NOT BLA_VENDOR STREQUAL
"*_seq"
OR BLA_VENDOR STREQUAL
"All"
)
# old version
list
(
APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"libguide40 mkl_intel_thread
${
BLAS_mkl_DLL_SUFFIX
}
"
)
# mkl >= 10.3
# sequential version
list
(
APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"mkl_sequential
${
BLAS_mkl_DLL_SUFFIX
}
"
)
# multithreaded version
list
(
APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"libiomp5md mkl_intel_thread
${
BLAS_mkl_DLL_SUFFIX
}
"
)
endif
()
if
(
BLA_VENDOR STREQUAL
"*_seq"
OR BLA_VENDOR STREQUAL
"All"
)
list
(
APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"mkl_sequential
${
BLAS_mkl_DLL_SUFFIX
}
"
)
endif
()
# Cartesian product of the above
foreach
(
MAIN
${
BLAS_SEARCH_LIBS_WIN_MAIN
}
)
foreach
(
THREAD
${
BLAS_SEARCH_LIBS_WIN_THREAD
}
)
list
(
APPEND BLAS_SEARCH_LIBS
"
${
MAIN
}
${
THREAD
}
mkl_core
${
BLAS_mkl_DLL_SUFFIX
}
"
)
endforeach
()
endforeach
()
else
(
WIN32
)
if
(
_LANGUAGES_ MATCHES Fortran
)
if
(
CMAKE_Fortran_COMPILER_ID STREQUAL
"GNU"
)
set
(
BLAS_mkl_intface
"gf"
)
else
()
set
(
BLAS_mkl_intface
"intel"
)
endif
()
else
()
set
(
BLAS_mkl_intface
"intel"
)
endif
()
if
(
CMAKE_C_COMPILER_ID STREQUAL
"GNU"
)
set
(
BLAS_mkl_threading
"gnu"
)
else
()
set
(
BLAS_mkl_threading
"intel"
)
endif
()
if
(
BLA_VENDOR STREQUAL
"Intel10_32"
OR BLA_VENDOR STREQUAL
"All"
)
list
(
APPEND BLAS_SEARCH_LIBS
"mkl_
${
BLAS_mkl_intface
}
mkl_
${
BLAS_mkl_threading
}
_thread mkl_core"
)
endif
()
if
(
BLA_VENDOR STREQUAL
"Intel10_64lp"
OR BLA_VENDOR STREQUAL
"All"
)
# old version
list
(
APPEND BLAS_SEARCH_LIBS
"mkl_
${
BLAS_mkl_intface
}
_lp64 mkl_
${
BLAS_mkl_threading
}
_thread mkl_core guide"
)
# mkl >= 10.3
# sequential version
list
(
APPEND BLAS_SEARCH_LIBS
"mkl_
${
BLAS_mkl_intface
}
_lp64 mkl_sequential mkl_core"
)
# multithreaded version
list
(
APPEND BLAS_SEARCH_LIBS
"mkl_
${
BLAS_mkl_intface
}
_lp64 mkl_
${
BLAS_mkl_threading
}
_thread mkl_core"
)
endif
()
if
(
BLA_VENDOR STREQUAL
"Intel10_64lp_seq"
OR BLA_VENDOR STREQUAL
"All"
)
list
(
APPEND BLAS_SEARCH_LIBS
"mkl_
${
BLAS_mkl_intface
}
_lp64 mkl_sequential mkl_core"
)
if
(
BLA_VENDOR STREQUAL
"Intel10_64lp_seq"
)
set
(
OMP_LIB
""
)
endif
()
endif
()
#older versions of intel mkl libs
if
(
BLA_VENDOR STREQUAL
"Intel"
OR BLA_VENDOR STREQUAL
"All"
)
list
(
APPEND BLAS_SEARCH_LIBS
"mkl"
)
list
(
APPEND BLAS_SEARCH_LIBS
"mkl_ia32"
)
list
(
APPEND BLAS_SEARCH_LIBS
"mkl_em64t"
)
endif
()
endif
(
WIN32
)
endif
(
BLA_F95
)
foreach
(
IT
${
BLAS_SEARCH_LIBS
}
)
string
(
REPLACE
" "
";"
SEARCH_LIBS
${
IT
}
)
# determine if we look at a sequential or multithreaded version
set
(
MKL_MT OFF
)
foreach
(
_lib
${
SEARCH_LIBS
}
)
if
(
${
_lib
}
MATCHES
"thread"
)
set
(
MKL_MT ON
)
endif
()
endforeach
()
if
(
MKL_MT
)
check_fortran_libraries
(
${
_LIBRARIES
}
BLAS
${
BLAS_mkl_SEARCH_SYMBOL
}
"
${
additional_flags
}
"
"
${
SEARCH_LIBS
}
"
"
${
OMP_LIB
}
;
${
CMAKE_THREAD_LIBS_INIT
}
;
${
LM
}
;
${
LDL
}
"
)
else
()
check_fortran_libraries
(
${
_LIBRARIES
}
BLAS
${
BLAS_mkl_SEARCH_SYMBOL
}
"
${
additional_flags
}
"
"
${
SEARCH_LIBS
}
"
"
${
CMAKE_THREAD_LIBS_INIT
}
;
${
LM
}
;
${
LDL
}
"
)
endif
()
if
(
${
_LIBRARIES
}
)
set
(
BLAS_LDFLAGS_OTHER
"
${
additional_flags
}
"
)
if
(
MKL_MT
)
set
(
BLAS_LIBRARIES_PAR
"
${${
_LIBRARIES
}}
"
)
else
()
set
(
BLAS_LIBRARIES_SEQ
"
${${
_LIBRARIES
}}
"
)
endif
()
set
(
${
_LIBRARIES
}
_COPY
"
${${
_LIBRARIES
}}
"
)
endif
()
endforeach
()
if
(
${
_LIBRARIES
}
_COPY
)
set
(
${
_LIBRARIES
}
"
${${
_LIBRARIES
}
_COPY
}
"
)
endif
()
if
(
NOT BLAS_FIND_QUIETLY
)
if
(
${
_LIBRARIES
}
)
message
(
STATUS
"Looking for MKL BLAS: found"
)
else
()
message
(
STATUS
"Looking for MKL BLAS: not found"
)
endif
()
endif
()
if
(
${
_LIBRARIES
}
)
set
(
BLAS_VENDOR_FOUND
"Intel MKL"
)
endif
()
endif
(
_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX
)
endif
(
NOT BLAS_LIBRARIES OR BLA_VENDOR MATCHES
"Intel*"
)
if
(
NOT BLAS_LIBRARIES
)
...
...
@@ -853,28 +857,125 @@ if( (NOT BLAS_FOUND_WITH_PKGCONFIG) OR BLAS_GIVEN_BY_USER )
unset
(
BLAS_mkl_threading
)
endif
(
BLA_VENDOR MATCHES
"Intel*"
OR BLA_VENDOR STREQUAL
"All"
)
if
(
BLA_VENDOR MATCHES
"ARMPL*"
OR BLA_VENDOR STREQUAL
"All"
)
if
(
NOT BLAS_LIBRARIES OR BLA_VENDOR MATCHES
"ARMPL*"
)
# Looking for include
# -------------------
# Add system include paths to search include
# ------------------------------------------
unset
(
_inc_env
)
set
(
ENV_ARMPL
"$ENV{ARMPL_DIR}"
)
set
(
ENV_BLAS_DIR
"$ENV{BLAS_DIR}"
)
set
(
ENV_BLAS_INCDIR
"$ENV{BLAS_INCDIR}"
)
if
(
ENV_BLAS_INCDIR
)
list
(
APPEND _inc_env
"
${
ENV_BLAS_INCDIR
}
"
)
elseif
(
ENV_BLAS_DIR
)
list
(
APPEND _inc_env
"
${
ENV_BLAS_DIR
}
"
)
list
(
APPEND _inc_env
"
${
ENV_BLAS_DIR
}
/include"
)
else
()
if
(
ENV_ARMPL
)
list
(
APPEND _inc_env
"
${
ENV_ARMPL
}
/include"
)
endif
()
# system variables
if
(
WIN32
)
string
(
REPLACE
":"
";"
_path_env
"$ENV{INCLUDE}"
)
list
(
APPEND _inc_env
"
${
_path_env
}
"
)
else
()
string
(
REPLACE
":"
";"
_path_env
"$ENV{INCLUDE}"
)
list
(
APPEND _inc_env
"
${
_path_env
}
"
)
string
(
REPLACE
":"
";"
_path_env
"$ENV{C_INCLUDE_PATH}"
)
list
(
APPEND _inc_env
"
${
_path_env
}
"
)
string
(
REPLACE
":"
";"
_path_env
"$ENV{CPATH}"
)
list
(
APPEND _inc_env
"
${
_path_env
}
"
)
string
(
REPLACE
":"
";"
_path_env
"$ENV{INCLUDE_PATH}"
)
list
(
APPEND _inc_env
"
${
_path_env
}
"
)
endif
()
endif
()
list
(
APPEND _inc_env
"
${
CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
}
"
)
list
(
REMOVE_DUPLICATES _inc_env
)
# set paths where to look for
set
(
PATH_TO_LOOK_FOR
"
${
_inc_env
}
"
)
# Try to find the armpl header in the given paths
# -------------------------------------------------
# call cmake macro to find the header path
if
(
BLAS_INCDIR
)
set
(
BLAS_armpl.h_DIRS
"BLAS_armpl.h_DIRS-NOTFOUND"
)
find_path
(
BLAS_armpl.h_DIRS
NAMES armpl.h
HINTS
${
BLAS_INCDIR
}
)
else
()
if
(
BLAS_DIR
)
set
(
BLAS_armpl.h_DIRS
"BLAS_armpl.h_DIRS-NOTFOUND"
)
find_path
(
BLAS_armpl.h_DIRS
NAMES armpl.h
HINTS
${
BLAS_DIR
}
PATH_SUFFIXES
"include"
)
else
()
set
(
BLAS_armpl.h_DIRS
"BLAS_armpl.h_DIRS-NOTFOUND"
)
find_path
(
BLAS_armpl.h_DIRS
NAMES armpl.h
HINTS
${
PATH_TO_LOOK_FOR
}
)
endif
()
endif
()
mark_as_advanced
(
BLAS_armpl.h_DIRS
)
# If found, add path to cmake variable
# ------------------------------------
if
(
BLAS_armpl.h_DIRS
)
set
(
BLAS_INCLUDE_DIRS
"
${
BLAS_armpl.h_DIRS
}
"
)
else
()
set
(
BLAS_INCLUDE_DIRS
"BLAS_INCLUDE_DIRS-NOTFOUND"
)
if
(
NOT BLAS_FIND_QUIETLY
)
message
(
STATUS
"Looking for BLAS -- armpl.h not found"
)
endif
()
endif
()
check_fortran_libraries
(
BLAS_LIBRARIES
BLAS
sgemm
""
"armpl"
""
)
if
(
NOT BLAS_FIND_QUIETLY
)
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for ARMPL BLAS: found"
)
else
()
message
(
STATUS
"Looking for ARMPL BLAS: not found"
)
endif
()
endif
()
if
(
BLAS_LIBRARIES
)
set
(
BLAS_VENDOR_FOUND
"ARMPL"
)
endif
()
endif
(
NOT BLAS_LIBRARIES OR BLA_VENDOR MATCHES
"ARMPL*"
)
endif
(
BLA_VENDOR MATCHES
"ARMPL*"
OR BLA_VENDOR STREQUAL
"All"
)
if
(
BLA_VENDOR STREQUAL
"Goto"
OR BLA_VENDOR STREQUAL
"All"
)
if
(
NOT BLAS_LIBRARIES
)
# gotoblas (http://www.tacc.utexas.edu/tacc-projects/gotoblas2)
check_fortran_libraries
(
BLAS_LIBRARIES
BLAS
sgemm
""
"goto2"
""
)
BLAS_LIBRARIES
BLAS
sgemm
""
"goto2"
""
)
if
(
NOT BLAS_FIND_QUIETLY
)
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for Goto BLAS: found"
)
else
()
message
(
STATUS
"Looking for Goto BLAS: not found"
)
endif
()
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for Goto BLAS: found"
)
else
()
message
(
STATUS
"Looking for Goto BLAS: not found"
)
endif
()
endif
()
if
(
BLAS_LIBRARIES
)
set
(
BLAS_VENDOR_FOUND
"Goto"
)
set
(
BLAS_VENDOR_FOUND
"Goto"
)
endif
()
endif
()
...
...
@@ -887,22 +988,22 @@ if( (NOT BLAS_FOUND_WITH_PKGCONFIG) OR BLAS_GIVEN_BY_USER )
if
(
NOT BLAS_LIBRARIES
)
# openblas (http://www.openblas.net/)
check_fortran_libraries
(
BLAS_LIBRARIES
BLAS
sgemm
""
"openblas"
""
)
BLAS_LIBRARIES
BLAS
sgemm
""
"openblas"
""
)
if
(
NOT BLAS_FIND_QUIETLY
)
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for Open BLAS: found"
)
else
()
message
(
STATUS
"Looking for Open BLAS: not found"
)
endif
()
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for Open BLAS: found"
)
else
()
message
(
STATUS
"Looking for Open BLAS: not found"
)
endif
()
endif
()
if
(
BLAS_LIBRARIES
)
set
(
BLAS_VENDOR_FOUND
"Openblas"
)
set
(
BLAS_VENDOR_FOUND
"Openblas"
)
endif
()
endif
()
...
...
@@ -915,41 +1016,41 @@ if( (NOT BLAS_FOUND_WITH_PKGCONFIG) OR BLAS_GIVEN_BY_USER )
if
(
NOT BLAS_LIBRARIES
)
# eigenblas (http://eigen.tuxfamily.org/index.php?title=Main_Page)
check_fortran_libraries
(
BLAS_LIBRARIES
BLAS
sgemm
""
"eigen_blas"
""
)
BLAS_LIBRARIES
BLAS
sgemm
""
"eigen_blas"
""
)
if
(
NOT BLAS_FIND_QUIETLY
)
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for Eigen BLAS: found"
)
else
()
message
(
STATUS
"Looking for Eigen BLAS: not found"
)
endif
()
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for Eigen BLAS: found"
)
else
()
message
(
STATUS
"Looking for Eigen BLAS: not found"
)
endif
()
endif
()
endif
()
if
(
NOT BLAS_LIBRARIES
)
# eigenblas (http://eigen.tuxfamily.org/index.php?title=Main_Page)
check_fortran_libraries
(
BLAS_LIBRARIES
BLAS
sgemm
""
"eigen_blas_static"
""
)
BLAS_LIBRARIES
BLAS
sgemm
""
"eigen_blas_static"
""
)
if
(
NOT BLAS_FIND_QUIETLY
)
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for Eigen BLAS: found"
)
else
()
message
(
STATUS
"Looking for Eigen BLAS: not found"
)
endif
()
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for Eigen BLAS: found"
)
else
()
message
(
STATUS
"Looking for Eigen BLAS: not found"
)
endif
()
endif
()
if
(
BLAS_LIBRARIES
)
set
(
BLAS_VENDOR_FOUND
"Eigen"
)
set
(
BLAS_VENDOR_FOUND
"Eigen"
)
endif
()
endif
()
...
...
@@ -961,22 +1062,22 @@ if( (NOT BLAS_FOUND_WITH_PKGCONFIG) OR BLAS_GIVEN_BY_USER )
if
(
NOT BLAS_LIBRARIES
)
# BLAS in ATLAS library? (http://math-atlas.sourceforge.net/)
check_fortran_libraries
(
BLAS_LIBRARIES
BLAS
dgemm
""
"f77blas;atlas"
""
)
BLAS_LIBRARIES
BLAS
dgemm
""
"f77blas;atlas"
""
)
if
(
NOT BLAS_FIND_QUIETLY
)
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for Atlas BLAS: found"
)
else
()
message
(
STATUS
"Looking for Atlas BLAS: not found"
)
endif
()
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for Atlas BLAS: found"
)
else
()
message
(
STATUS
"Looking for Atlas BLAS: not found"
)
endif
()
endif
()
if
(
BLAS_LIBRARIES
)
set
(
BLAS_VENDOR_FOUND
"Atlas"
)
set
(
BLAS_VENDOR_FOUND
"Atlas"
)
endif
()
endif
()
...
...
@@ -988,22 +1089,22 @@ if( (NOT BLAS_FOUND_WITH_PKGCONFIG) OR BLAS_GIVEN_BY_USER )
if
(
NOT BLAS_LIBRARIES
)
check_fortran_libraries
(
BLAS_LIBRARIES
BLAS
sgemm
""
"sgemm;dgemm;blas"
""
)
BLAS_LIBRARIES
BLAS
sgemm
""
"sgemm;dgemm;blas"
""
)
if
(
NOT BLAS_FIND_QUIETLY
)
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for PhiPACK BLAS: found"
)
else
()
message
(
STATUS
"Looking for PhiPACK BLAS: not found"
)
endif
()
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for PhiPACK BLAS: found"
)
else
()
message
(
STATUS
"Looking for PhiPACK BLAS: not found"
)
endif
()
endif
()
if
(
BLAS_LIBRARIES
)
set
(
BLAS_VENDOR_FOUND
"PhiPACK"
)
set
(
BLAS_VENDOR_FOUND
"PhiPACK"
)
endif
()
endif
()
...
...
@@ -1015,22 +1116,22 @@ if( (NOT BLAS_FOUND_WITH_PKGCONFIG) OR BLAS_GIVEN_BY_USER )
if
(
NOT BLAS_LIBRARIES
)
check_fortran_libraries
(
BLAS_LIBRARIES
BLAS
sgemm
""
"cxml"
""
)
BLAS_LIBRARIES
BLAS
sgemm
""
"cxml"
""
)
if
(
NOT BLAS_FIND_QUIETLY
)
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for CXML BLAS: found"
)
else
()
message
(
STATUS
"Looking for CXML BLAS: not found"
)
endif
()
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for CXML BLAS: found"
)
else
()
message
(
STATUS
"Looking for CXML BLAS: not found"
)
endif
()
endif
()
if
(
BLAS_LIBRARIES
)
set
(
BLAS_VENDOR_FOUND
"CXML"
)
set
(
BLAS_VENDOR_FOUND
"CXML"
)
endif
()
endif
()
...
...
@@ -1042,22 +1143,22 @@ if( (NOT BLAS_FOUND_WITH_PKGCONFIG) OR BLAS_GIVEN_BY_USER )
if
(
NOT BLAS_LIBRARIES
)
check_fortran_libraries
(
BLAS_LIBRARIES
BLAS
sgemm
""
"dxml"
""
)
BLAS_LIBRARIES
BLAS
sgemm
""
"dxml"
""
)
if
(
NOT BLAS_FIND_QUIETLY
)
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for DXML BLAS: found"
)
else
()
message
(
STATUS
"Looking for DXML BLAS: not found"
)
endif
()
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for DXML BLAS: found"
)
else
()
message
(
STATUS
"Looking for DXML BLAS: not found"
)
endif
()
endif
()
if
(
BLAS_LIBRARIES
)
set
(
BLAS_VENDOR_FOUND
"DXML"
)
set
(
BLAS_VENDOR_FOUND
"DXML"
)
endif
()
endif
()
...
...
@@ -1069,25 +1170,25 @@ if( (NOT BLAS_FOUND_WITH_PKGCONFIG) OR BLAS_GIVEN_BY_USER )
if
(
NOT BLAS_LIBRARIES
)
check_fortran_libraries
(
BLAS_LIBRARIES
BLAS
sgemm
"-xlic_lib=sunperf"
"sunperf;sunmath"
""
)
BLAS_LIBRARIES
BLAS
sgemm
"-xlic_lib=sunperf"
"sunperf;sunmath"
""
)
if
(
BLAS_LIBRARIES
)
set
(
BLAS_LDFLAGS_OTHER
"-xlic_lib=sunperf"
)
set
(
BLAS_LDFLAGS_OTHER
"-xlic_lib=sunperf"
)
endif
()
if
(
NOT BLAS_FIND_QUIETLY
)
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for SunPerf BLAS: found"
)
else
()
message
(
STATUS
"Looking for SunPerf BLAS: not found"
)
endif
()
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for SunPerf BLAS: found"
)
else
()
message
(
STATUS
"Looking for SunPerf BLAS: not found"
)
endif
()
endif
()
if
(
BLAS_LIBRARIES
)
set
(
BLAS_VENDOR_FOUND
"SunPerf"
)
set
(
BLAS_VENDOR_FOUND
"SunPerf"
)
endif
()
endif
()
...
...
@@ -1099,22 +1200,22 @@ if( (NOT BLAS_FOUND_WITH_PKGCONFIG) OR BLAS_GIVEN_BY_USER )
if
(
NOT BLAS_LIBRARIES
)
check_fortran_libraries
(
BLAS_LIBRARIES
BLAS
sgemm
""
"scsl"
""
)
BLAS_LIBRARIES
BLAS
sgemm
""
"scsl"
""
)
if
(
NOT BLAS_FIND_QUIETLY
)
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for SCSL BLAS: found"
)
else
()
message
(
STATUS
"Looking for SCSL BLAS: not found"
)
endif
()
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for SCSL BLAS: found"
)
else
()
message
(
STATUS
"Looking for SCSL BLAS: not found"
)
endif
()
endif
()
if
(
BLAS_LIBRARIES
)
set
(
BLAS_VENDOR_FOUND
"SunPerf"
)
set
(
BLAS_VENDOR_FOUND
"SunPerf"
)
endif
()
endif
()
...
...
@@ -1126,22 +1227,22 @@ if( (NOT BLAS_FOUND_WITH_PKGCONFIG) OR BLAS_GIVEN_BY_USER )
if
(
NOT BLAS_LIBRARIES
)
check_fortran_libraries
(
BLAS_LIBRARIES
BLAS
sgemm
""
"complib.sgimath"
""
)
BLAS_LIBRARIES
BLAS
sgemm
""
"complib.sgimath"
""
)
if
(
NOT BLAS_FIND_QUIETLY
)
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for SGIMATH BLAS: found"
)
else
()
message
(
STATUS
"Looking for SGIMATH BLAS: not found"
)
endif
()
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for SGIMATH BLAS: found"
)
else
()
message
(
STATUS
"Looking for SGIMATH BLAS: not found"
)
endif
()
endif
()
if
(
BLAS_LIBRARIES
)
set
(
BLAS_VENDOR_FOUND
"SGIMATH"
)
set
(
BLAS_VENDOR_FOUND
"SGIMATH"
)
endif
()
endif
()
...
...
@@ -1153,22 +1254,22 @@ if( (NOT BLAS_FOUND_WITH_PKGCONFIG) OR BLAS_GIVEN_BY_USER )
if
(
NOT BLAS_LIBRARIES
)
check_fortran_libraries
(
BLAS_LIBRARIES
BLAS
sgemm
""
"essl"
""
)
BLAS_LIBRARIES
BLAS
sgemm
""
"essl"
""
)
if
(
NOT BLAS_FIND_QUIETLY
)
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for IBM ESSL BLAS: found"
)
else
()
message
(
STATUS
"Looking for IBM ESSL BLAS: not found"
)
endif
()
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for IBM ESSL BLAS: found"
)
else
()
message
(
STATUS
"Looking for IBM ESSL BLAS: not found"
)
endif
()
endif
()
if
(
BLAS_LIBRARIES
)
set
(
BLAS_VENDOR_FOUND
"IBM ESSL"
)
set
(
BLAS_VENDOR_FOUND
"IBM ESSL"
)
endif
()
endif
()
...
...
@@ -1179,22 +1280,22 @@ if( (NOT BLAS_FOUND_WITH_PKGCONFIG) OR BLAS_GIVEN_BY_USER )
if
(
NOT BLAS_LIBRARIES
)
check_fortran_libraries
(
BLAS_LIBRARIES
BLAS
sgemm
""
"esslsmp"
""
)
BLAS_LIBRARIES
BLAS
sgemm
""
"esslsmp"
""
)
if
(
NOT BLAS_FIND_QUIETLY
)
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for IBM ESSL MT BLAS: found"
)
else
()
message
(
STATUS
"Looking for IBM ESSL MT BLAS: not found"
)
endif
()
if
(
BLAS_LIBRARIES
)
message
(
STATUS
"Looking for IBM ESSL MT BLAS: found"
)
else
()
message
(
STATUS
"Looking for IBM ESSL MT BLAS: not found"
)
endif
()
endif
()
if
(
BLAS_LIBRARIES
)
set
(
BLAS_VENDOR_FOUND
"IBM ESSL MT"
)
set
(
BLAS_VENDOR_FOUND
"IBM ESSL MT"
)
endif
()
endif
()
...
...
@@ -1205,66 +1306,66 @@ if( (NOT BLAS_FOUND_WITH_PKGCONFIG) OR BLAS_GIVEN_BY_USER )
if
(
BLA_VENDOR MATCHES
"ACML.*"
OR BLA_VENDOR STREQUAL
"All"
)
if
(
((
BLA_VENDOR STREQUAL
"ACML"
)
AND
(
NOT BLAS_ACML_LIB_DIRS
))
OR
((
BLA_VENDOR STREQUAL
"ACML_MP"
)
AND
(
NOT BLAS_ACML_MP_LIB_DIRS
))
OR
((
BLA_VENDOR STREQUAL
"ACML_GPU"
)
AND
(
NOT BLAS_ACML_GPU_LIB_DIRS
)))
((
BLA_VENDOR STREQUAL
"ACML_MP"
)
AND
(
NOT BLAS_ACML_MP_LIB_DIRS
))
OR
((
BLA_VENDOR STREQUAL
"ACML_GPU"
)
AND
(
NOT BLAS_ACML_GPU_LIB_DIRS
)))
# try to find acml in "standard" paths
if
(
WIN32
)
file
(
GLOB _ACML_ROOT
"C:/AMD/acml*/ACML-EULA.txt"
)
file
(
GLOB _ACML_ROOT
"C:/AMD/acml*/ACML-EULA.txt"
)
else
()
file
(
GLOB _ACML_ROOT
"/opt/acml*/ACML-EULA.txt"
)
file
(
GLOB _ACML_ROOT
"/opt/acml*/ACML-EULA.txt"
)
endif
()
if
(
WIN32
)
file
(
GLOB _ACML_GPU_ROOT
"C:/AMD/acml*/GPGPUexamples"
)
file
(
GLOB _ACML_GPU_ROOT
"C:/AMD/acml*/GPGPUexamples"
)
else
()
file
(
GLOB _ACML_GPU_ROOT
"/opt/acml*/GPGPUexamples"
)
file
(
GLOB _ACML_GPU_ROOT
"/opt/acml*/GPGPUexamples"
)
endif
()
list
(
GET _ACML_ROOT 0 _ACML_ROOT
)
list
(
GET _ACML_GPU_ROOT 0 _ACML_GPU_ROOT
)
if
(
_ACML_ROOT
)
get_filename_component
(
_ACML_ROOT
${
_ACML_ROOT
}
PATH
)
if
(
SIZEOF_INTEGER EQUAL 8
)
set
(
_ACML_PATH_SUFFIX
"_int64"
)