Skip to content

Commit 18d77c6

Browse files
authored
install sycl runtime for cpp tests with conda (#20)
* use conda to install sycl runtime * specify conda dir; specify python version * modify env settings --------- Co-authored-by: Dmitry Razdoburdin <>
1 parent 5046112 commit 18d77c6

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

.github/workflows/main.yml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -70,39 +70,40 @@ jobs:
7070
fail-fast: false
7171
matrix:
7272
os: [ubuntu-latest]
73+
python-version: ["3.8"]
7374
steps:
7475
- uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791 # v2.5.0
7576
with:
7677
submodules: 'true'
77-
- name: Install SYCL runtime
78-
run: |
79-
sudo apt-get update
80-
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
81-
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
82-
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
83-
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
84-
sudo add-apt-repository -y "deb https://apt.repos.intel.com/oneapi all main"
85-
sudo apt-get update
86-
sudo apt-get install -y intel-dpcpp-cpp-compiler-2023.2.1
87-
source /opt/intel/oneapi/compiler/latest/env/vars.sh
88-
source /opt/intel/oneapi/tbb/latest/env/vars.sh
89-
icpx --version
90-
sycl-ls
78+
- uses: mamba-org/provision-with-micromamba@f347426e5745fe3dfc13ec5baf20496990d0281f # v14
79+
with:
80+
cache-downloads: true
81+
cache-env: true
82+
environment-name: linux_sycl_test
83+
environment-file: tests/ci_build/conda_env/linux_sycl_test.yml
84+
85+
- name: Display Conda env
86+
run: |
87+
conda info
88+
conda list
9189
9290
- name: Build and install XGBoost
9391
shell: bash -l {0}
9492
run: |
95-
source /opt/intel/oneapi/compiler/latest/env/vars.sh
96-
source /opt/intel/oneapi/tbb/latest/env/vars.sh
9793
mkdir build
9894
cd build
99-
cmake .. -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON -DPLUGIN_SYCL=ON
95+
# modify variable to build xgboost with g++ and plugin with icxp
96+
export CXX=g++
97+
export CC=gcc
98+
export CXXFLAGS=${CXXFLAGS/' -isystem '$CONDA_PREFIX'/include'}
99+
export DEBUG_CXXFLAGS=${DEBUG_CXXFLAGS/' -isystem '$CONDA_PREFIX'/include'}
100+
export CPPFLAGS=${CPPFLAGS/' -isystem '$CONDA_PREFIX'/include'}
101+
export DEBUG_CPPFLAGS=${DEBUG_CPPFLAGS/' -isystem '$CONDA_PREFIX'/include'}
102+
cmake .. -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON -DPLUGIN_SYCL=ON -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
100103
make -j$(nproc)
101104
102105
- name: Run gtest binary
103106
run: |
104-
source /opt/intel/oneapi/compiler/latest/env/vars.sh
105-
source /opt/intel/oneapi/tbb/latest/env/vars.sh
106107
cd build
107108
./testxgboost --gtest_filter=Sycl*
108109

0 commit comments

Comments
 (0)