ewfian / faiss-node

Node.js bindings for faiss
https://www.npmjs.com/package/faiss-node
MIT License
107 stars 10 forks source link

Docker Build Fails on ARM v7 #44

Closed abuaboud closed 11 months ago

abuaboud commented 11 months ago

Environment:

I'm using the node:18.17.1-bullseye image to create an image for different types of computers, including armv7, amd64, and arm64. To get the necessary stuff, I'm running apt update && apt install -y cmake libopenblas-dev patchelf.

This setup works well for arm64 and amd64 computers, but it's not working right for the armv7 computer. You can see the full error message here: GitHub Action Run.

Here's the error message for the armv7 computer:

#29 70.21 npm ERR! CMake Error at CMakeLists.txt:51 (add_subdirectory):
#29 70.21 npm ERR!   add_subdirectory given source "deps/faiss" which is not an existing
#29 70.21 npm ERR!   directory.
#29 70.21 npm ERR! 
#29 70.21 npm ERR! 
#29 70.21 npm ERR! CMake Error at CMakeLists.txt:52 (set_target_properties):
#29 70.21 npm ERR!   set_target_properties Can not find target to add properties to: faiss
#29 70.21 npm ERR! 
#29 70.21 npm ERR! 
#29 70.21 npm ERR! Debian:aarch64
#29 70.21 npm ERR! Copy DEPENDANCES: /lib/aarch64-linux-gnu/libgomp.so.1
#29 70.21 npm ERR! Copy DEPENDANCES: /lib/aarch64-linux-gnu/libopenblas.so.0
#29 70.21 npm ERR! Copy DEPENDANCES: /lib/aarch64-linux-gnu/libgfortran.so.5
#29 70.21 npm ERR! ERR! OMG Process terminated: 1

I'm looking for ideas on how to make it work properly on the ARM/v7, Can you guide me where i should be looking at?

ewfian commented 11 months ago

@abuaboud This is because the source code of the dependent faiss does not exist.

Will fix this issue by adding following line into install hook of package.json

git clone -b v1.7.4 --depth 1 https://github.com/facebookresearch/faiss.git deps/faiss

image

As a temporary workaround, you can try to clone the faiss source code to the faiss-node directory before installing.

ewfian commented 11 months ago

And you will also needs git pre-installed. See: https://github.com/ewfian/faiss-node/pull/45/commits/0fb2a78df548187bb4d4efdf521c00d049b423a5

ewfian commented 10 months ago

@abuaboud New version (0.5.1) just released