itpp icon indicating copy to clipboard operation
itpp copied to clipboard

cmake cannot find LAPACK and BLAS in MSYS2

Open minnyres opened this issue 2 years ago • 3 comments

I am trying to build itpp in MSYS2 on Windows. The packages FFTW, LAPACK and BLAS are installed with MSYS2, but cmake cannot find LAPACK and BLAS.

cat@LAPTOP-LBAI8P2A MINGW64 ~/itpp-r4.3.0/build
$ cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../../itpp-win64  ..

CMake Deprecation Warning at CMakeLists.txt:28 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for sgemm
-- Looking for sgemm - not found
-- Looking for sgemm
-- Looking for sgemm - not found
-- Looking for sgemm
-- Looking for sgemm - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- A library with BLAS API not found. Please specify library location.
-- A library with BLAS API not found. Please specify library location.
-- LAPACK requires BLAS
-- A library with LAPACK API not found. Please specify library location.
-- Found FFT: C:/msys64/mingw64/lib/libfftw3.dll.a
-- A library with FFT API found.
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Could NOT find LATEX (missing: LATEX_COMPILER)
-- Looking for include files sys/time.h, time.h
-- Looking for include files sys/time.h, time.h - found
-- Looking for dlfcn.h
-- Looking for dlfcn.h - not found
-- Looking for ieeefp.h
-- Looking for ieeefp.h - found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for memory.h
-- Looking for memory.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stdlib.h
-- Looking for stdlib.h - found
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for string.h
-- Looking for string.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for C++ include cmath
-- Looking for C++ include cmath - found
-- Looking for C++ include complex
-- Looking for C++ include complex - found
-- Looking for isfinite
-- Looking for isfinite - not found
-- Looking for isinf
-- Looking for isinf - not found
-- Looking for isnan
-- Looking for isnan - not found
-- Looking for signgam
-- Looking for signgam - found
-- Looking for acosh
-- Looking for acosh - found
-- Looking for asinh
-- Looking for asinh - found
-- Looking for atanh
-- Looking for atanh - found
-- Looking for cbrt
-- Looking for cbrt - found
-- Looking for erf
-- Looking for erf - found
-- Looking for erfc
-- Looking for erfc - found
-- Looking for expm1
-- Looking for expm1 - found
-- Looking for finite
-- Looking for finite - found
-- Looking for isfinite
-- Looking for isfinite - not found
-- Looking for isinf
-- Looking for isinf - not found
-- Looking for isnan
-- Looking for isnan - found
-- Looking for lgamma
-- Looking for lgamma - found
-- Looking for log1p
-- Looking for log1p - found
-- Looking for log2
-- Looking for log2 - found
-- Looking for rint
-- Looking for rint - found
-- Looking for tgamma
-- Looking for tgamma - found
-- Looking for std::isfinite
-- Looking for std::isfinite - found
-- Looking for std::isinf
-- Looking for std::isinf - found
-- Looking for std::isnan
-- Looking for std::isnan - found
CMake Warning at CMakeLists.txt:186 (message):
  BLAS library not found.


CMake Warning at CMakeLists.txt:190 (message):
  LAPACK library not found.


CMake Warning at CMakeLists.txt:198 (message):
  You can still compile IT++ but the functionality will be reduced.


-- Configuring done
-- Generating done
-- Build files have been written to: C:/msys64/home/cat/itpp-r4.3.0/build


minnyres avatar Apr 25 '22 15:04 minnyres

I solved this problem by replacing the modules with the followings from the git repository of CMAKE:

https://raw.githubusercontent.com/Kitware/CMake/master/Modules/FindPackageMessage.cmake https://raw.githubusercontent.com/Kitware/CMake/master/Modules/CheckFunctionExists.cmake https://raw.githubusercontent.com/Kitware/CMake/master/Modules/FindPackageHandleStandardArgs.cmake https://raw.githubusercontent.com/Kitware/CMake/master/Modules/FindBLAS.cmake https://raw.githubusercontent.com/Kitware/CMake/master/Modules/FindLAPACK.cmake

minnyres avatar Apr 26 '22 14:04 minnyres

I can't unfortunately neither support nor test MSYS2 builds myself. A pull request would be very much appreciated!

nvmd avatar Apr 26 '22 14:04 nvmd

I can't unfortunately neither support nor test MSYS2 builds myself. A pull request would be very much appreciated!

I made a pull request to update the cmake modules. It is tested on Windows and Linux with cmake version 3.23.1. We may further test whether it will break with old cmake versions.

minnyres avatar May 12 '22 03:05 minnyres