diff --git a/CMakeLists.txt b/CMakeLists.txt index e2c906869..72d612d18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,10 @@ cmake_minimum_required(VERSION 3.13) -project(xgboost LANGUAGES CXX C VERSION 1.2.0) +project(xgboost LANGUAGES CXX C VERSION 1.2.1) include(cmake/Utils.cmake) list(APPEND CMAKE_MODULE_PATH "${xgboost_SOURCE_DIR}/cmake/modules") cmake_policy(SET CMP0022 NEW) cmake_policy(SET CMP0079 NEW) +set(CMAKE_POLICY_DEFAULT_CMP0063 NEW) cmake_policy(SET CMP0063 NEW) if ((${CMAKE_VERSION} VERSION_GREATER 3.13) OR (${CMAKE_VERSION} VERSION_EQUAL 3.13)) @@ -173,9 +174,6 @@ foreach(lib rabit rabit_base rabit_empty rabit_mock rabit_mock_static) # from dmlc is correctly applied to rabit. if (TARGET ${lib}) target_link_libraries(${lib} dmlc ${CMAKE_THREAD_LIBS_INIT}) - if (HIDE_CXX_SYMBOLS) # Hide all C++ symbols from Rabit - set_target_properties(${lib} PROPERTIES CXX_VISIBILITY_PRESET hidden) - endif (HIDE_CXX_SYMBOLS) if (ENABLE_ALL_WARNINGS) target_compile_options(${lib} PRIVATE -Wall -Wextra) endif (ENABLE_ALL_WARNINGS) @@ -204,8 +202,9 @@ endif (USE_NVTX) #-- Hide all C++ symbols if (HIDE_CXX_SYMBOLS) - set_target_properties(objxgboost PROPERTIES CXX_VISIBILITY_PRESET hidden) - set_target_properties(xgboost PROPERTIES CXX_VISIBILITY_PRESET hidden) + foreach(target objxgboost xgboost dmlc rabit rabit_mock_static) + set_target_properties(${target} PROPERTIES CXX_VISIBILITY_PRESET hidden) + endforeach() endif (HIDE_CXX_SYMBOLS) target_include_directories(xgboost diff --git a/Jenkinsfile b/Jenkinsfile index 245b1309b..8b1e4452a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -144,7 +144,7 @@ def ClangTidy() { echo "Running clang-tidy job..." def container_type = "clang_tidy" def docker_binary = "docker" - def dockerArgs = "--build-arg CUDA_VERSION=10.1" + def dockerArgs = "--build-arg CUDA_VERSION_ARG=10.1" sh """ ${dockerRun} ${container_type} ${docker_binary} ${dockerArgs} python3 tests/ci_build/tidy.py """ @@ -261,7 +261,7 @@ def BuildCUDA(args) { echo "Build with CUDA ${args.cuda_version}" def container_type = GetCUDABuildContainerType(args.cuda_version) def docker_binary = "docker" - def docker_args = "--build-arg CUDA_VERSION=${args.cuda_version}" + def docker_args = "--build-arg CUDA_VERSION_ARG=${args.cuda_version}" def arch_flag = "" if (env.BRANCH_NAME != 'master' && !(env.BRANCH_NAME.startsWith('release'))) { arch_flag = "-DGPU_COMPUTE_VER=75" @@ -290,7 +290,7 @@ def BuildJVMPackagesWithCUDA(args) { echo "Build XGBoost4J-Spark with Spark ${args.spark_version}, CUDA ${args.cuda_version}" def container_type = "jvm_gpu_build" def docker_binary = "nvidia-docker" - def docker_args = "--build-arg CUDA_VERSION=${args.cuda_version}" + def docker_args = "--build-arg CUDA_VERSION_ARG=${args.cuda_version}" def arch_flag = "" if (env.BRANCH_NAME != 'master' && !(env.BRANCH_NAME.startsWith('release'))) { arch_flag = "-DGPU_COMPUTE_VER=75" @@ -365,7 +365,7 @@ def TestPythonGPU(args) { echo "Test Python GPU: CUDA ${args.host_cuda_version}" def container_type = "gpu" def docker_binary = "nvidia-docker" - def docker_args = "--build-arg CUDA_VERSION=${args.host_cuda_version}" + def docker_args = "--build-arg CUDA_VERSION_ARG=${args.host_cuda_version}" if (args.multi_gpu) { echo "Using multiple GPUs" // Allocate extra space in /dev/shm to enable NCCL @@ -406,7 +406,7 @@ def TestCppGPU(args) { echo "Test C++, CUDA ${args.host_cuda_version}" def container_type = "gpu" def docker_binary = "nvidia-docker" - def docker_args = "--build-arg CUDA_VERSION=${args.host_cuda_version}" + def docker_args = "--build-arg CUDA_VERSION_ARG=${args.host_cuda_version}" sh "${dockerRun} ${container_type} ${docker_binary} ${docker_args} build/testxgboost" deleteDir() } @@ -424,7 +424,7 @@ def CrossTestJVMwithJDKGPU(args) { } def container_type = "gpu_jvm" def docker_binary = "nvidia-docker" - def docker_args = "--build-arg CUDA_VERSION=${args.host_cuda_version}" + def docker_args = "--build-arg CUDA_VERSION_ARG=${args.host_cuda_version}" sh "${dockerRun} ${container_type} ${docker_binary} ${docker_args} tests/ci_build/test_jvm_gpu_cross.sh" deleteDir() } @@ -476,7 +476,7 @@ def DeployJVMPackages(args) { ${dockerRun} jvm docker tests/ci_build/deploy_jvm_packages.sh ${args.spark_version} 0 """ sh """ - ${dockerRun} jvm_gpu_build docker --build-arg CUDA_VERSION=10.0 tests/ci_build/deploy_jvm_packages.sh ${args.spark_version} 1 + ${dockerRun} jvm_gpu_build docker --build-arg CUDA_VERSION_ARG=10.0 tests/ci_build/deploy_jvm_packages.sh ${args.spark_version} 1 """ } deleteDir() diff --git a/python-package/xgboost/VERSION b/python-package/xgboost/VERSION index 26aaba0e8..6085e9465 100644 --- a/python-package/xgboost/VERSION +++ b/python-package/xgboost/VERSION @@ -1 +1 @@ -1.2.0 +1.2.1 diff --git a/python-package/xgboost/core.py b/python-package/xgboost/core.py index 4bc77783e..76e78a809 100644 --- a/python-package/xgboost/core.py +++ b/python-package/xgboost/core.py @@ -40,7 +40,7 @@ class EarlyStopException(Exception): """ def __init__(self, best_iteration): - super(EarlyStopException, self).__init__() + super().__init__() self.best_iteration = best_iteration diff --git a/python-package/xgboost/sklearn.py b/python-package/xgboost/sklearn.py index d1c3c6d53..1312d57b4 100644 --- a/python-package/xgboost/sklearn.py +++ b/python-package/xgboost/sklearn.py @@ -1017,7 +1017,7 @@ class XGBRFClassifier(XGBClassifier): **kwargs) def get_xgb_params(self): - params = super(XGBRFClassifier, self).get_xgb_params() + params = super().get_xgb_params() params['num_parallel_tree'] = self.n_estimators return params @@ -1049,7 +1049,7 @@ class XGBRFRegressor(XGBRegressor): reg_lambda=reg_lambda, **kwargs) def get_xgb_params(self): - params = super(XGBRFRegressor, self).get_xgb_params() + params = super().get_xgb_params() params['num_parallel_tree'] = self.n_estimators return params diff --git a/tests/ci_build/Dockerfile.clang_tidy b/tests/ci_build/Dockerfile.clang_tidy index 2316feda1..661e9b925 100644 --- a/tests/ci_build/Dockerfile.clang_tidy +++ b/tests/ci_build/Dockerfile.clang_tidy @@ -1,5 +1,6 @@ -ARG CUDA_VERSION -FROM nvidia/cuda:$CUDA_VERSION-devel-ubuntu18.04 +ARG CUDA_VERSION_ARG +FROM nvidia/cuda:$CUDA_VERSION_ARG-devel-ubuntu18.04 +ARG CUDA_VERSION_ARG # Environment ENV DEBIAN_FRONTEND noninteractive diff --git a/tests/ci_build/Dockerfile.gpu b/tests/ci_build/Dockerfile.gpu index ca754503e..211f150dc 100644 --- a/tests/ci_build/Dockerfile.gpu +++ b/tests/ci_build/Dockerfile.gpu @@ -1,5 +1,6 @@ -ARG CUDA_VERSION -FROM nvidia/cuda:$CUDA_VERSION-runtime-ubuntu16.04 +ARG CUDA_VERSION_ARG +FROM nvidia/cuda:$CUDA_VERSION_ARG-runtime-ubuntu16.04 +ARG CUDA_VERSION_ARG # Environment ENV DEBIAN_FRONTEND noninteractive @@ -18,7 +19,7 @@ ENV PATH=/opt/python/bin:$PATH # Create new Conda environment with cuDF, Dask, and cuPy RUN \ conda create -n gpu_test -c rapidsai-nightly -c rapidsai -c nvidia -c conda-forge -c defaults \ - python=3.7 cudf=0.15* cudatoolkit=$CUDA_VERSION dask dask-cuda dask-cudf cupy \ + python=3.7 cudf=0.15* cudatoolkit=$CUDA_VERSION_ARG dask dask-cuda dask-cudf cupy \ numpy pytest scipy scikit-learn pandas matplotlib wheel python-kubernetes urllib3 graphviz hypothesis ENV GOSU_VERSION 1.10 diff --git a/tests/ci_build/Dockerfile.gpu_build b/tests/ci_build/Dockerfile.gpu_build index 8a741fc87..a52e62eb3 100644 --- a/tests/ci_build/Dockerfile.gpu_build +++ b/tests/ci_build/Dockerfile.gpu_build @@ -1,6 +1,6 @@ -ARG CUDA_VERSION -FROM nvidia/cuda:$CUDA_VERSION-devel-ubuntu16.04 -ARG CUDA_VERSION +ARG CUDA_VERSION_ARG +FROM nvidia/cuda:$CUDA_VERSION_ARG-devel-ubuntu16.04 +ARG CUDA_VERSION_ARG # Environment ENV DEBIAN_FRONTEND noninteractive @@ -19,7 +19,7 @@ RUN \ # NCCL2 (License: https://docs.nvidia.com/deeplearning/sdk/nccl-sla/index.html) RUN \ - export CUDA_SHORT=`echo $CUDA_VERSION | egrep -o '[0-9]+\.[0-9]'` && \ + export CUDA_SHORT=`echo $CUDA_VERSION_ARG | egrep -o '[0-9]+\.[0-9]'` && \ export NCCL_VERSION=2.7.5-1 && \ apt-get update && \ apt-get install -y --allow-downgrades --allow-change-held-packages libnccl2=${NCCL_VERSION}+cuda${CUDA_SHORT} libnccl-dev=${NCCL_VERSION}+cuda${CUDA_SHORT} diff --git a/tests/ci_build/Dockerfile.gpu_build_centos6 b/tests/ci_build/Dockerfile.gpu_build_centos6 index e755ce12a..b2adb8a06 100644 --- a/tests/ci_build/Dockerfile.gpu_build_centos6 +++ b/tests/ci_build/Dockerfile.gpu_build_centos6 @@ -1,6 +1,6 @@ -ARG CUDA_VERSION -FROM nvidia/cuda:$CUDA_VERSION-devel-centos6 -ARG CUDA_VERSION +ARG CUDA_VERSION_ARG +FROM nvidia/cuda:$CUDA_VERSION_ARG-devel-centos6 +ARG CUDA_VERSION_ARG # Environment ENV DEBIAN_FRONTEND noninteractive @@ -33,7 +33,7 @@ RUN \ # NCCL2 (License: https://docs.nvidia.com/deeplearning/sdk/nccl-sla/index.html) RUN \ - export CUDA_SHORT=`echo $CUDA_VERSION | egrep -o '[0-9]+\.[0-9]'` && \ + export CUDA_SHORT=`echo $CUDA_VERSION_ARG | egrep -o '[0-9]+\.[0-9]'` && \ export NCCL_VERSION=2.4.8-1 && \ wget https://developer.download.nvidia.com/compute/machine-learning/repos/rhel7/x86_64/nvidia-machine-learning-repo-rhel7-1.0.0-1.x86_64.rpm && \ rpm -i nvidia-machine-learning-repo-rhel7-1.0.0-1.x86_64.rpm && \ diff --git a/tests/ci_build/Dockerfile.gpu_jvm b/tests/ci_build/Dockerfile.gpu_jvm index acd7b9b86..f11e739b1 100644 --- a/tests/ci_build/Dockerfile.gpu_jvm +++ b/tests/ci_build/Dockerfile.gpu_jvm @@ -1,5 +1,6 @@ -ARG CUDA_VERSION -FROM nvidia/cuda:$CUDA_VERSION-runtime-ubuntu16.04 +ARG CUDA_VERSION_ARG +FROM nvidia/cuda:$CUDA_VERSION_ARG-runtime-ubuntu16.04 +ARG CUDA_VERSION_ARG ARG JDK_VERSION=8 ARG SPARK_VERSION=3.0.0 diff --git a/tests/ci_build/Dockerfile.jvm_gpu_build b/tests/ci_build/Dockerfile.jvm_gpu_build index ed6c3d689..b0b46e6e9 100644 --- a/tests/ci_build/Dockerfile.jvm_gpu_build +++ b/tests/ci_build/Dockerfile.jvm_gpu_build @@ -1,6 +1,6 @@ -ARG CUDA_VERSION -FROM nvidia/cuda:$CUDA_VERSION-devel-centos6 -ARG CUDA_VERSION +ARG CUDA_VERSION_ARG +FROM nvidia/cuda:$CUDA_VERSION_ARG-devel-centos6 +ARG CUDA_VERSION_ARG # Environment ENV DEBIAN_FRONTEND noninteractive @@ -30,7 +30,7 @@ RUN \ # NCCL2 (License: https://docs.nvidia.com/deeplearning/sdk/nccl-sla/index.html) RUN \ - export CUDA_SHORT=`echo $CUDA_VERSION | egrep -o '[0-9]+\.[0-9]'` && \ + export CUDA_SHORT=`echo $CUDA_VERSION_ARG | egrep -o '[0-9]+\.[0-9]'` && \ export NCCL_VERSION=2.4.8-1 && \ wget https://developer.download.nvidia.com/compute/machine-learning/repos/rhel7/x86_64/nvidia-machine-learning-repo-rhel7-1.0.0-1.x86_64.rpm && \ rpm -i nvidia-machine-learning-repo-rhel7-1.0.0-1.x86_64.rpm && \