enable msvc win32 project

This commit is contained in:
Tianqi Chen
2015-04-25 21:14:07 -07:00
parent 5e63b5d469
commit 6c83a94204
6 changed files with 18 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
import os
import platform
from setuptools import setup
@@ -11,7 +11,10 @@ curr_dir = os.path.dirname(os.path.abspath(__file__))
dll_path = [curr_dir]
if os.name == 'nt':
dll_path.append(os.path.join(curr_dir, '../windows/x64/Release/'))
if platform.architecture()[0] == '64bit':
dll_path.append(os.path.join(curr_dir, '../windows/Release/'))
else:
dll_path.append(os.path.join(curr_dir, '../windows/x64/Release/'))
if os.name == 'nt':
dll_path = [os.path.join(p, 'xgboost_wrapper.dll') for p in dll_path]

View File

@@ -13,6 +13,7 @@ import os
import sys
import re
import ctypes
import platform
import collections
import numpy as np
@@ -40,7 +41,11 @@ else:
def load_xglib():
curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
dll_path = [curr_path]
dll_path.append(os.path.join(curr_path, '../windows/x64/Release/'))
if os.name == 'nt':
if platform.architecture()[0] == '64bit':
dll_path.append(os.path.join(curr_dir, '../windows/Release/'))
else:
dll_path.append(os.path.join(curr_dir, '../windows/x64/Release/'))
if os.name == 'nt':
dll_path = [os.path.join(p, 'xgboost_wrapper.dll') for p in dll_path]

View File

@@ -266,7 +266,7 @@ extern "C"{
pmat->info.group_ptr.resize(len + 1);
pmat->info.group_ptr[0] = 0;
for (uint64_t i = 0; i < len; ++i) {
pmat->info.group_ptr[i+1] = pmat->info.group_ptr[i]+group[i];
pmat->info.group_ptr[i+1] = pmat->info.group_ptr[i] + group[i];
}
}
const float* XGDMatrixGetFloatInfo(const void *handle, const char *field, bst_ulong* len) {