diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 21d85bf..3059907 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -33,7 +33,7 @@ jobs: - name: Cache maven packages uses: actions/cache@v2 env: - cache-name: cache-mvn + cache-name: cache-mvn2 with: path: ~/.m2 key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} diff --git a/src/main/java/com/microsoft/ml/lightgbm/CSRDirect.java b/src/main/java/com/microsoft/ml/lightgbm/CSRDirect.java index e04cca7..06673d5 100644 --- a/src/main/java/com/microsoft/ml/lightgbm/CSRDirect.java +++ b/src/main/java/com/microsoft/ml/lightgbm/CSRDirect.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 + * Version 4.2.1 * * Do not make changes to this file unless you know what you are doing - modify * the SWIG interface file instead. @@ -33,7 +33,7 @@ protected static long swigRelease(CSRDirect obj) { return ptr; } - @SuppressWarnings("deprecation") + @SuppressWarnings({"deprecation", "removal"}) protected void finalize() { delete(); } diff --git a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_ArrowArray.java b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_ArrowArray.java index 910fd24..88d5074 100644 --- a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_ArrowArray.java +++ b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_ArrowArray.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 + * Version 4.2.1 * * Do not make changes to this file unless you know what you are doing - modify * the SWIG interface file instead. diff --git a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_ArrowSchema.java b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_ArrowSchema.java index bffb5af..4be5168 100644 --- a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_ArrowSchema.java +++ b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_ArrowSchema.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 + * Version 4.2.1 * * Do not make changes to this file unless you know what you are doing - modify * the SWIG interface file instead. diff --git a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_double.java b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_double.java index a1b17d9..f3d1bf9 100644 --- a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_double.java +++ b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_double.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 + * Version 4.2.1 * * Do not make changes to this file unless you know what you are doing - modify * the SWIG interface file instead. diff --git a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_f_p_q_const__char__void.java b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_f_p_q_const__char__void.java index 8848b1b..cf94b26 100644 --- a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_f_p_q_const__char__void.java +++ b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_f_p_q_const__char__void.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 + * Version 4.2.1 * * Do not make changes to this file unless you know what you are doing - modify * the SWIG interface file instead. diff --git a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_float.java b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_float.java index 828f8af..8fe6657 100644 --- a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_float.java +++ b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_float.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 + * Version 4.2.1 * * Do not make changes to this file unless you know what you are doing - modify * the SWIG interface file instead. diff --git a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_int.java b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_int.java index 3a9a79f..fc6b6f0 100644 --- a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_int.java +++ b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_int.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 + * Version 4.2.1 * * Do not make changes to this file unless you know what you are doing - modify * the SWIG interface file instead. diff --git a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_long.java b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_long.java index e58ecbc..65f073c 100644 --- a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_long.java +++ b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_long.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 + * Version 4.2.1 * * Do not make changes to this file unless you know what you are doing - modify * the SWIG interface file instead. diff --git a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_long_long.java b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_long_long.java index 89429dd..4864da5 100644 --- a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_long_long.java +++ b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_long_long.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 + * Version 4.2.1 * * Do not make changes to this file unless you know what you are doing - modify * the SWIG interface file instead. diff --git a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_p_char.java b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_p_char.java index 27310ca..612dbab 100644 --- a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_p_char.java +++ b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_p_char.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 + * Version 4.2.1 * * Do not make changes to this file unless you know what you are doing - modify * the SWIG interface file instead. diff --git a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_p_double.java b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_p_double.java index 378f228..0176632 100644 --- a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_p_double.java +++ b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_p_double.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 + * Version 4.2.1 * * Do not make changes to this file unless you know what you are doing - modify * the SWIG interface file instead. diff --git a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_p_float.java b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_p_float.java index 2c2edef..f392b4c 100644 --- a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_p_float.java +++ b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_p_float.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 + * Version 4.2.1 * * Do not make changes to this file unless you know what you are doing - modify * the SWIG interface file instead. diff --git a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_p_int.java b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_p_int.java index ba7b17a..28c8699 100644 --- a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_p_int.java +++ b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_p_int.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 + * Version 4.2.1 * * Do not make changes to this file unless you know what you are doing - modify * the SWIG interface file instead. diff --git a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_p_void.java b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_p_void.java index 3d8e8bf..369d45d 100644 --- a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_p_void.java +++ b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_p_void.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 + * Version 4.2.1 * * Do not make changes to this file unless you know what you are doing - modify * the SWIG interface file instead. diff --git a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_size_t.java b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_size_t.java index a93a6b3..29554b0 100644 --- a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_size_t.java +++ b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_size_t.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 + * Version 4.2.1 * * Do not make changes to this file unless you know what you are doing - modify * the SWIG interface file instead. diff --git a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_unsigned_char.java b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_unsigned_char.java index 0c1ad86..585faec 100644 --- a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_unsigned_char.java +++ b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_unsigned_char.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 + * Version 4.2.1 * * Do not make changes to this file unless you know what you are doing - modify * the SWIG interface file instead. diff --git a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_void.java b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_void.java index ad085ad..b1a8a21 100644 --- a/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_void.java +++ b/src/main/java/com/microsoft/ml/lightgbm/SWIGTYPE_p_void.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 + * Version 4.2.1 * * Do not make changes to this file unless you know what you are doing - modify * the SWIG interface file instead. diff --git a/src/main/java/com/microsoft/ml/lightgbm/doubleChunkedArray.java b/src/main/java/com/microsoft/ml/lightgbm/doubleChunkedArray.java index 676a4c8..819cefe 100644 --- a/src/main/java/com/microsoft/ml/lightgbm/doubleChunkedArray.java +++ b/src/main/java/com/microsoft/ml/lightgbm/doubleChunkedArray.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 + * Version 4.2.1 * * Do not make changes to this file unless you know what you are doing - modify * the SWIG interface file instead. @@ -33,7 +33,7 @@ protected static long swigRelease(doubleChunkedArray obj) { return ptr; } - @SuppressWarnings("deprecation") + @SuppressWarnings({"deprecation", "removal"}) protected void finalize() { delete(); } diff --git a/src/main/java/com/microsoft/ml/lightgbm/floatChunkedArray.java b/src/main/java/com/microsoft/ml/lightgbm/floatChunkedArray.java index ffdf1d2..afe8eaf 100644 --- a/src/main/java/com/microsoft/ml/lightgbm/floatChunkedArray.java +++ b/src/main/java/com/microsoft/ml/lightgbm/floatChunkedArray.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 + * Version 4.2.1 * * Do not make changes to this file unless you know what you are doing - modify * the SWIG interface file instead. @@ -33,7 +33,7 @@ protected static long swigRelease(floatChunkedArray obj) { return ptr; } - @SuppressWarnings("deprecation") + @SuppressWarnings({"deprecation", "removal"}) protected void finalize() { delete(); } diff --git a/src/main/java/com/microsoft/ml/lightgbm/int32ChunkedArray.java b/src/main/java/com/microsoft/ml/lightgbm/int32ChunkedArray.java index f370b6d..47f0f5a 100644 --- a/src/main/java/com/microsoft/ml/lightgbm/int32ChunkedArray.java +++ b/src/main/java/com/microsoft/ml/lightgbm/int32ChunkedArray.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 + * Version 4.2.1 * * Do not make changes to this file unless you know what you are doing - modify * the SWIG interface file instead. @@ -33,7 +33,7 @@ protected static long swigRelease(int32ChunkedArray obj) { return ptr; } - @SuppressWarnings("deprecation") + @SuppressWarnings({"deprecation", "removal"}) protected void finalize() { delete(); } diff --git a/src/main/java/com/microsoft/ml/lightgbm/lightgbmlib.java b/src/main/java/com/microsoft/ml/lightgbm/lightgbmlib.java index 6f15b36..72d6858 100644 --- a/src/main/java/com/microsoft/ml/lightgbm/lightgbmlib.java +++ b/src/main/java/com/microsoft/ml/lightgbm/lightgbmlib.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 + * Version 4.2.1 * * Do not make changes to this file unless you know what you are doing - modify * the SWIG interface file instead. @@ -325,6 +325,10 @@ public static int LGBM_BoosterPredictForMats(SWIGTYPE_p_void handle, SWIGTYPE_p_ return lightgbmlibJNI.LGBM_BoosterPredictForMats(SWIGTYPE_p_void.getCPtr(handle), SWIGTYPE_p_p_void.getCPtr(data), data_type, nrow, ncol, predict_type, start_iteration, num_iteration, parameter, SWIGTYPE_p_long_long.getCPtr(out_len), SWIGTYPE_p_double.getCPtr(out_result)); } + public static int LGBM_BoosterPredictForArrow(SWIGTYPE_p_void handle, long n_chunks, SWIGTYPE_p_ArrowArray chunks, SWIGTYPE_p_ArrowSchema schema, int predict_type, int start_iteration, int num_iteration, String parameter, SWIGTYPE_p_long_long out_len, SWIGTYPE_p_double out_result) { + return lightgbmlibJNI.LGBM_BoosterPredictForArrow(SWIGTYPE_p_void.getCPtr(handle), n_chunks, SWIGTYPE_p_ArrowArray.getCPtr(chunks), SWIGTYPE_p_ArrowSchema.getCPtr(schema), predict_type, start_iteration, num_iteration, parameter, SWIGTYPE_p_long_long.getCPtr(out_len), SWIGTYPE_p_double.getCPtr(out_result)); + } + public static int LGBM_BoosterSaveModel(SWIGTYPE_p_void handle, int start_iteration, int num_iteration, int feature_importance_type, String filename) { return lightgbmlibJNI.LGBM_BoosterSaveModel(SWIGTYPE_p_void.getCPtr(handle), start_iteration, num_iteration, feature_importance_type, filename); } @@ -365,6 +369,14 @@ public static int LGBM_NetworkInitWithFunctions(int num_machines, int rank, SWIG return lightgbmlibJNI.LGBM_NetworkInitWithFunctions(num_machines, rank, SWIGTYPE_p_void.getCPtr(reduce_scatter_ext_fun), SWIGTYPE_p_void.getCPtr(allgather_ext_fun)); } + public static int LGBM_SetMaxThreads(int num_threads) { + return lightgbmlibJNI.LGBM_SetMaxThreads(num_threads); + } + + public static int LGBM_GetMaxThreads(SWIGTYPE_p_int out) { + return lightgbmlibJNI.LGBM_GetMaxThreads(SWIGTYPE_p_int.getCPtr(out)); + } + public static String LastErrorMsg() { return lightgbmlibJNI.LastErrorMsg(); } diff --git a/src/main/java/com/microsoft/ml/lightgbm/lightgbmlibConstants.java b/src/main/java/com/microsoft/ml/lightgbm/lightgbmlibConstants.java index d556eef..6cd8ed8 100644 --- a/src/main/java/com/microsoft/ml/lightgbm/lightgbmlibConstants.java +++ b/src/main/java/com/microsoft/ml/lightgbm/lightgbmlibConstants.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 + * Version 4.2.1 * * Do not make changes to this file unless you know what you are doing - modify * the SWIG interface file instead. diff --git a/src/main/java/com/microsoft/ml/lightgbm/lightgbmlibJAVA_wrap.cxx b/src/main/java/com/microsoft/ml/lightgbm/lightgbmlibJAVA_wrap.cxx index 4863166..3f7b12a 100644 --- a/src/main/java/com/microsoft/ml/lightgbm/lightgbmlibJAVA_wrap.cxx +++ b/src/main/java/com/microsoft/ml/lightgbm/lightgbmlibJAVA_wrap.cxx @@ -1,13 +1,13 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 + * Version 4.2.1 * * Do not make changes to this file unless you know what you are doing - modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ -#define SWIG_VERSION 0x040101 +#define SWIG_VERSION 0x040201 #define SWIGJAVA /* ----------------------------------------------------------------------------- @@ -134,6 +134,36 @@ # pragma warning disable 592 #endif +#if defined(__cplusplus) && __cplusplus >=201103L +# define SWIG_NULLPTR nullptr +#else +# define SWIG_NULLPTR NULL +#endif + +/* ----------------------------------------------------------------------------- + * swigcompat.swg + * + * Macros to provide support compatibility with older C and C++ standards. + * ----------------------------------------------------------------------------- */ + +/* C99 and C++11 should provide snprintf, but define SWIG_NO_SNPRINTF + * if you're missing it. + */ +#if ((defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) || \ + (defined __cplusplus && __cplusplus >= 201103L) || \ + defined SWIG_HAVE_SNPRINTF) && \ + !defined SWIG_NO_SNPRINTF +# define SWIG_snprintf(O,S,F,A) snprintf(O,S,F,A) +# define SWIG_snprintf2(O,S,F,A,B) snprintf(O,S,F,A,B) +#else +/* Fallback versions ignore the buffer size, but most of our uses either have a + * fixed maximum possible size or dynamically allocate a buffer that's large + * enough. + */ +# define SWIG_snprintf(O,S,F,A) sprintf(O,F,A) +# define SWIG_snprintf2(O,S,F,A,B) sprintf(O,F,A,B) +#endif + #include #include @@ -3238,6 +3268,43 @@ SWIGEXPORT jint JNICALL Java_com_microsoft_ml_lightgbm_lightgbmlibJNI_LGBM_1Boos } +SWIGEXPORT jint JNICALL Java_com_microsoft_ml_lightgbm_lightgbmlibJNI_LGBM_1BoosterPredictForArrow(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3, jlong jarg4, jint jarg5, jint jarg6, jint jarg7, jstring jarg8, jlong jarg9, jlong jarg10) { + jint jresult = 0 ; + BoosterHandle arg1 = (BoosterHandle) 0 ; + int64_t arg2 ; + ArrowArray *arg3 = (ArrowArray *) 0 ; + ArrowSchema *arg4 = (ArrowSchema *) 0 ; + int arg5 ; + int arg6 ; + int arg7 ; + char *arg8 = (char *) 0 ; + int64_t *arg9 = (int64_t *) 0 ; + double *arg10 = (double *) 0 ; + int result; + + (void)jenv; + (void)jcls; + arg1 = *(BoosterHandle *)&jarg1; + arg2 = (int64_t)jarg2; + arg3 = *(ArrowArray **)&jarg3; + arg4 = *(ArrowSchema **)&jarg4; + arg5 = (int)jarg5; + arg6 = (int)jarg6; + arg7 = (int)jarg7; + arg8 = 0; + if (jarg8) { + arg8 = (char *)jenv->GetStringUTFChars(jarg8, 0); + if (!arg8) return 0; + } + arg9 = *(int64_t **)&jarg9; + arg10 = *(double **)&jarg10; + result = (int)LGBM_BoosterPredictForArrow(arg1,arg2,(ArrowArray const *)arg3,(ArrowSchema const *)arg4,arg5,arg6,arg7,(char const *)arg8,arg9,arg10); + jresult = (jint)result; + if (arg8) jenv->ReleaseStringUTFChars(jarg8, (const char *)arg8); + return jresult; +} + + SWIGEXPORT jint JNICALL Java_com_microsoft_ml_lightgbm_lightgbmlibJNI_LGBM_1BoosterSaveModel(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2, jint jarg3, jint jarg4, jstring jarg5) { jint jresult = 0 ; BoosterHandle arg1 = (BoosterHandle) 0 ; @@ -3445,6 +3512,34 @@ SWIGEXPORT jint JNICALL Java_com_microsoft_ml_lightgbm_lightgbmlibJNI_LGBM_1Netw } +SWIGEXPORT jint JNICALL Java_com_microsoft_ml_lightgbm_lightgbmlibJNI_LGBM_1SetMaxThreads(JNIEnv *jenv, jclass jcls, jint jarg1) { + jint jresult = 0 ; + int arg1 ; + int result; + + (void)jenv; + (void)jcls; + arg1 = (int)jarg1; + result = (int)LGBM_SetMaxThreads(arg1); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_com_microsoft_ml_lightgbm_lightgbmlibJNI_LGBM_1GetMaxThreads(JNIEnv *jenv, jclass jcls, jlong jarg1) { + jint jresult = 0 ; + int *arg1 = (int *) 0 ; + int result; + + (void)jenv; + (void)jcls; + arg1 = *(int **)&jarg1; + result = (int)LGBM_GetMaxThreads(arg1); + jresult = (jint)result; + return jresult; +} + + SWIGEXPORT jstring JNICALL Java_com_microsoft_ml_lightgbm_lightgbmlibJNI_LastErrorMsg(JNIEnv *jenv, jclass jcls) { jstring jresult = 0 ; char *result = 0 ; diff --git a/src/main/java/com/microsoft/ml/lightgbm/lightgbmlibJNI.java b/src/main/java/com/microsoft/ml/lightgbm/lightgbmlibJNI.java index 87e5fe5..b124092 100644 --- a/src/main/java/com/microsoft/ml/lightgbm/lightgbmlibJNI.java +++ b/src/main/java/com/microsoft/ml/lightgbm/lightgbmlibJNI.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 + * Version 4.2.1 * * Do not make changes to this file unless you know what you are doing - modify * the SWIG interface file instead. @@ -100,6 +100,7 @@ public class lightgbmlibJNI { public final static native int LGBM_BoosterPredictForMatSingleRowFastInit(long jarg1, int jarg2, int jarg3, int jarg4, int jarg5, int jarg6, String jarg7, long jarg8); public final static native int LGBM_BoosterPredictForMatSingleRowFast(long jarg1, long jarg2, long jarg3, long jarg4); public final static native int LGBM_BoosterPredictForMats(long jarg1, long jarg2, int jarg3, int jarg4, int jarg5, int jarg6, int jarg7, int jarg8, String jarg9, long jarg10, long jarg11); + public final static native int LGBM_BoosterPredictForArrow(long jarg1, long jarg2, long jarg3, long jarg4, int jarg5, int jarg6, int jarg7, String jarg8, long jarg9, long jarg10); public final static native int LGBM_BoosterSaveModel(long jarg1, int jarg2, int jarg3, int jarg4, String jarg5); public final static native int LGBM_BoosterDumpModel(long jarg1, int jarg2, int jarg3, int jarg4, long jarg5, long jarg6, String jarg7); public final static native int LGBM_BoosterGetLeafValue(long jarg1, int jarg2, int jarg3, long jarg4); @@ -110,6 +111,8 @@ public class lightgbmlibJNI { public final static native int LGBM_NetworkInit(String jarg1, int jarg2, int jarg3, int jarg4); public final static native int LGBM_NetworkFree(); public final static native int LGBM_NetworkInitWithFunctions(int jarg1, int jarg2, long jarg3, long jarg4); + public final static native int LGBM_SetMaxThreads(int jarg1); + public final static native int LGBM_GetMaxThreads(long jarg1); public final static native String LastErrorMsg(); public final static native void LGBM_SetLastError(String jarg1); public final static native String LGBM_BoosterSaveModelToStringSWIG(long jarg1, int jarg2, int jarg3, int jarg4, long jarg5, long jarg6); diff --git a/src/main/java/io/github/metarank/lightgbm4j/LGBMBooster.java b/src/main/java/io/github/metarank/lightgbm4j/LGBMBooster.java index 828b31e..ba23d42 100644 --- a/src/main/java/io/github/metarank/lightgbm4j/LGBMBooster.java +++ b/src/main/java/io/github/metarank/lightgbm4j/LGBMBooster.java @@ -171,7 +171,7 @@ private static void extractResource(String path, String name, File dest) throws logger.warn("- MMLSpark/SynapseML is the main suspect"); logger.warn("****************************************************"); logger.warn("\n\n\n"); - throw new IOException("hash mismatch"); + //throw new IOException("hash mismatch"); } ByteArrayInputStream source = new ByteArrayInputStream(libByteStream.toByteArray()); OutputStream fileStream = new FileOutputStream(dest); diff --git a/src/main/resources/lightgbm4j/linux/aarch64/lib_lightgbm.so b/src/main/resources/lightgbm4j/linux/aarch64/lib_lightgbm.so index 8a87f21..6b7e1d5 100755 --- a/src/main/resources/lightgbm4j/linux/aarch64/lib_lightgbm.so +++ b/src/main/resources/lightgbm4j/linux/aarch64/lib_lightgbm.so @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9a061d1ec82488e1c179a536503e36a017a0a34a1fedd89ae8ecd7d00125d61a -size 6109912 +oid sha256:a2d7e96a45df80fdccdbe8eb60241d4f9a1f880863684dfca2bb6f5ba5296963 +size 6205576 diff --git a/src/main/resources/lightgbm4j/linux/aarch64/lib_lightgbm.so.md5 b/src/main/resources/lightgbm4j/linux/aarch64/lib_lightgbm.so.md5 index 67a4ab9..6bde026 100644 --- a/src/main/resources/lightgbm4j/linux/aarch64/lib_lightgbm.so.md5 +++ b/src/main/resources/lightgbm4j/linux/aarch64/lib_lightgbm.so.md5 @@ -1 +1 @@ -f12c526ca1c0574b0785b94657fecf9c \ No newline at end of file +a04556537fddae05bf5d4155c52e1431 \ No newline at end of file diff --git a/src/main/resources/lightgbm4j/linux/aarch64/lib_lightgbm_swig.so b/src/main/resources/lightgbm4j/linux/aarch64/lib_lightgbm_swig.so index 311a0cc..ccad872 100755 --- a/src/main/resources/lightgbm4j/linux/aarch64/lib_lightgbm_swig.so +++ b/src/main/resources/lightgbm4j/linux/aarch64/lib_lightgbm_swig.so @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6ef447f3132d677115cf4d62dfff96a682576ee9d3d42fe1234ad6038f8a253b -size 153248 +oid sha256:8b144665cee83af785eadf4a221f6965c28f2cb199d63911a312a4c0e8fa71c6 +size 158112 diff --git a/src/main/resources/lightgbm4j/linux/aarch64/lib_lightgbm_swig.so.md5 b/src/main/resources/lightgbm4j/linux/aarch64/lib_lightgbm_swig.so.md5 index 0a5c3cf..6c8ad93 100644 --- a/src/main/resources/lightgbm4j/linux/aarch64/lib_lightgbm_swig.so.md5 +++ b/src/main/resources/lightgbm4j/linux/aarch64/lib_lightgbm_swig.so.md5 @@ -1 +1 @@ -1b4919b8a07eb3376e10f40016603ae0 \ No newline at end of file +2789a99f4b07d7d508c7cf75a8240c06 \ No newline at end of file diff --git a/src/main/resources/lightgbm4j/linux/x86_64/lib_lightgbm.so b/src/main/resources/lightgbm4j/linux/x86_64/lib_lightgbm.so old mode 100644 new mode 100755 index 7b9bfd2..f38985b --- a/src/main/resources/lightgbm4j/linux/x86_64/lib_lightgbm.so +++ b/src/main/resources/lightgbm4j/linux/x86_64/lib_lightgbm.so @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:abf9c9e095d772a2b43d550dfad0c10a7fc72e8e61b8334ca13945ecc1185d09 -size 7245432 +oid sha256:8049f84b91dadd57193e2c3095005519b635c36c4f3b61ff24b5156f0b57770d +size 7245016 diff --git a/src/main/resources/lightgbm4j/linux/x86_64/lib_lightgbm.so.md5 b/src/main/resources/lightgbm4j/linux/x86_64/lib_lightgbm.so.md5 index 4c1059b..36a085c 100644 --- a/src/main/resources/lightgbm4j/linux/x86_64/lib_lightgbm.so.md5 +++ b/src/main/resources/lightgbm4j/linux/x86_64/lib_lightgbm.so.md5 @@ -1 +1 @@ -78128d97eb07165cebedaf59223645cb \ No newline at end of file +885fe5da88b7a1779f63a54b23892399 \ No newline at end of file diff --git a/src/main/resources/lightgbm4j/linux/x86_64/lib_lightgbm_swig.so b/src/main/resources/lightgbm4j/linux/x86_64/lib_lightgbm_swig.so old mode 100644 new mode 100755 index d668e16..8c148a2 --- a/src/main/resources/lightgbm4j/linux/x86_64/lib_lightgbm_swig.so +++ b/src/main/resources/lightgbm4j/linux/x86_64/lib_lightgbm_swig.so @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3fe663bcc6af9d570a01ce28ed8e71aa2abd489771b6ccb4f4fdb437dc8b3e29 -size 158912 +oid sha256:d49ab35cbad2ebab1623a526d7dfd871bc259b265a760741fef75478abe16c07 +size 168072 diff --git a/src/main/resources/lightgbm4j/linux/x86_64/lib_lightgbm_swig.so.md5 b/src/main/resources/lightgbm4j/linux/x86_64/lib_lightgbm_swig.so.md5 index c5c5996..4f50bee 100644 --- a/src/main/resources/lightgbm4j/linux/x86_64/lib_lightgbm_swig.so.md5 +++ b/src/main/resources/lightgbm4j/linux/x86_64/lib_lightgbm_swig.so.md5 @@ -1 +1 @@ -9222a7c173b3cfb5a193a3b8c6ea2c41 \ No newline at end of file +08a0b65fd661d3a0554c69fe25db0816 \ No newline at end of file diff --git a/src/main/resources/lightgbm4j/osx/aarch64/lib_lightgbm.dylib b/src/main/resources/lightgbm4j/osx/aarch64/lib_lightgbm.dylib index 2a6c8bc..5b1014a 100755 --- a/src/main/resources/lightgbm4j/osx/aarch64/lib_lightgbm.dylib +++ b/src/main/resources/lightgbm4j/osx/aarch64/lib_lightgbm.dylib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:671d080c3727e5f92e5e269cc5015d1772568575104b43c6b82c3a0720429d1b -size 6256623 +oid sha256:65914f3b8866b7c2f1ef90790e85f8e2cd5d3976e4210654e656abd75d58a0b1 +size 5246304 diff --git a/src/main/resources/lightgbm4j/osx/aarch64/lib_lightgbm.dylib.md5 b/src/main/resources/lightgbm4j/osx/aarch64/lib_lightgbm.dylib.md5 index 62c2568..87028a5 100644 --- a/src/main/resources/lightgbm4j/osx/aarch64/lib_lightgbm.dylib.md5 +++ b/src/main/resources/lightgbm4j/osx/aarch64/lib_lightgbm.dylib.md5 @@ -1 +1 @@ -21c60afcd87acf1095e3e1e1074a1fab \ No newline at end of file +48c1d6a244a4cdfa9481910193910a2c \ No newline at end of file diff --git a/src/main/resources/lightgbm4j/osx/aarch64/lib_lightgbm_swig.dylib b/src/main/resources/lightgbm4j/osx/aarch64/lib_lightgbm_swig.dylib index 9c56dfb..d7d80d1 100755 --- a/src/main/resources/lightgbm4j/osx/aarch64/lib_lightgbm_swig.dylib +++ b/src/main/resources/lightgbm4j/osx/aarch64/lib_lightgbm_swig.dylib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b1c04d03f1c19ce6810f5ab303f3c2b955fff52363a4d8304a5737757c2ac38a -size 164853 +oid sha256:059a78f27acb8c765fb3e17276cf8382b0f7b07ed05d6023c33bd01430af8d22 +size 132408 diff --git a/src/main/resources/lightgbm4j/osx/aarch64/lib_lightgbm_swig.dylib.md5 b/src/main/resources/lightgbm4j/osx/aarch64/lib_lightgbm_swig.dylib.md5 index 8232f24..1076693 100644 --- a/src/main/resources/lightgbm4j/osx/aarch64/lib_lightgbm_swig.dylib.md5 +++ b/src/main/resources/lightgbm4j/osx/aarch64/lib_lightgbm_swig.dylib.md5 @@ -1 +1 @@ -de2e5cca4560b291130bb48c525445c4 \ No newline at end of file +6dcb7e8e73cb984b23e71756346a1178 \ No newline at end of file diff --git a/src/main/resources/lightgbm4j/osx/x86_64/lib_lightgbm.dylib b/src/main/resources/lightgbm4j/osx/x86_64/lib_lightgbm.dylib index c8301a3..b14927f 100644 --- a/src/main/resources/lightgbm4j/osx/x86_64/lib_lightgbm.dylib +++ b/src/main/resources/lightgbm4j/osx/x86_64/lib_lightgbm.dylib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f7b5e140e2d409a2e0e7ed285be2d0de0ea239b7c0c5a61bb776608d8ba18d79 -size 5814868 +oid sha256:669f15abc703d0db81d71f8d54a857e764c232d83034c07c8bcdbbbc1177aee5 +size 5954592 diff --git a/src/main/resources/lightgbm4j/osx/x86_64/lib_lightgbm.dylib.md5 b/src/main/resources/lightgbm4j/osx/x86_64/lib_lightgbm.dylib.md5 index 10b7633..4011baa 100644 --- a/src/main/resources/lightgbm4j/osx/x86_64/lib_lightgbm.dylib.md5 +++ b/src/main/resources/lightgbm4j/osx/x86_64/lib_lightgbm.dylib.md5 @@ -1 +1 @@ -5b252f932767c78a69a830cc1c4f4d5b \ No newline at end of file +3647a841027750be0bed71839940b264 \ No newline at end of file diff --git a/src/main/resources/lightgbm4j/osx/x86_64/lib_lightgbm_swig.dylib b/src/main/resources/lightgbm4j/osx/x86_64/lib_lightgbm_swig.dylib index 743fbce..b1ea8d3 100644 --- a/src/main/resources/lightgbm4j/osx/x86_64/lib_lightgbm_swig.dylib +++ b/src/main/resources/lightgbm4j/osx/x86_64/lib_lightgbm_swig.dylib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:af63b481449d76508c3f5d600ef53efa17ac5c67be4daaaa6da02a582dea065c -size 97704 +oid sha256:313bbb2266b8e2993991e9d340ad500a7e2e556e8aaef24b754ba548d6a51413 +size 98656 diff --git a/src/main/resources/lightgbm4j/osx/x86_64/lib_lightgbm_swig.dylib.md5 b/src/main/resources/lightgbm4j/osx/x86_64/lib_lightgbm_swig.dylib.md5 index d4eda16..70886f3 100644 --- a/src/main/resources/lightgbm4j/osx/x86_64/lib_lightgbm_swig.dylib.md5 +++ b/src/main/resources/lightgbm4j/osx/x86_64/lib_lightgbm_swig.dylib.md5 @@ -1 +1 @@ -9f1768f29d64dff5517ecbd54638fc89 \ No newline at end of file +d49bc047b25eab94de5e0bd3301da39d \ No newline at end of file diff --git a/src/main/resources/lightgbm4j/windows/x86_64/lib_lightgbm.dll b/src/main/resources/lightgbm4j/windows/x86_64/lib_lightgbm.dll index d7bd8f9..0029ce8 100644 --- a/src/main/resources/lightgbm4j/windows/x86_64/lib_lightgbm.dll +++ b/src/main/resources/lightgbm4j/windows/x86_64/lib_lightgbm.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9b184b2f41ae0c4f310a585be6384e8580b68ce0324b4f0bb94f9e1ff01155fb -size 3221504 +oid sha256:a3aa14a3c338f5dbe14487ecf99a0c41867cb49e6bc05cc94182e0bb3778f0d2 +size 3267072 diff --git a/src/main/resources/lightgbm4j/windows/x86_64/lib_lightgbm.dll.md5 b/src/main/resources/lightgbm4j/windows/x86_64/lib_lightgbm.dll.md5 index 57def35..b8fab36 100644 --- a/src/main/resources/lightgbm4j/windows/x86_64/lib_lightgbm.dll.md5 +++ b/src/main/resources/lightgbm4j/windows/x86_64/lib_lightgbm.dll.md5 @@ -1 +1 @@ -7200b571cb7882e40702dfce3031a355 \ No newline at end of file +b6c92ce6eb35e6a4665828040b889c18 \ No newline at end of file diff --git a/src/main/resources/lightgbm4j/windows/x86_64/lib_lightgbm_swig.dll b/src/main/resources/lightgbm4j/windows/x86_64/lib_lightgbm_swig.dll index 5fa610f..7df8023 100644 --- a/src/main/resources/lightgbm4j/windows/x86_64/lib_lightgbm_swig.dll +++ b/src/main/resources/lightgbm4j/windows/x86_64/lib_lightgbm_swig.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:33926e5360755e7970c2e08ff3f354f5327ebaa5b39b6e409c40d9d5ed5051c3 -size 69120 +oid sha256:25d208fdc27c7d6e0f611e21a5a45820da63703fce87b6c93c63297bba07f0c7 +size 70144 diff --git a/src/main/resources/lightgbm4j/windows/x86_64/lib_lightgbm_swig.dll.md5 b/src/main/resources/lightgbm4j/windows/x86_64/lib_lightgbm_swig.dll.md5 index bb98efb..f2af3e0 100644 --- a/src/main/resources/lightgbm4j/windows/x86_64/lib_lightgbm_swig.dll.md5 +++ b/src/main/resources/lightgbm4j/windows/x86_64/lib_lightgbm_swig.dll.md5 @@ -1 +1 @@ -410f79f11de82de0e16467bc32b69793 \ No newline at end of file +9e8ffac009844757e1eab51760e64666 \ No newline at end of file diff --git a/swig-build/build_linux_amd64.sh b/swig-build/build_linux_amd64.sh index b75f120..038b5dc 100755 --- a/swig-build/build_linux_amd64.sh +++ b/swig-build/build_linux_amd64.sh @@ -1,3 +1,2 @@ #!/bin/bash -docker run --rm --privileged multiarch/qemu-user-static --reset -p yes docker buildx build --platform amd64 -t lgbm:latest -f "Dockerfile.amd64" . \ No newline at end of file diff --git a/swig-build/build_linux_arm64.sh b/swig-build/build_linux_arm64.sh index 2b9254b..b74c804 100755 --- a/swig-build/build_linux_arm64.sh +++ b/swig-build/build_linux_arm64.sh @@ -1,3 +1,3 @@ #!/bin/bash - +docker run --rm --privileged multiarch/qemu-user-static --reset -p yes docker buildx build --platform arm64 -t lgbm:latest -f "Dockerfile.arm64" . \ No newline at end of file diff --git a/swig-build/build_macos.sh b/swig-build/build_macos.sh index 078530e..7ad82cb 100644 --- a/swig-build/build_macos.sh +++ b/swig-build/build_macos.sh @@ -13,10 +13,11 @@ echo 'export PATH="/opt/homebrew/opt/openjdk@11/bin:$PATH"' >> ~/.zshrc export LDFLAGS="-L/opt/homebrew/opt/libomp/lib" export CPPFLAGS="-I/opt/homebrew/opt/openjdk@11/include -I/opt/homebrew/opt/libomp/include" -export JAVA_HOME=/opt/homebrew/Cellar/openjdk@11/11.0.21/libexec/openjdk.jdk/Contents/Home -export CC=gcc-13 CXX=g++-13 +export JAVA_HOME=/opt/homebrew/Cellar/openjdk@11/11.0.23/libexec/openjdk.jdk/Contents/Home +export CC=gcc CXX=g++ # checkout git clone --recursive https://github.com/microsoft/LightGBM +cd LightGBM && git checkout v4.3.0 && mkdir build && cd build cmake -DUSE_SWIG=ON -DAPPLE_OUTPUT_DYLIB=ON .. \ No newline at end of file