FindBLAS¶
Find Basic Linear Algebra Subprograms (BLAS) library
This module finds an installed Fortran library that implements the BLAS linear-algebra interface.
At least one of the C, CXX, or Fortran languages must be enabled.
Input Variables¶
The following variables may be set to influence this module's behavior:
BLA_STATICif
ONuse static linkageBLA_VENDORSet to one of the BLAS/LAPACK Vendors to search for BLAS only from the specified vendor. If not set, all vendors are considered.
BLA_F95if
ONtries to find the BLAS95 interfacesBLA_PREFER_PKGCONFIGNew in version 3.11.
if set
pkg-configwill be used to search for a BLAS library first and if one is found that is preferredBLA_PKGCONFIG_BLASNew in version 3.25.
If set, the
pkg-configmethod will look for this module name instead of justblas.BLA_SIZEOF_INTEGERNew in version 3.22.
Specify the BLAS/LAPACK library integer size:
4Search for a BLAS/LAPACK with 32-bit integer interfaces.
8Search for a BLAS/LAPACK with 64-bit integer interfaces.
ANYSearch for any BLAS/LAPACK. Most likely, a BLAS/LAPACK with 32-bit integer interfaces will be found.
Imported targets¶
This module defines the following IMPORTED targets:
BLAS::BLASNew in version 3.18.
The libraries to use for BLAS, if found.
Result Variables¶
This module defines the following variables:
BLAS_FOUNDlibrary implementing the BLAS interface is found
BLAS_LINKER_FLAGSuncached list of required linker flags (excluding
-land-L).BLAS_LIBRARIESuncached list of libraries (using full path name) to link against to use BLAS (may be empty if compiler implicitly links BLAS)
BLAS95_LIBRARIESuncached list of libraries (using full path name) to link against to use BLAS95 interface
BLAS95_FOUNDlibrary implementing the BLAS95 interface is found
BLAS/LAPACK Vendors¶
GenericGeneric reference implementation
ACML,ACML_MP,ACML_GPUAMD Core Math Library
AOCL,AOCL_mtNew in version 3.27.
AMD Optimizing CPU Libraries
Apple,NASApple BLAS (Accelerate), and Apple NAS (vecLib)
Arm,Arm_mp,Arm_ilp64,Arm_ilp64_mpNew in version 3.18.
Arm Performance Libraries
ATLASAutomatically Tuned Linear Algebra Software
CXML,DXMLCompaq/Digital Extended Math Library
EML,EML_mtNew in version 3.20.
Elbrus Math Library
FLAMENew in version 3.11.
BLIS Framework
FlexiBLASNew in version 3.19.
Fujitsu_SSL2,Fujitsu_SSL2BLAMP,Fujitsu_SSL2SVE,Fujitsu_SSL2BLAMPSVENew in version 3.20.
Fujitsu SSL2 serial and parallel blas/lapack with SVE instructions
GotoGotoBLAS
IBMESSL, IBMESSL_SMP
IBM Engineering and Scientific Subroutine Library
IntelIntel MKL 32 bit and 64 bit obsolete versions
Intel10_32Intel MKL v10 32 bit, threaded code
Intel10_64lpIntel MKL v10+ 64 bit, threaded code, lp64 model
Intel10_64lp_seqIntel MKL v10+ 64 bit, sequential code, lp64 model
Intel10_64ilpNew in version 3.13.
Intel MKL v10+ 64 bit, threaded code, ilp64 model
Intel10_64ilp_seqNew in version 3.13.
Intel MKL v10+ 64 bit, sequential code, ilp64 model
Intel10_64_dynNew in version 3.17.
Intel MKL v10+ 64 bit, single dynamic library
libblastrampolineNew in version 3.30.
A BLAS/LAPACK demuxing library using PLT trampolines
NVHPCNew in version 3.21.
NVIDIA HPC SDK
OpenBLASNew in version 3.6.
PhiPACKPortable High Performance ANSI C (PHiPAC)
SCSL,SCSL_mpScientific Computing Software Library
SGIMATHSGI Scientific Mathematical Library
SunPerfSun Performance Library
Intel MKL¶
To use the Intel MKL implementation of BLAS, a project must enable at least
one of the C or CXX languages. Set BLA_VENDOR to an Intel MKL
variant either on the command-line as -DBLA_VENDOR=Intel10_64lp or in
project code:
set(BLA_VENDOR Intel10_64lp)
find_package(BLAS)
In order to build a project using Intel MKL, and end user must first establish an Intel MKL environment:
- Intel oneAPI
Source the full Intel environment script:
. /opt/intel/oneapi/setvars.sh
Or, source the MKL component environment script:
. /opt/intel/oneapi/mkl/latest/env/vars.sh
- Intel Classic
Source the full Intel environment script:
. /opt/intel/bin/compilervars.sh intel64
Or, source the MKL component environment script:
. /opt/intel/mkl/bin/mklvars.sh intel64
The above environment scripts set the MKLROOT environment variable
to the top of the MKL installation. They also add the location of the
runtime libraries to the dynamic library loader environment variable for
your platform (e.g. LD_LIBRARY_PATH). This is necessary for programs
linked against MKL to run.
Note
As of Intel oneAPI 2021.2, loading only the MKL component does not
make all of its dependencies available. In particular, the iomp5
library must be available separately, or provided by also loading
the compiler component environment:
. /opt/intel/oneapi/compiler/latest/env/vars.sh