GeezerVison is showing cmake.org — FindBLAS — CMake 4.5.0 Documentation
FindBLAS¶
Finds the installed Basic Linear Algebra Subprograms (BLAS) Fortran library,
which implements the BLAS linear-algebra interface:
At least one of the C, CXX, or Fortran languages must be enabled.
Imported Targets¶
This module provides the following Imported Targets:
BLAS::BLAS-
Target encapsulating the libraries and usage requirements to use BLAS,
available only if BLAS is found.
Result Variables¶
This module defines the following variables:
BLAS_FOUNDBoolean indicating whether the library implementing the BLAS interface
was found.
BLAS_LINKER_FLAGSList of required linker flags, excluding -l and -L,
to pass to target_link_options().
BLAS_LIBRARIESList of libraries to link via target_link_libraries()
to use BLAS (may be empty if compiler implicitly links BLAS).
BLAS95_LIBRARIESList of libraries to link via target_link_libraries()
to use BLAS95 interface.
BLAS95_FOUNDBoolean indicating whether the library implementing the BLAS95 interface
was found.
Input Variables¶
The following variables may be set to influence this module's behavior:
BLA_STATICIf ON, the static linkage will be used.
BLA_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 ON, the module tries to find the BLAS95 interfaces.
BLA_PREFER_PKGCONFIG-
If set, pkg-config will be used to search for a BLAS library first
and if one is found that is preferred
BLA_PKGCONFIG_BLAS-
If set, the pkg-config method will look for this module name instead of
just blas.
BLA_SIZEOF_INTEGER-
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.
BLA_THREAD-
Specify the BLAS/LAPACK threading model:
SEQSequential model
OMPOpenMP model
ANYSearch for any BLAS/LAPACK, if both are available most likely OMP will
be found.
This is currently only supported by NVIDIA NVPL.
BLAS/LAPACK Vendors¶
GenericGeneric reference implementation.
ACML, ACML_MP, ACML_GPUAMD Core Math Library
AOCL, AOCL_mt-
AMD Optimizing CPU Libraries.
Apple, NASApple BLAS (Accelerate), and Apple NAS (vecLib).
Arm, Arm_mp, Arm_ilp64, Arm_ilp64_mp-
Arm Performance Libraries.
ATLASAutomatically Tuned Linear Algebra Software.
CXML, DXMLCompaq/Digital Extended Math Library.
EML, EML_mt-
Elbrus Math Library.
FLAME-
BLIS Framework.
FlexiBLAS-
Fujitsu_SSL2, Fujitsu_SSL2BLAMP, Fujitsu_SSL2SVE, Fujitsu_SSL2BLAMPSVE-
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_64ilp-
Intel MKL v10+ 64 bit, threaded code, ilp64 model.
Intel10_64ilp_seq-
Intel MKL v10+ 64 bit, sequential code, ilp64 model.
Intel10_64_dyn-
Intel MKL v10+ 64 bit, single dynamic library.
libblastrampoline-
A BLAS/LAPACK demuxing library using PLT trampolines.
NVPL-
NVIDIA Performance Libraries.
NVHPC-
NVIDIA HPC SDK.
OpenBLAS-
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
Examples¶
Finding BLAS and linking it to a project target:
find_package(BLAS)
target_link_libraries(example PRIVATE BLAS::BLAS)
|