clMathLibraries / clBLAS

a software library containing BLAS functions written in OpenCL
Apache License 2.0
839 stars 240 forks source link

Could NOT find NETLIB (missing: Netlib_BLAS_LIBRARY) #168

Closed zygmuntz closed 8 years ago

zygmuntz commented 8 years ago

I get the following error when building on Ubuntu 14.04 with Nvidia GPU (Amazon EC2 g2.2 instance). How to fix it?

$ cmake ..
-- You have confirmed OpenCL 1.2 is supported in your system
-- CORR_TEST_WITH_ACML set to ON
-- Target platform: 64-bit
-- Using default OpenCL Compiler
-- Could NOT find NETLIB (missing:  Netlib_BLAS_LIBRARY)
CMake Warning at FindNetlib.cmake:106 (message):
  FindNetlib could not find the Netlib library
Call Stack (most recent call first):
  CMakeLists.txt:200 (find_package)

-- Did you remember to set the Netlib_ROOT environment variable?

I tried setting Netlib_ROOT before cmake .., didn't help:

  499  export Netlib_ROOT=/opt/OpenBLAS/lib
  502  export Netlib_ROOT=/etc/alternatives/
  504  export Netlib_ROOT=/usr/lib
  506  export Netlib_ROOT=/usr/lib/atlas-base/atlas
  509  export Netlib_ROOT=/usr/lib/openblas-base

BLAS is in place:

$ locate libblas | grep \.so
/etc/alternatives/libblas.so
/etc/alternatives/libblas.so.3
/etc/alternatives/libblas.so.3gf
/usr/lib/libblas.so
/usr/lib/libblas.so.3
/usr/lib/libblas.so.3gf
/usr/lib/atlas-base/atlas/libblas.so
/usr/lib/atlas-base/atlas/libblas.so.3
/usr/lib/atlas-base/atlas/libblas.so.3.0
/usr/lib/libblas/libblas.so
/usr/lib/libblas/libblas.so.3
/usr/lib/libblas/libblas.so.3.0
/usr/lib/openblas-base/libblas.so
/usr/lib/openblas-base/libblas.so.3
/var/lib/dpkg/alternatives/libblas.so
/var/lib/dpkg/alternatives/libblas.so.3
ghisvail commented 8 years ago

The embedded FindNetlib.cmake is quite fragile. It could be enhanced by adding an additional detection step via pkg-config.

If all FindNetlib.cmake is doing is trying to find BLAS, I wonder why the standard FindBLAS.cmake from upstream CMake cannot be used instead.

zygmuntz commented 8 years ago

As a work-around, building with -DBUILD_TEST:BOOL=OFF works.

ghisvail commented 8 years ago

Is this issue solved ? I don't consider building without tests an acceptable solution.

zygmuntz commented 8 years ago

OK, re-opening.

TimmyLiu commented 8 years ago

Hi with PR #181 on my Ubuntu system I can find and build test with libblas.so fairly straightforward. Can you verify that it works for you?

ghisvail commented 8 years ago

Hi @TimmyLiu, thanks for working on this. I will apply this commit on the packaging and check if I can now enable the tests successfully.