---
# System prepended metadata

title: Lapack in your CMake project

---

# Lapack in your CMake project

## Procedure

1. (Optional) If you don't have a conda environment for this project setup, create one.


````shell
$ conda create --name lapack python=3.8
````


2. Activate your project's conda environment.

````shell
$ conda activate lapack
````

3. Install `lapack++` from conda.

````shell
$ conda install -c conda-forge lapackpp 
````

4. Retrieve the conda environments prefix, where all dependencies are installed (Below is example of my output).

````shell
$ echo $CONDA_PREFIX
/home/ggarrett/miniconda3/envs/lapack
````

5. Copy this path, and set it as the CMake argument `$CMAKE_PREFIX_PATH` at the level of your main `CMakeLists.txt` file. The canonical way to do add this to your cmake configure step prior to building:

````bash

cmake \
  -DCMAKE_PREFIX_PATH=/home/ggarrett/miniconda3/envs/lapack \
  ..
  
````

In CLion this can by adding the following line

````
-DCMAKE_PREFIX_PATH=/home/ggarrett/miniconda3/envs/lapack
````

To your `CMake` options found here:

`File>Settings/Build, Execution, Deployment>CMake`


6. When ready, reload CMake and build as you would usually.