mirror of
https://github.com/dmlc/dgl.git
synced 2026-06-04 19:44:23 +08:00
[Misc] Support DGL feature option. (#6088)
Co-authored-by: Ubuntu <ubuntu@ip-172-31-28-63.ap-northeast-1.compute.internal>
This commit is contained in:
committed by
GitHub
parent
158b0fcdc7
commit
d7410cf468
115
CMakeLists.txt
115
CMakeLists.txt
@@ -10,21 +10,106 @@ include(cmake/util/Util.cmake)
|
||||
include(cmake/util/MshadowUtil.cmake)
|
||||
include(cmake/util/FindCUDA.cmake)
|
||||
|
||||
# NOTE: do not modify this file to change option values.
|
||||
# Use bash script/build_dgl.sh -e '-DOPTION=VALUE' through command-line.
|
||||
dgl_option(USE_CUDA "Build with CUDA" OFF)
|
||||
dgl_option(USE_OPENMP "Build with OpenMP" ON)
|
||||
dgl_option(USE_LIBXSMM "Build with LIBXSMM library optimization" ON)
|
||||
dgl_option(BUILD_CPP_TEST "Build cpp unittest executables" OFF)
|
||||
dgl_option(LIBCXX_ENABLE_PARALLEL_ALGORITHMS "Enable the parallel algorithms library. This requires the PSTL to be available." OFF)
|
||||
dgl_option(USE_S3 "Build with S3 support" OFF)
|
||||
dgl_option(USE_HDFS "Build with HDFS support" OFF) # Set env HADOOP_HDFS_HOME if needed
|
||||
dgl_option(REBUILD_LIBXSMM "Clean LIBXSMM build cache at every build" OFF) # Set env HADOOP_HDFS_HOME if needed
|
||||
dgl_option(USE_EPOLL "Build with epoll for socket communicator" ON)
|
||||
dgl_option(BUILD_TORCH "Build the PyTorch plugin" OFF)
|
||||
dgl_option(BUILD_SPARSE "Build DGL sparse library" ON)
|
||||
dgl_option(BUILD_GRAPHBOLT "Build Graphbolt library" OFF)
|
||||
dgl_option(TORCH_PYTHON_INTERPS "Python interpreter used to build tensoradapter and DGL sparse library" python3)
|
||||
# TODO(#5475): Clean up the old flags after CI and regression framework adopt to the new setup.
|
||||
if (NOT DEFINED BUILD_TYPE)
|
||||
dgl_option(USE_CUDA "Build with CUDA" OFF)
|
||||
dgl_option(USE_OPENMP "Build with OpenMP" ON)
|
||||
dgl_option(USE_LIBXSMM "Build with LIBXSMM library optimization" ON)
|
||||
dgl_option(BUILD_CPP_TEST "Build cpp unittest executables" OFF)
|
||||
dgl_option(LIBCXX_ENABLE_PARALLEL_ALGORITHMS "Enable the parallel algorithms library. This requires the PSTL to be available." OFF)
|
||||
dgl_option(USE_S3 "Build with S3 support" OFF)
|
||||
dgl_option(USE_HDFS "Build with HDFS support" OFF) # Set env HADOOP_HDFS_HOME if needed
|
||||
dgl_option(REBUILD_LIBXSMM "Clean LIBXSMM build cache at every build" OFF) # Set env HADOOP_HDFS_HOME if needed
|
||||
dgl_option(USE_EPOLL "Build with epoll for socket communicator" ON)
|
||||
dgl_option(BUILD_TORCH "Build the PyTorch plugin" OFF)
|
||||
dgl_option(BUILD_SPARSE "Build DGL sparse library" ON)
|
||||
dgl_option(BUILD_GRAPHBOLT "Build Graphbolt library" OFF)
|
||||
dgl_option(TORCH_PYTHON_INTERPS "Python interpreter used to build tensoradapter and DGL sparse library" python3)
|
||||
else()
|
||||
# Options for building DGL.
|
||||
# NOTE: do not modify this file to change option values.
|
||||
# Use bash script/build_dgl.sh -e '-DOPTION=VALUE' through command-line.
|
||||
dgl_option(
|
||||
BUILD_TYPE
|
||||
"Type of the build: dev, test or release"
|
||||
"dev"
|
||||
)
|
||||
message(STATUS "Build for ${BUILD_TYPE}")
|
||||
|
||||
dgl_option(
|
||||
USE_CUDA
|
||||
"Build with CUDA"
|
||||
OFF
|
||||
)
|
||||
dgl_option(
|
||||
TORCH_PYTHON_INTERPS
|
||||
"Python interpreter used to build tensoradapter and DGL sparse library"
|
||||
python3
|
||||
)
|
||||
|
||||
# Options for building DGL features.
|
||||
# NOTE: do not modify this file to change option values.
|
||||
# Use bash script/build_dgl.sh -e '-DFEATURE_NAME=ON/OFF' through command-line.
|
||||
dgl_feature_option(
|
||||
BUILD_SPARSE
|
||||
"Build DGL sparse library"
|
||||
"dev" "test" "release"
|
||||
)
|
||||
dgl_feature_option(
|
||||
USE_EPOLL
|
||||
"Build with epoll for socket communicator"
|
||||
"dev" "test" "release"
|
||||
)
|
||||
dgl_feature_option(
|
||||
USE_LIBXSMM
|
||||
"Build with LIBXSMM library optimization"
|
||||
"dev" "test" "release"
|
||||
)
|
||||
dgl_feature_option(
|
||||
USE_OPENMP
|
||||
"Build with OpenMP"
|
||||
"dev" "test" "release"
|
||||
)
|
||||
|
||||
dgl_feature_option(
|
||||
BUILD_GRAPHBOLT
|
||||
"Build Graphbolt library"
|
||||
"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."
|
||||
"none"
|
||||
)
|
||||
dgl_feature_option(
|
||||
REBUILD_LIBXSMM
|
||||
"Clean LIBXSMM build cache at every build"
|
||||
"none"
|
||||
)
|
||||
dgl_feature_option(
|
||||
USE_HDFS
|
||||
"Build with HDFS support"
|
||||
"none"
|
||||
) # Set env HADOOP_HDFS_HOME if needed
|
||||
dgl_feature_option(
|
||||
USE_S3
|
||||
"Build with S3 support"
|
||||
"none"
|
||||
)
|
||||
|
||||
# Build cpp test only in test build.
|
||||
dgl_feature_option(
|
||||
BUILD_CPP_TEST
|
||||
"Build cpp unittest executables"
|
||||
"test"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Set debug compile option for gdb, only happens when -DCMAKE_BUILD_TYPE=DEBUG
|
||||
if (NOT MSVC)
|
||||
|
||||
@@ -4,6 +4,25 @@ macro(__dgl_option variable description value)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
#######################################################
|
||||
# An option to specify the build type for a feature.
|
||||
# Usage:
|
||||
# dgl_feature_option(<option_variable> "doc string" "dev" "release")
|
||||
macro(dgl_feature_option variable description)
|
||||
set(__value "")
|
||||
foreach(arg ${ARGN})
|
||||
if(arg STREQUAL "dev" OR arg STREQUAL "test" OR arg STREQUAL "release")
|
||||
list(APPEND __value ${arg})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(${BUILD_TYPE} IN_LIST __value)
|
||||
__dgl_option(${variable} "${description}" ON)
|
||||
else()
|
||||
__dgl_option(${variable} "${description}" OFF)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
#######################################################
|
||||
# An option that the user can select. Can accept condition to control when option is available for user.
|
||||
# Usage:
|
||||
|
||||
Reference in New Issue
Block a user