From 4ac9a00d9e16b0879b4e734a4b604c7ce672894e Mon Sep 17 00:00:00 2001 From: Gyeongjae Choi Date: Mon, 9 May 2022 06:42:07 +0000 Subject: [PATCH 1/2] Add missing template type --- src/common/host_device_vector.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/host_device_vector.cc b/src/common/host_device_vector.cc index 3a4a59db7881..fc33317bd7a8 100644 --- a/src/common/host_device_vector.cc +++ b/src/common/host_device_vector.cc @@ -180,13 +180,16 @@ template class HostDeviceVector; // bst_row_t template class HostDeviceVector; // bst_feature_t template class HostDeviceVector; -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__EMSCRIPTEN__) /* * On OSX: * * typedef unsigned int uint32_t; * typedef unsigned long long uint64_t; * typedef unsigned long __darwin_size_t; + * + * On Emscripten: + * typedef unsigned long size_t; */ template class HostDeviceVector; #endif // defined(__APPLE__) From 78723d95bbbd4e04083e5c972b5419a4bf019775 Mon Sep 17 00:00:00 2001 From: Gyeongjae Choi Date: Mon, 9 May 2022 12:07:44 +0000 Subject: [PATCH 2/2] Add library loading path --- python-package/xgboost/libpath.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python-package/xgboost/libpath.py b/python-package/xgboost/libpath.py index f7a7d9cd36c4..747e5188e0b3 100644 --- a/python-package/xgboost/libpath.py +++ b/python-package/xgboost/libpath.py @@ -43,8 +43,7 @@ def find_lib_path() -> List[str]: # directory here dll_path.append(os.path.join(curr_path, './windows/Release/')) dll_path = [os.path.join(p, 'xgboost.dll') for p in dll_path] - elif sys.platform.startswith('linux') or sys.platform.startswith( - 'freebsd'): + elif sys.platform.startswith(('linux', 'freebsd', 'emscripten')): dll_path = [os.path.join(p, 'libxgboost.so') for p in dll_path] elif sys.platform == 'darwin': dll_path = [os.path.join(p, 'libxgboost.dylib') for p in dll_path]