# FindBLAS: Could not find BLAS on Windows

**URL:** https://discourse.cmake.org/t/findblas-could-not-find-blas-on-windows/3346
**Category:** Usage
**Tags:** os:windows
**Created:** [May 17, 2021, 2:57pm UTC](https://discourse.cmake.org/t/findblas-could-not-find-blas-on-windows/3346 "2021-05-17T14:57:21Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![balamurata123](https://discourse.cmake.org/user_avatar/discourse.cmake.org/balamurata123/32/1457_2.png) [@balamurata123](https://discourse.cmake.org/u/balamurata123)
#### Post date: [May 17, 2021, 2:57pm UTC](https://discourse.cmake.org/t/findblas-could-not-find-blas-on-windows/3346/1 "2021-05-17T14:57:21Z")

</div>

Hello,

I have been trying to use cmake for the build of some libraries from [GitHub - Argonne-National-Laboratory/neml: Modular consitutive modeling library for structural materials](https://github.com/Argonne-National-Laboratory/neml). For this package, BLAS and LAPACK are required. This is on Windows 10, my cmake version is 3.20.2 and BLAS/LAPACK were installed from the Lapack package 3.9.1. from here ([LAPACK for Windows](http://icl.cs.utk.edu/lapack-for-windows/lapack/)). After invoking `cmake` for this neml library:  
`cmake -DCMAKE_CXX_COMPILER=icl.exe -DBLAS_blas_LIBRARY=D:\GITlib\lapack_build\bin\libblas.dll -DLAPACK_lapack_LIBRARY=D:\GITlib\lapack_build\bin\liblapack.dll -DBoost_INCLUDE_DIR="D:\GITlib\boost" -DCMAKE_BUILD_TYPE=Release -DUSE_OPENMP=False -G Ninja .`

I get the following error:  
`CMake Error at D:/GITlib/cmake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find BLAS (missing: BLAS_LIBRARIES) Call Stack (most recent call first): D:/GITlib/cmake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE) D:/GITlib/cmake/share/cmake-3.20/Modules/FindBLAS.cmake:1045 (find_package_handle_standard_args) CMakeLists.txt:42 (FIND_PACKAGE)`

I have looked into previous discussions on this, notably one for Win 10 and OpenBlas not being found, but it was not resolved. The suggestions there were to either add the path to blas.dll in the CMakeLists or add blas.dll location to PATH variable - both tried without success. Any help will be much appreciated. Thanks in advance!

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [May 18, 2021, 6:24pm UTC](https://discourse.cmake.org/t/findblas-could-not-find-blas-on-windows/3346/2 "2021-05-18T18:24:49Z")

</div>

Does using `--debug-find` offer any insight into where CMake is looking for the files involved with BLAS?

---

<div class="post-metadata">

### Author: ![balamurata123](https://discourse.cmake.org/user_avatar/discourse.cmake.org/balamurata123/32/1457_2.png) [@balamurata123](https://discourse.cmake.org/u/balamurata123)
#### Post date: [May 18, 2021, 8:05pm UTC](https://discourse.cmake.org/t/findblas-could-not-find-blas-on-windows/3346/3 "2021-05-18T20:05:25Z")

</div>

Hello Ben,  
I assume you meant putting `--debug-find` in the `cmake` command line. Output below:

```auto
D:\GITlib\neml>cmake -DCMAKE_CXX_COMPILER=icl.exe -DBLAS_blas_LIBRARY=D:\GITlib\lapack_build\bin\libblas.dll -DLAPACK_lapack_LIBRARY=D:\GITlib\lapack_build\bin\liblapack.dll --debug-find -DBoost_INCLUDE_DIR="D:\GITlib\boost" -DCMAKE_BUILD_TYPE=Release -DUSE_OPENMP=False -G Ninja .
Running with debug output on for the `find` commands.
CMake Error at D:/GITlib/cmake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find BLAS (missing: BLAS_LIBRARIES)
Call Stack (most recent call first):
  D:/GITlib/cmake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  D:/GITlib/cmake/share/cmake-3.20/Modules/FindBLAS.cmake:1045 (find_package_handle_standard_args)
  CMakeLists.txt:42 (FIND_PACKAGE)

CMake Debug Log at CMakeLists.txt:42 (FIND_PACKAGE):
  find_package considered the following paths for BLAS.cmake

    D:/GITlib/neml/cmake/Modules/FindBLAS.cmake

  The file was found at

    D:/GITlib/cmake/share/cmake-3.20/Modules/FindBLAS.cmake

```

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [May 18, 2021, 8:14pm UTC](https://discourse.cmake.org/t/findblas-could-not-find-blas-on-windows/3346/4 "2021-05-18T20:14:47Z")

</div>

Hmm. That would indicate that nothing even attempted a `find_library` call. Weird. This module is…quite complicated. @chuckatkins any insights?

---

<div class="post-metadata">

### Author: ![mocobt](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mocobt/32/1683_2.png) [@mocobt](https://discourse.cmake.org/u/mocobt)
#### Post date: [August 3, 2021, 8:06pm UTC](https://discourse.cmake.org/t/findblas-could-not-find-blas-on-windows/3346/5 "2021-08-03T20:06:13Z")

</div>

@balamurata123  
Have you solved the issue?  
If possible, could you write the solution?  
Thank you in advance.

---

<div class="post-metadata">

### Author: ![mornesto](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mornesto/32/1713_2.png) [@mornesto](https://discourse.cmake.org/u/mornesto)
#### Post date: [August 16, 2021, 7:38am UTC](https://discourse.cmake.org/t/findblas-could-not-find-blas-on-windows/3346/6 "2021-08-16T07:38:11Z")

</div>

@balamurata123@mocobt I had a similar issue on my end with older VS and Intel versions. Solution was - get a newer version of the latter two software. VS 2017 15.0 and Intel 2019 work fine and no issues with BLAS detected for such build. Thanks
