Open SherlockC787 opened 2 years ago
These functions are from the BLAS library. Please check if the link command line includes BLAS.
These functions are from the BLAS library. Please check if the link command line includes BLAS.
Thank you for your reply.
I found that I was using the OPEN_BLAS library before and I tried to use the BLAS library just now, however, it still reported the same error.
Here is the FindBLAS.cmake
I wrote, which corresponds to line 238
of /faiss/Cmakelists.txt
.
# This is the previous version
FIND_PATH(BLAS_INCLUDE_DIR *.h /home/liu/myLib/openblas_arm/include/)
message("./h dir ${BLAS_INCLUDE_DIR}")
#
FIND_LIBRARY(BLAS_LIBRARY *.a /home/liu/myLib/openblas_arm/lib)
message("lib dir: ${BLAS_LIBRARY}")
if(BLAS_INCLUDE_DIR AND BLAS_LIBRARY)
# set result
set(BLAS_FOUND TRUE)
endif(BLAS_INCLUDE_DIR AND BLAS_LIBRARY)
# This is the new version
FIND_LIBRARY(BLAS_LIBRARY *.a /home/liu/myLib/blas/lib)
message("lib dir: ${BLAS_LIBRARY}")
if(BLAS_INCLUDE_DIR AND BLAS_LIBRARY)
# set result
set(BLAS_FOUND TRUE)
endif(BLAS_INCLUDE_DIR AND BLAS_LIBRARY)
I don't know what's wrong, but it makes sense that after make -j4 faiss
runs successfully, it should be fine to run the demo...
Is the problem resolved?
I am facing the same issue.
I cross-compiled OpenBLAS using NDK I cross-compiled FAISS using the NDK (same toolchain)
I want to use the cross-compiled OpenBLAS with FAISS, so I do the following in the faiss/CMakeLists.txt find_package(BLAS REQUIRED) target_link_libraries(faiss PRIVATE ${BLAS_LIBRARIES})
The faiss cross-compiles successfully, but when the compile the SIFT demo, it gives me basic errors in linking with OpenBLAS
ld: error: undefined symbol: sgemm_
referenced by IndexHNSW.cpp
Summary
I tried to run faiss on arm32 platform by cross-compiling. i followed the following steps.
follow the official 'INSTALL.md' file exactly to compile the faiss library. I can successfully run 'demo_ivfpq_indexing.cpp', '1-Flat.cpp' and other examples on Ubuntu 16.04.
Based on the success of step 1, I recompiled the faiss library using the cross-compilation chain following the steps in 'INSTALL.md' (manually installing the LAPACK and OPEN_Blas libraries, where the OPEN_Blas library was also cross-compiled), I wrote the 'build.sh' file (given later), and all the steps went smoothly (including ' make faiss') until I compile the example 'demo_ivfpq_indexing' and get a series of "undefined reference to 'xxx'" errors. I don't know how to deal with these problems.
Platform
OS: Host_platform->Ubuntu 16.04 (x86_64). Target_platform->Linux 4.19.111 (armv7l)
Faiss version: 1.7.2
Installed from: anaconda (follow INSTALL.md)
Faiss compilation options: (follow INSTALL.md)
Running on:
Interface:
Reproduction instructions
build.sh for cross-compile
The errors