You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/build.rst
+23-45Lines changed: 23 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,10 +68,8 @@ After obtaining the source code, one builds XGBoost by running CMake:
68
68
.. code-block:: bash
69
69
70
70
cd xgboost
71
-
mkdir build
72
-
cd build
73
-
cmake ..
74
-
make -j$(nproc)
71
+
cmake -B build -S .
72
+
cmake --build build -j$(nproc)
75
73
76
74
Building on MacOS
77
75
=================
@@ -94,12 +92,10 @@ following from the root of the XGBoost directory:
94
92
95
93
.. code-block:: bash
96
94
97
-
mkdir build
98
-
cd build
99
-
cmake .. -G"Visual Studio 14 2015 Win64"
100
-
# for VS15: cmake .. -G"Visual Studio 15 2017" -A x64
101
-
# for VS16: cmake .. -G"Visual Studio 16 2019" -A x64
102
-
cmake --build . --config Release
95
+
cmake -B build -S . -G"Visual Studio 14 2015 Win64"
96
+
# for VS15: cmake -B build -S . -G"Visual Studio 15 2017" -A x64
97
+
# for VS16: cmake -B build -S . -G"Visual Studio 16 2019" -A x64
98
+
cmake --build build --config Release
103
99
104
100
This specifies an out of source build using the Visual Studio 64 bit generator. (Change the ``-G`` option appropriately if you have a different version of Visual Studio installed.)
105
101
@@ -127,10 +123,8 @@ From the command line on Linux starting from the XGBoost directory:
127
123
128
124
.. code-block:: bash
129
125
130
-
mkdir build
131
-
cd build
132
-
cmake .. -DUSE_CUDA=ON
133
-
make -j4
126
+
cmake -B build -S . -DUSE_CUDA=ON
127
+
cmake --build build -j4
134
128
135
129
.. note:: Specifying compute capability
136
130
@@ -142,28 +136,24 @@ From the command line on Linux starting from the XGBoost directory:
Some additional flags are available for NCCL, ``BUILD_WITH_SHARED_NCCL`` enables building XGBoost with NCCL as a shared library, while ``USE_DLOPEN_NCCL`` enables XGBoost to load NCCL at runtime using ``dlopen``.
151
143
152
144
On Windows, run CMake as follows:
153
145
154
146
.. code-block:: bash
155
147
156
-
mkdir build
157
-
cd build
158
-
cmake .. -G"Visual Studio 17 2022" -A x64 -DUSE_CUDA=ON
148
+
cmake -B build -S . -G"Visual Studio 17 2022" -A x64 -DUSE_CUDA=ON
159
149
160
150
(Change the ``-G`` option appropriately if you have a different version of Visual Studio installed.)
161
151
162
152
The above cmake configuration run will create an ``xgboost.sln`` solution file in the build directory. Build this solution in Release mode, either from Visual studio or from command line:
If CMake can't find your R during the configuration step, you might provide the location of R to CMake like this: ``-DLIBR_HOME="C:\Program Files\R\R-4.0.0"``.
0 commit comments