faiss
faiss copied to clipboard
How to build in msys2
Hello I would like to build faiss on windows using mingw64 in msys2 with mkl / openblas
Is there some place with instructions for that? I already tried and currently I'm facing issues with cmake which doesn't find mkl or openblas.
Please let us know if any progress in this environment.
I managed to build it on Windows in msys2
environemnt!
I had to change a little the source code to support MinGW
compiler.
-
Download msys2 from https://www.msys2.org/
-
Open
UCRT64
terminal Install dependencies
pacman --needed -S $MINGW_PACKAGE_PREFIX-{toolchain,cmake,make,swig,autotools,lapack} git
- Clone & Build
git clone https://github.com/thewh1teagle/faiss -b windows-mingw-support
cd faiss
cmake -B build . -G "MinGW Makefiles" -DFAISS_ENABLE_GPU=OFF -DFAISS_ENABLE_PYTHON=OFF -DCMAKE_CXX_FLAGS="-march=x86-64" -DCMAKE_C_FLAGS="-march=x86-64" -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=off
cmake --build build -- -j16
I am trying to compile under mingw as well, but am hitting the issue that mingw doesn't define posix_memalign
(used in AlignedTable.h
). Did you hit the same issue?
I am trying to compile under mingw as well, but am hitting the issue that mingw doesn't define
posix_memalign
(used inAlignedTable.h
). Did you hit the same issue?
Try in ucrt. Anyway, compiling this in msys2 environment is not something I would recommend, as in the end you'll need the DLLs of that environment so you will be able to run it outside of the environment. I would switch to other libs with better support for Windows such as spotify/annoy
We only support installing and building FAISS through conda on Windows. Here is an example nightly build that compiles FAISS on Microsoft Windows Server 2019: https://fburl.com/hbbh3ndc and the yaml file backing up that build is in https://fburl.com/code/2xcnxa77 (check the platform specific selectors for windows)
You can step through the instructions there which provide all of the related conda installation commands and the compilation arguments.
Feel free to re-open the issues if you struggle with building on windows + conda