Skip to content

Commit

Permalink
fix: unknown CMake command "check_function_exists" (pytorch#126165)
Browse files Browse the repository at this point in the history
When building pytorch with OpenBLAS on windows I ran into this CMake issue:

```
CMake Error at cmake/Modules/FindLAPACK.cmake:137 (check_function_exists):
  Unknown CMake command "check_function_exists".
Call Stack (most recent call first):
  cmake/Dependencies.cmake:1745 (find_package)
  CMakeLists.txt:708 (include)
```

Similarly described here: https://discuss.pytorch.org/t/cmake-with-error-by-compiling-on-windows-with-mingw32-make/159140

This PR fixes this issue by adding:

```
include(CheckFunctionExists)
```

To the offending CMake file.
Pull Request resolved: pytorch#126165
Approved by: https://github.com/ezyang
  • Loading branch information
baszalmstra authored and pytorchmergebot committed May 14, 2024
1 parent 4a8db9d commit a8eac0e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cmake/Modules/FindLAPACK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ ENDIF(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)

# Old search lapack script
include(CheckFortranFunctionExists)
include(CheckFunctionExists)

macro(Check_Lapack_Libraries LIBRARIES _prefix _name _flags _list _blas)
# This macro checks for the existence of the combination of fortran libraries
Expand Down

0 comments on commit a8eac0e

Please sign in to comment.