FindLAPACK — CMake 4.4.3-dirty Documentation

# FindLAPACK

Finds the installed Linear Algebra PACKage (LAPACK) Fortran library that implements the LAPACK linear-algebra interface:

    find_package(LAPACK [...])

At least one of the `C`, `CXX`, or `Fortran` languages must be enabled.

## Imported Targets

This module provides the following Imported Targets:

`LAPACK::LAPACK`

  Added in version 3.18.

  Target encapsulating the LAPACK usage requirements, available only if LAPACK is found.

## Result Variables

This module defines the following variables:

`LAPACK_FOUND`

  Boolean indicating whether the library implementing the LAPACK interface was found.

`LAPACK_LINKER_FLAGS`

  Uncached list of required linker flags (excluding `-l` and `-L`).

`LAPACK_LIBRARIES`

  Uncached list of libraries (using full path name) to link against to use LAPACK.

`LAPACK95_LIBRARIES`

  Uncached list of libraries (using full path name) to link against to use LAPACK95.

`LAPACK95_FOUND`

  Boolean indicating whether the library implementing the LAPACK95 interface was found.

## Input Variables

The following variables may be set to influence this module's behavior:

`BLA_STATIC`

  If `ON`, the static linkage will be used.

`BLA_VENDOR`

  Set to one of the BLAS/LAPACK Vendors to search for BLAS only from the specified vendor. If not set, all vendors are considered.

`BLA_F95`

  If `ON`, the module tries to find the BLAS95/LAPACK95 interfaces.

`BLA_PREFER_PKGCONFIG`

  Added in version 3.20.

  If set, `pkg-config` will be used to search for a LAPACK library first and if one is found that is preferred.

`BLA_PKGCONFIG_LAPACK`

  Added in version 3.25.

  If set, the `pkg-config` method will look for this module name instead of just `lapack`.

`BLA_SIZEOF_INTEGER`

  Added in version 3.22.

  Specify the BLAS/LAPACK library integer size:

  `4`

    Search for a BLAS/LAPACK with 32-bit integer interfaces.

  `8`

    Search for a BLAS/LAPACK with 64-bit integer interfaces.

  `ANY`

    Search for any BLAS/LAPACK. Most likely, a BLAS/LAPACK with 32-bit integer interfaces will be found.

`BLA_THREAD`

  Added in version 4.1.

  Specify the BLAS/LAPACK threading model:

  `SEQ`

    Sequential model

  `OMP`

    OpenMP model

  `ANY`

    Search for any BLAS/LAPACK, if both are available most likely `OMP` will be found.

  This is currently only supported by NVIDIA NVPL.

## Intel MKL

To use the Intel MKL implementation of LAPACK, 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(LAPACK)

In order to build a project using Intel MKL, and end user must first establish an Intel MKL environment. See the `FindBLAS` module section on Intel MKL for details.

## Examples

Finding LAPACK and linking it to a project target:

    find_package(LAPACK)
    target_link_libraries(project_target PRIVATE LAPACK::LAPACK)