Skip to content

Commit

Permalink
[Misc] Clean up build option for testing. (dmlc#6090)
Browse files Browse the repository at this point in the history
Co-authored-by: Ubuntu <[email protected]>
  • Loading branch information
frozenbugs and Ubuntu authored Aug 3, 2023
1 parent bdbc017 commit 3397496
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 17 deletions.
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ else()
"Build DGL sparse library"
"dev" "test" "release"
)
dgl_feature_option(
BUILD_TORCH
"Build the PyTorch plugin"
"dev" "test" "release"
)
dgl_feature_option(
USE_EPOLL
"Build with epoll for socket communicator"
Expand All @@ -77,11 +82,6 @@ else()
"dev" "test"
)

dgl_feature_option(
BUILD_TORCH
"Build the PyTorch plugin"
"none"
)
dgl_feature_option(
LIBCXX_ENABLE_PARALLEL_ALGORITHMS
"Enable the parallel algorithms library. This requires the PSTL to be available."
Expand Down
2 changes: 1 addition & 1 deletion script/build_dgl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ if [[ -z ${cuda} ]]; then
else
mkdir -p build
cd build
cmake -DUSE_CUDA=${cuda} ${extra_args} ..
cmake -DBUILD_TYPE=dev -DUSE_CUDA=${cuda} ${extra_args} ..
fi

if [[ ${PWD} == "${DGL_HOME}/build" ]]; then
Expand Down
5 changes: 1 addition & 4 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ The code organization goes as follows:
Compile with unittest by executing the command below
```
# Assume current directory is the root directory of dgl, and googletest submodule is initialized
mkdir build
cd build
cmake .. -DBUILD_CPP_TEST=1
make -j${nproc}
bash script/build_dgl.sh -c -r -e '-DBUILD_TYPE=test'
./runUnitTests
```
2 changes: 1 addition & 1 deletion tests/scripts/build_dgl.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SET TEMP=%WORKSPACE%\tmp
SET TMPDIR=%WORKSPACE%\tmp

PUSHD build
cmake -DCMAKE_CXX_FLAGS="/DDGL_EXPORTS" -DUSE_OPENMP=ON -DBUILD_TORCH=ON -DBUILD_GRAPHBOLT=ON -Dgtest_force_shared_crt=ON -DDMLC_FORCE_SHARED_CRT=ON -DBUILD_CPP_TEST=1 -DCMAKE_CONFIGURATION_TYPES="Release" -DTORCH_PYTHON_INTERPS=python -DBUILD_SPARSE=ON .. -G "Visual Studio 16 2019" || EXIT /B 1
cmake -DBUILD_TYPE=test -DCMAKE_CXX_FLAGS="/DDGL_EXPORTS" -Dgtest_force_shared_crt=ON -DDMLC_FORCE_SHARED_CRT=ON -DCMAKE_CONFIGURATION_TYPES="Release" -DTORCH_PYTHON_INTERPS=python .. -G "Visual Studio 16 2019" || EXIT /B 1
msbuild dgl.sln /m /nr:false || EXIT /B 1
COPY /Y Release\runUnitTests.exe .
POPD
Expand Down
14 changes: 8 additions & 6 deletions tests/scripts/build_dgl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,26 @@ if [ $# -ne 1 ]; then
exit -1
fi

CMAKE_VARS="-DBUILD_CPP_TEST=ON -DUSE_OPENMP=ON -DBUILD_GRAPHBOLT=ON"
# Build for testing.
CMAKE_VARS="-DBUILD_TYPE=test"

if [[ $1 != "cpu" ]]; then
CMAKE_VARS="$CMAKE_VARS -DUSE_CUDA=ON"
fi

# This is a semicolon-separated list of Python interpreters containing PyTorch.
# The value here is for CI. Replace it with your own or comment this whole
# statement for default Python interpreter.
if [ "$1" != "cugraph" ]; then
# We do not build pytorch for cugraph because currently building
# pytorch against all the supported cugraph versions is not supported
# See issue: https://github.com/rapidsai/cudf/issues/8510
CMAKE_VARS="$CMAKE_VARS -DBUILD_TORCH=ON -DTORCH_PYTHON_INTERPS=/opt/conda/envs/pytorch-ci/bin/python"
CMAKE_VARS="$CMAKE_VARS -DTORCH_PYTHON_INTERPS=/opt/conda/envs/pytorch-ci/bin/python"
else
# Disable sparse build as cugraph docker image lacks cuDNN.
CMAKE_VARS="$CMAKE_VARS -DBUILD_TORCH=OFF -DBUILD_SPARSE=OFF"
fi

if [[ $1 != "cpu" ]]; then
CMAKE_VARS="-DUSE_CUDA=ON $CMAKE_VARS"
fi

if [ -d build ]; then
rm -rf build
fi
Expand Down

0 comments on commit 3397496

Please sign in to comment.