Summary
When building the C API in Alpine Linux, several build errors like these show up:
/tmp/faiss/c_api/utils/distances_c.h:26:9: error: 'int64_t' was not declared in this scope
26 | int64_t d,
| ^~~~~~~
Adding #include <stdint.h> in faiss/c_api/utils/distances_c.h fixes the issue and it builds successfully. I believe this is caused by Alpine Linux using musl libc. In glibc, stdlib.h appears to automatically include the definitions from stdint.h.
Platform
OS: Alpine Linux 3.18.4
Faiss version: 467f70e
Reproduction instructions
docker run -it alpine sh
apk add git cmake build-base blas-dev lapack-dev
cd /tmp
git clone --depth=1 https://github.com/facebookresearch/faiss.git
cd /tmp/faiss
cmake -B build . -DFAISS_ENABLE_GPU=OFF -DFAISS_ENABLE_PYTHON=OFF -DFAISS_ENABLE_C_API=ON
make -C build
Summary
When building the C API in Alpine Linux, several build errors like these show up:
Adding
#include <stdint.h>infaiss/c_api/utils/distances_c.hfixes the issue and it builds successfully. I believe this is caused by Alpine Linux using musl libc. In glibc, stdlib.h appears to automatically include the definitions from stdint.h.Platform
OS: Alpine Linux 3.18.4
Faiss version: 467f70e
Reproduction instructions