From 6426449c8be17856984caeb9892831e3e1e27037 Mon Sep 17 00:00:00 2001 From: Gavin Zhang Date: Thu, 2 Jun 2022 23:38:35 +0800 Subject: [PATCH] Support IBM i OS (#7920) --- CMakeLists.txt | 5 +++++ python-package/setup.py | 2 ++ python-package/xgboost/libpath.py | 2 ++ 3 files changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 65a698eca..549836af9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -159,6 +159,11 @@ if (USE_OPENMP) endif (APPLE) find_package(OpenMP REQUIRED) endif (USE_OPENMP) +#Add for IBM i +if (${CMAKE_SYSTEM_NAME} MATCHES "OS400") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") + set(CMAKE_CXX_ARCHIVE_CREATE " -X64 qc ") +endif() if (USE_NCCL) find_package(Nccl REQUIRED) diff --git a/python-package/setup.py b/python-package/setup.py index b4f05e027..93f36de7b 100644 --- a/python-package/setup.py +++ b/python-package/setup.py @@ -44,6 +44,8 @@ def lib_name() -> str: name = 'libxgboost.dylib' elif system() == 'Windows': name = 'xgboost.dll' + elif system() == 'OS400': + name = 'libxgboost.so' return name diff --git a/python-package/xgboost/libpath.py b/python-package/xgboost/libpath.py index 747e5188e..1ae77556e 100644 --- a/python-package/xgboost/libpath.py +++ b/python-package/xgboost/libpath.py @@ -49,6 +49,8 @@ def find_lib_path() -> List[str]: dll_path = [os.path.join(p, 'libxgboost.dylib') for p in dll_path] elif sys.platform == 'cygwin': dll_path = [os.path.join(p, 'cygxgboost.dll') for p in dll_path] + if platform.system() == 'OS400': + dll_path = [os.path.join(p, 'libxgboost.so') for p in dll_path] lib_path = [p for p in dll_path if os.path.exists(p) and os.path.isfile(p)]