Support IBM i OS (#7920)

This commit is contained in:
Gavin Zhang 2022-06-02 23:38:35 +08:00 committed by GitHub
parent 31e6902e43
commit 6426449c8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View File

@ -159,6 +159,11 @@ if (USE_OPENMP)
endif (APPLE) endif (APPLE)
find_package(OpenMP REQUIRED) find_package(OpenMP REQUIRED)
endif (USE_OPENMP) 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 "<CMAKE_AR> -X64 qc <TARGET> <OBJECTS>")
endif()
if (USE_NCCL) if (USE_NCCL)
find_package(Nccl REQUIRED) find_package(Nccl REQUIRED)

View File

@ -44,6 +44,8 @@ def lib_name() -> str:
name = 'libxgboost.dylib' name = 'libxgboost.dylib'
elif system() == 'Windows': elif system() == 'Windows':
name = 'xgboost.dll' name = 'xgboost.dll'
elif system() == 'OS400':
name = 'libxgboost.so'
return name return name

View File

@ -49,6 +49,8 @@ def find_lib_path() -> List[str]:
dll_path = [os.path.join(p, 'libxgboost.dylib') for p in dll_path] dll_path = [os.path.join(p, 'libxgboost.dylib') for p in dll_path]
elif sys.platform == 'cygwin': elif sys.platform == 'cygwin':
dll_path = [os.path.join(p, 'cygxgboost.dll') for p in dll_path] 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)] lib_path = [p for p in dll_path if os.path.exists(p) and os.path.isfile(p)]