Faiss: build faiss problem(An implementation of BLAS is required but none was found)

Created on 10 Jan 2019  ·  7Comments  ·  Source: facebookresearch/faiss

Summary

i get a message that "configure: error: An implementation of BLAS is required but none was found. " when i run ./configure:

checking if sgemm_ is being linked in already... no
checking for sgemm_ in -lmkl_intel_lp64... no
checking for sgemm_ in -lmkl... no
checking for sgemm_ in -lopenblas... no
checking for ATL_xerbla in -latlas... no
checking for sgemm_ in -lblas... no
checking for sgemm_ in -framework vecLib... no
checking for sgemm_ in -lcxml... no
checking for sgemm_ in -ldxml... no
checking for sgemm_ in -lscs... no
checking for sgemm_ in -lcomplib.sgimath... no
checking for sgemm_ in -lblas... (cached) no
checking for sgemm_ in -lblas... (cached) no
configure: error: An implementation of BLAS is required but none was found.

my step is:

  1. download faiss-master.zip and unzip it
  2. download OpenBLAS-0.2.20.tar.gz and extract , then enter the OpenBLAS-0.2.20 dir and run make, generated libopenblas.a
  3. enter the faiss-master dir and "cp example_makefiles/makefile.inc.Linux makefile.inc"
  4. run ./configure, but report error: configure: error: An implementation of BLAS is required but none was found

how to resolve this problem? thanks!

Part of makefile.inc

CPPFLAGS += -DFINTEGER=int
LIBS += -L/home/nikoxiong/OpenBLAS-0.2.20 -lopenblas -L/home/nikoxiong/lapack-3.8.0 -llapack

Platform

(gcc version 4.4.6 20110731
(Red Hat 4.4.6-3) (GCC) )

Faiss version: latest

Faiss compilation options: ./configure && make

Running on:

  • [x] CPU

Interface:

  • [x] C++
install

Most helpful comment

What does make install in OpenBlas mean?

All 7 comments

You should make install in OpenBlas, otherwise faiss won't find it.

You should make install in OpenBlas, otherwise faiss won't find it.

thanks you , i resolved it.
however, i just get the file named libopenblas.so after make install , thus i annotate the "-llapack" in makefile.inc so that i could build faiss success. Does this situation indicate that faiss do not need the -llapack when use openblas?

#
# 2. Openblas
#
# The library contains both BLAS and Lapack. About 30% slower than MKL. Please see
#   https://github.com/facebookresearch/faiss/wiki/Troubleshooting#slow-brute-force-search-with-openblas
# to fix performance problemes with OpenBLAS

# for Ubuntu 16:
# sudo apt-get install libopenblas-dev python-numpy python-dev

# for Ubuntu 14:
# sudo apt-get install libopenblas-dev liblapack3 python-numpy python-dev

CPPFLAGS += -DFINTEGER=int
LIBS     += -lopenblas #-llapack

IIRC OpenBlas includes a Lapack implem by default.

What does make install in OpenBlas mean?

@beauby I did make install for OpenBLAS and still got this error message.

What does make install in OpenBlas mean?

git clone https://github.com/xianyi/OpenBLAS.git

cd OpenBLAS

make

make install

@beauby I did make install for OpenBLAS and still got this error message.

Don't forget
ln -s .../lib/libopenblas.so /usr/lib/libopenblas.so

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brunodoamaral picture brunodoamaral  ·  3Comments

xxllp picture xxllp  ·  3Comments

maozezhong picture maozezhong  ·  3Comments

lukedeo picture lukedeo  ·  3Comments

Tony-Hou picture Tony-Hou  ·  3Comments