facebookresearch / faiss

A library for efficient similarity search and clustering of dense vectors.
https://faiss.ai
MIT License
29.39k stars 3.48k forks source link

How to build in msys2 #3067

Open thewh1teagle opened 9 months ago

thewh1teagle commented 9 months ago

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.

mdouze commented 9 months ago

Please let us know if any progress in this environment.

thewh1teagle commented 6 months ago

I managed to build it on Windows in msys2 environemnt! I had to change a little the source code to support MinGW compiler.

  1. Download msys2 from https://www.msys2.org/

  2. Open UCRT64 terminal Install dependencies

    pacman --needed -S $MINGW_PACKAGE_PREFIX-{toolchain,cmake,make,swig,autotools,lapack} git
  3. 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