From e99e785719f8f636f2cb262f24488a7a7fbc212c Mon Sep 17 00:00:00 2001 From: Naveen Tatikonda Date: Mon, 23 Oct 2023 18:47:51 -0500 Subject: [PATCH] Fix Windows CI Signed-off-by: Naveen Tatikonda --- .github/workflows/CI.yml | 83 +++++++++++++++++++++------------------- jni/src/jni_util.cpp | 4 +- 2 files changed, 47 insertions(+), 40 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 31d16f21f9..43e95bb228 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -12,49 +12,49 @@ on: - "feature/**" jobs: - Build-k-NN: - strategy: - matrix: - java: [11, 17] - os: [ubuntu-latest, macos-latest] - - name: Build and Test k-NN Plugin - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout k-NN - uses: actions/checkout@v1 - - - name: Setup Java ${{ matrix.java }} - uses: actions/setup-java@v1 - with: - java-version: ${{ matrix.java }} - - - name: Install dependencies on ubuntu - if: startsWith(matrix.os,'ubuntu') - run: | - sudo apt-get install libopenblas-dev gfortran -y - - - name: Install dependencies on macos - if: startsWith(matrix.os, 'macos') - run: | - brew reinstall gcc - export FC=/usr/local/Cellar/gcc/12.2.0/bin/gfortran - - - name: Run build - run: | - ./gradlew build - - - name: Upload Coverage Report - if: startsWith(matrix.os,'ubuntu') - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} +# Build-k-NN: +# strategy: +# matrix: +# java: [11, 17] +# os: [ubuntu-latest, macos-latest] +# +# name: Build and Test k-NN Plugin +# runs-on: ${{ matrix.os }} +# +# steps: +# - name: Checkout k-NN +# uses: actions/checkout@v1 +# +# - name: Setup Java ${{ matrix.java }} +# uses: actions/setup-java@v1 +# with: +# java-version: ${{ matrix.java }} +# +# - name: Install dependencies on ubuntu +# if: startsWith(matrix.os,'ubuntu') +# run: | +# sudo apt-get install libopenblas-dev gfortran -y +# +# - name: Install dependencies on macos +# if: startsWith(matrix.os, 'macos') +# run: | +# brew reinstall gcc +# export FC=/usr/local/Cellar/gcc/12.2.0/bin/gfortran +# +# - name: Run build +# run: | +# ./gradlew build +# +# - name: Upload Coverage Report +# if: startsWith(matrix.os,'ubuntu') +# uses: codecov/codecov-action@v1 +# with: +# token: ${{ secrets.CODECOV_TOKEN }} Build-k-NN-Windows: strategy: matrix: - java: [ 11, 17 ] + java: [ 11 ] name: Build and Test k-NN Plugin on Windows runs-on: windows-latest @@ -77,7 +77,12 @@ jobs: - name: Add MinGW to PATH run: | echo "C:/Users/runneradmin/scoop/apps/mingw/current/bin" >> $env:GITHUB_PATH + Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" refreshenv +# iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) +# choco install -y git +# $env:ChocolateyInstall = Convert-Path "$((Get-Command choco).Path)\..\.." + - name: Download OpenBLAS run: | diff --git a/jni/src/jni_util.cpp b/jni/src/jni_util.cpp index cb9270c22b..c6f6e7561f 100644 --- a/jni/src/jni_util.cpp +++ b/jni/src/jni_util.cpp @@ -16,6 +16,7 @@ #include #include #include +#include void knn_jni::JNIUtil::Initialize(JNIEnv *env) { @@ -276,7 +277,8 @@ std::vector knn_jni::JNIUtil::ConvertJavaIntArrayToCppIntVector(JNIEnv for(int i = 0; i < numElements; ++i) { vectorCpp.push_back(arrayCpp[i]); } - env->ReleaseIntArrayElements(arrayJ, arrayCpp, JNI_ABORT); +// env->ReleaseIntArrayElements(arrayJ, (jint*)arrayCpp, JNI_ABORT); +env->ReleaseIntArrayElements(arrayJ, arrayCpp, JNI_ABORT); return vectorCpp; }