[CI] Pack R package tarball with pre-built xgboost.so (with GPU support) (#6827)
* Add scripts for packaging R package with GPU-enabled libxgboost.so * [CI] Automatically build R package tarball * Add comments * Don't build tarball for pull requests * Update the installation doc
This commit is contained in:
committed by
GitHub
parent
f294c4e023
commit
ea7a6a0321
33
tests/ci_build/build_r_pkg_with_cuda.sh
Executable file
33
tests/ci_build/build_r_pkg_with_cuda.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -x
|
||||
|
||||
if [ "$#" -ne 1 ]
|
||||
then
|
||||
echo "Build the R package tarball with CUDA code. Usage: $0 [commit hash]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
commit_hash="$1"
|
||||
|
||||
make Rpack
|
||||
mv xgboost/ xgboost_rpack/
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -GNinja -DUSE_CUDA=ON -DR_LIB=ON
|
||||
ninja
|
||||
cd ..
|
||||
|
||||
rm xgboost
|
||||
# This super wacky hack is found in cmake/RPackageInstall.cmake.in and
|
||||
# cmake/RPackageInstallTargetSetup.cmake. This hack lets us bypass the normal build process of R
|
||||
# and have R use xgboost.so that we've already built.
|
||||
rm -v xgboost_rpack/configure
|
||||
rm -rfv xgboost_rpack/src
|
||||
mkdir -p xgboost_rpack/src
|
||||
cp -v lib/xgboost.so xgboost_rpack/src/
|
||||
echo 'all:' > xgboost_rpack/src/Makefile
|
||||
echo 'all:' > xgboost_rpack/src/Makefile.win
|
||||
mv xgboost_rpack/ xgboost/
|
||||
tar cvzf xgboost_r_gpu_linux_${commit_hash}.tar.gz xgboost/
|
||||
Reference in New Issue
Block a user