Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into jvm-communicator
Browse files Browse the repository at this point in the history
  • Loading branch information
rongou committed Sep 12, 2022
2 parents 799655d + bc81831 commit fdd4d5d
Show file tree
Hide file tree
Showing 36 changed files with 178 additions and 106 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/r_tests.yml
Expand Up @@ -31,8 +31,8 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-4-${{ hashFiles('R-package/DESCRIPTION') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-4-${{ hashFiles('R-package/DESCRIPTION') }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-5-${{ hashFiles('R-package/DESCRIPTION') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-5-${{ hashFiles('R-package/DESCRIPTION') }}

- name: Install dependencies
shell: Rscript {0}
Expand Down Expand Up @@ -80,20 +80,25 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-4-${{ hashFiles('R-package/DESCRIPTION') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-4-${{ hashFiles('R-package/DESCRIPTION') }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-5-${{ hashFiles('R-package/DESCRIPTION') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-5-${{ hashFiles('R-package/DESCRIPTION') }}

- name: Install dependencies
shell: Rscript {0}
if: matrix.config.os != 'windows-latest'
run: |
install.packages(${{ env.R_PACKAGES }},
repos = 'http://cloud.r-project.org',
dependencies = c('Depends', 'Imports', 'LinkingTo'))
- name: Install igraph on Windows
- name: Install binary dependencies
shell: Rscript {0}
if: matrix.config.os == 'windows-latest'
run: |
install.packages('igraph', type='binary', dependencies = c('Depends', 'Imports', 'LinkingTo'))
install.packages(${{ env.R_PACKAGES }},
type = 'binary',
repos = 'http://cloud.r-project.org',
dependencies = c('Depends', 'Imports', 'LinkingTo'))
- uses: actions/setup-python@v2
with:
Expand Down Expand Up @@ -132,8 +137,8 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-4-${{ hashFiles('R-package/DESCRIPTION') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-4-${{ hashFiles('R-package/DESCRIPTION') }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-5-${{ hashFiles('R-package/DESCRIPTION') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-5-${{ hashFiles('R-package/DESCRIPTION') }}

- name: Install dependencies
shell: Rscript {0}
Expand Down
7 changes: 5 additions & 2 deletions .gitignore
Expand Up @@ -97,8 +97,11 @@ metastore_db
R-package/src/Makevars
*.lib

# Visual Studio Code
/.vscode/
# Visual Studio
.vs/
CMakeSettings.json
*.ilk
*.pdb

# IntelliJ/CLion
.idea
Expand Down
28 changes: 28 additions & 0 deletions .readthedocs.yaml
@@ -0,0 +1,28 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.8"
apt_packages:
- graphviz

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: doc/conf.py

# If using Sphinx, optionally build your docs in additional formats such as PDF
formats:
- pdf

# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: doc/requirements.txt
system_packages: true
2 changes: 1 addition & 1 deletion R-package/src/Makevars.win
Expand Up @@ -30,7 +30,7 @@ $(foreach v, $(XGB_RFLAGS), $(warning $(v)))

PKG_CPPFLAGS= -I$(PKGROOT)/include -I$(PKGROOT)/dmlc-core/include -I$(PKGROOT)/rabit/include -I$(PKGROOT) $(XGB_RFLAGS)
PKG_CXXFLAGS= $(SHLIB_OPENMP_CXXFLAGS) $(SHLIB_PTHREAD_FLAGS)
PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(SHLIB_PTHREAD_FLAGS)
PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(SHLIB_PTHREAD_FLAGS) -lwsock32 -lws2_32
OBJECTS= ./xgboost_R.o ./xgboost_custom.o ./xgboost_assert.o ./init.o \
$(PKGROOT)/amalgamation/xgboost-all0.o $(PKGROOT)/amalgamation/dmlc-minimum0.o \
$(PKGROOT)/rabit/src/engine.o $(PKGROOT)/rabit/src/rabit_c_api.o \
Expand Down
6 changes: 5 additions & 1 deletion cmake/Utils.cmake
Expand Up @@ -244,7 +244,7 @@ macro(xgboost_target_properties target)
$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:/utf-8>
-D_CRT_SECURE_NO_WARNINGS
-D_CRT_SECURE_NO_DEPRECATE
)
)
endif (MSVC)

if (WIN32 AND MINGW)
Expand Down Expand Up @@ -314,4 +314,8 @@ macro(xgboost_target_link_libraries target)
if (RABIT_BUILD_MPI)
target_link_libraries(${target} PRIVATE MPI::MPI_CXX)
endif (RABIT_BUILD_MPI)

if (MINGW)
target_link_libraries(${target} PRIVATE wsock32 ws2_32)
endif (MINGW)
endmacro(xgboost_target_link_libraries)
3 changes: 3 additions & 0 deletions rabit/src/allreduce_base.cc
Expand Up @@ -5,7 +5,10 @@
*
* \author Tianqi Chen, Ignacio Cano, Tianyi Zhou
*/
#if !defined(NOMINMAX) && defined(_WIN32)
#define NOMINMAX
#endif // !defined(NOMINMAX)

#include "rabit/base.h"
#include "rabit/internal/rabit-inl.h"
#include "allreduce_base.h"
Expand Down
4 changes: 4 additions & 0 deletions src/cli_main.cc
Expand Up @@ -6,7 +6,11 @@
*/
#define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_DEPRECATE

#if !defined(NOMINMAX) && defined(_WIN32)
#define NOMINMAX
#endif // !defined(NOMINMAX)

#include <dmlc/timer.h>

#include <xgboost/learner.h>
Expand Down
1 change: 0 additions & 1 deletion tests/cpp/common/test_column_matrix.cc
@@ -1,7 +1,6 @@
/*!
* Copyright 2018-2022 by XGBoost Contributors
*/
#include <dmlc/filesystem.h>
#include <gtest/gtest.h>

#include "../../../src/common/column_matrix.h"
Expand Down
6 changes: 4 additions & 2 deletions tests/cpp/common/test_config.cc
@@ -1,11 +1,13 @@
/*!
* Copyright 2019 by Contributors
*/
#include <gtest/gtest.h>

#include <fstream>
#include <string>
#include <gtest/gtest.h>
#include <dmlc/filesystem.h>

#include "../../../src/common/config.h"
#include "../filesystem.h" // dmlc::TemporaryDirectory
#include "../helpers.h"

namespace xgboost {
Expand Down
21 changes: 10 additions & 11 deletions tests/cpp/common/test_hist_util.cu
@@ -1,26 +1,25 @@
/*!
* Copyright 2019-2022 by XGBoost Contributors
*/
#include <dmlc/filesystem.h>
#include <gtest/gtest.h>
#include <thrust/device_vector.h>
#include <xgboost/c_api.h>
#include <xgboost/data.h>

#include <algorithm>
#include <cmath>
#include <thrust/device_vector.h>

#include <xgboost/data.h>
#include <xgboost/c_api.h>

#include "test_hist_util.h"
#include "../helpers.h"
#include "../data/test_array_interface.h"
#include "../../../include/xgboost/logging.h"
#include "../../../src/common/device_helpers.cuh"
#include "../../../src/common/hist_util.h"
#include "../../../src/common/hist_util.cuh"
#include "../../../src/data/device_adapter.cuh"
#include "../../../src/common/hist_util.h"
#include "../../../src/common/math.h"
#include "../../../src/data/device_adapter.cuh"
#include "../../../src/data/simple_dmatrix.h"
#include "../../../include/xgboost/logging.h"
#include "../data/test_array_interface.h"
#include "../filesystem.h" // dmlc::TemporaryDirectory
#include "../helpers.h"
#include "test_hist_util.h"

namespace xgboost {
namespace common {
Expand Down
11 changes: 6 additions & 5 deletions tests/cpp/common/test_hist_util.h
Expand Up @@ -3,16 +3,17 @@
*/
#pragma once
#include <gtest/gtest.h>
#include <dmlc/filesystem.h>

#include <fstream>
#include <random>
#include <vector>
#include <string>
#include <fstream>
#include <vector>

#include "../helpers.h"
#include "../../../src/common/hist_util.h"
#include "../../../src/data/simple_dmatrix.h"
#include "../../../src/data/adapter.h"
#include "../../../src/data/simple_dmatrix.h"
#include "../filesystem.h" // dmlc::TemporaryDirectory
#include "../helpers.h"

#ifdef __CUDACC__
#include <xgboost/json.h>
Expand Down
4 changes: 2 additions & 2 deletions tests/cpp/common/test_io.cc
Expand Up @@ -2,12 +2,12 @@
* Copyright (c) by XGBoost Contributors 2019
*/
#include <gtest/gtest.h>
#include <dmlc/filesystem.h>

#include <fstream>

#include "../helpers.h"
#include "../../../src/common/io.h"
#include "../helpers.h"
#include "../filesystem.h" // dmlc::TemporaryDirectory

namespace xgboost {
namespace common {
Expand Down
11 changes: 6 additions & 5 deletions tests/cpp/common/test_json.cc
Expand Up @@ -2,16 +2,17 @@
* Copyright (c) by Contributors 2019-2022
*/
#include <gtest/gtest.h>
#include <dmlc/filesystem.h>

#include <fstream>
#include <map>

#include "../../../src/common/charconv.h"
#include "../../../src/common/io.h"
#include "../filesystem.h" // dmlc::TemporaryDirectory
#include "../helpers.h"
#include "xgboost/json.h"
#include "xgboost/logging.h"
#include "xgboost/json_io.h"
#include "../helpers.h"
#include "../../../src/common/io.h"
#include "../../../src/common/charconv.h"
#include "xgboost/logging.h"

namespace xgboost {

Expand Down
5 changes: 5 additions & 0 deletions tests/cpp/common/test_quantile.h
@@ -1,3 +1,6 @@
#ifndef XGBOOST_TESTS_CPP_COMMON_TEST_QUANTILE_H_
#define XGBOOST_TESTS_CPP_COMMON_TEST_QUANTILE_H_

#include <rabit/rabit.h>
#include <algorithm>
#include <string>
Expand Down Expand Up @@ -62,3 +65,5 @@ template <typename Fn> void RunWithSeedsAndBins(size_t rows, Fn fn) {
}
} // namespace common
} // namespace xgboost

#endif // XGBOOST_TESTS_CPP_COMMON_TEST_QUANTILE_H_
10 changes: 4 additions & 6 deletions tests/cpp/common/test_version.cc
@@ -1,18 +1,16 @@
/*!
* Copyright 2019 XGBoost contributors
*/
#include <gtest/gtest.h>

#include <dmlc/filesystem.h>
#include <dmlc/io.h>

#include <xgboost/version_config.h>
#include <xgboost/json.h>
#include <gtest/gtest.h>
#include <xgboost/base.h>
#include <xgboost/json.h>
#include <xgboost/version_config.h>

#include <string>

#include "../../../src/common/version.h"
#include "../filesystem.h" // dmlc::TemporaryDirectory

namespace xgboost {
TEST(Version, Basic) {
Expand Down
5 changes: 3 additions & 2 deletions tests/cpp/data/test_data.cc
Expand Up @@ -2,13 +2,14 @@
* Copyright 2019-2022 by XGBoost Contributors
*/
#include <gtest/gtest.h>
#include <dmlc/filesystem.h>

#include <fstream>
#include <memory>
#include <vector>

#include "xgboost/data.h"
#include "../filesystem.h" // dmlc::TemporaryDirectory
#include "../helpers.h"
#include "xgboost/data.h"

namespace xgboost {
TEST(SparsePage, PushCSC) {
Expand Down
5 changes: 2 additions & 3 deletions tests/cpp/data/test_ellpack_page_raw_format.cu
Expand Up @@ -2,12 +2,11 @@
* Copyright 2021 XGBoost contributors
*/
#include <gtest/gtest.h>
#include <dmlc/filesystem.h>
#include <xgboost/data.h>

#include "../../../src/data/sparse_page_source.h"
#include "../../../src/data/ellpack_page.cuh"

#include "../../../src/data/sparse_page_source.h"
#include "../filesystem.h" // dmlc::TemporaryDirectory
#include "../helpers.h"

namespace xgboost {
Expand Down
4 changes: 2 additions & 2 deletions tests/cpp/data/test_file_iterator.cc
Expand Up @@ -2,13 +2,13 @@
* Copyright 2021 XGBoost contributors
*/
#include <gtest/gtest.h>
#include <dmlc/filesystem.h>

#include <memory>

#include "../../../src/data/adapter.h"
#include "../../../src/data/file_iterator.h"
#include "../../../src/data/proxy_dmatrix.h"
#include "../../../src/data/adapter.h"
#include "../filesystem.h" // dmlc::TemporaryDirectory
#include "../helpers.h"

namespace xgboost {
Expand Down
7 changes: 4 additions & 3 deletions tests/cpp/data/test_metainfo.cc
Expand Up @@ -2,12 +2,13 @@
#include "test_metainfo.h"

#include <dmlc/io.h>
#include <dmlc/filesystem.h>
#include <xgboost/data.h>
#include <string>

#include <memory>
#include "../../../src/common/version.h"
#include <string>

#include "../../../src/common/version.h"
#include "../filesystem.h" // dmlc::TemporaryDirectory
#include "../helpers.h"
#include "xgboost/base.h"

Expand Down
7 changes: 4 additions & 3 deletions tests/cpp/data/test_simple_dmatrix.cc
@@ -1,12 +1,13 @@
// Copyright by Contributors
#include <dmlc/filesystem.h>
#include <xgboost/data.h>

#include <array>
#include "xgboost/base.h"
#include "../../../src/data/simple_dmatrix.h"

#include "../../../src/data/adapter.h"
#include "../../../src/data/simple_dmatrix.h"
#include "../filesystem.h" // dmlc::TemporaryDirectory
#include "../helpers.h"
#include "xgboost/base.h"

using namespace xgboost; // NOLINT

Expand Down
1 change: 0 additions & 1 deletion tests/cpp/data/test_simple_dmatrix.cu
@@ -1,5 +1,4 @@
// Copyright by Contributors
#include <dmlc/filesystem.h>
#include <xgboost/data.h>
#include "../../../src/data/simple_dmatrix.h"

Expand Down

0 comments on commit fdd4d5d

Please sign in to comment.