diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 15e86c3bd..7dce4c174 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -59,6 +59,15 @@ jobs: - name: Checkout k-NN uses: actions/checkout@v1 + - name: Apply Git Patch + # Deleting file at the end to skip `git apply` inside CMAKE file + run: | + git submodule update --init -- jni/external/faiss + cd jni/external/faiss + git apply --ignore-space-change --ignore-whitespace --3way ../../patches/faiss/0001-Add-missing-headers-for-gcc.patch + rm ../../patches/faiss/0001-Add-missing-headers-for-gcc.patch + working-directory: ${{ github.workspace }} + - name: Setup Java ${{ matrix.java }} uses: actions/setup-java@v1 with: @@ -76,6 +85,15 @@ jobs: Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" refreshenv + - name: Install Zlib Using Scoop + run: | + echo "C:/Users/runneradmin/scoop/shims" >> $env:GITHUB_PATH + Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" + refreshenv + scoop bucket add extras + scoop install zlib + regedit /s "C:\\Users\\runneradmin\\scoop\\apps\\zlib\\current\\register.reg" + - name: Download OpenBLAS run: | curl -L -O https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-x64.zip diff --git a/jni/include/jni_util.h b/jni/include/jni_util.h index 8d6f2b6f6..b4dd44891 100644 --- a/jni/include/jni_util.h +++ b/jni/include/jni_util.h @@ -17,6 +17,7 @@ #include #include #include +#include namespace knn_jni { diff --git a/jni/patches/faiss/0001-Add-missing-headers-for-gcc.patch b/jni/patches/faiss/0001-Add-missing-headers-for-gcc.patch new file mode 100644 index 000000000..876dd8323 --- /dev/null +++ b/jni/patches/faiss/0001-Add-missing-headers-for-gcc.patch @@ -0,0 +1,26 @@ +diff --git a/faiss/Clustering.h b/faiss/Clustering.h +index ef1f00ad..ae341115 100644 +--- a/faiss/Clustering.h ++++ b/faiss/Clustering.h +@@ -10,7 +10,7 @@ + #ifndef FAISS_CLUSTERING_H + #define FAISS_CLUSTERING_H + #include +- ++#include + #include + + namespace faiss { +diff --git a/faiss/Index.h b/faiss/Index.h +index 3d1bdb99..eaed1b14 100644 +--- a/faiss/Index.h ++++ b/faiss/Index.h +@@ -16,6 +16,8 @@ + #include + #include + ++#include ++ + #define FAISS_VERSION_MAJOR 1 + #define FAISS_VERSION_MINOR 8 + #define FAISS_VERSION_PATCH 0