[jvm-packages] XGBoost4j Windows fixes (#1639)

* Changes for Mingw64 compilation to ensure long is a consistent size.

Mainly impacts the Java API which would not compile, but there may be
silent errors on Windows with large datasets before this patch (as long
is 32-bits when compiled with mingw64 even in 64-bit mode).

* Adding ifdefs to ensure it still compiles on MacOS

* Makefile and create_jni.bat changes for Windows.

* Switching XGDMatrixCreateFromCSREx JNI call to use size_t cast

* Fixing lint error, adding profile switching to jvm-packages build to make create-jni.bat get called, adding myself to Contributors.Md
This commit is contained in:
Adam Pocock
2016-10-18 08:35:25 -04:00
committed by Nan Zhu
parent be90deb9b6
commit 445029bb82
7 changed files with 120 additions and 53 deletions

View File

@@ -47,7 +47,7 @@ namespace xgboost {
*/
typedef uint32_t bst_uint;
/*! \brief long integers */
typedef unsigned long bst_ulong; // NOLINT(*)
typedef uint64_t bst_ulong; // NOLINT(*)
/*! \brief float type, used for storing statistics */
typedef float bst_float;

View File

@@ -24,7 +24,7 @@ XGB_EXTERN_C {
#endif
// manually define unsign long
typedef unsigned long bst_ulong; // NOLINT(*)
typedef uint64_t bst_ulong; // NOLINT(*)
/*! \brief handle to DMatrix */
typedef void *DMatrixHandle;
@@ -40,7 +40,13 @@ typedef struct {
/*! \brief number of rows in the minibatch */
size_t size;
/*! \brief row pointer to the rows in the data */
long* offset; // NOLINT(*)
#ifdef __APPLE__
/* Necessary as Java on MacOS defines jlong as long int
* and gcc defines int64_t as long long int. */
long* offset; // NOLINT(*)
#else
int64_t* offset; // NOLINT(*)
#endif
/*! \brief labels of each instance */
float* label;
/*! \brief weight of each instance, can be NULL */