"git@developer.sourcefind.cn:OpenDAS/ollama.git" did not exist on "abe614c705736eed06440d657ab75ca094fc78f3"
Unverified Commit 71194229 authored by Hongzhi (Steve), Chen's avatar Hongzhi (Steve), Chen Committed by GitHub
Browse files

[Misc] Support build type in build dgl script. (#6153)


Co-authored-by: default avatarUbuntu <ubuntu@ip-172-31-28-63.ap-northeast-1.compute.internal>
parent b1dd592d
...@@ -20,11 +20,12 @@ OPTIONS: ...@@ -20,11 +20,12 @@ OPTIONS:
-e Extra arguments of cmake. -e Extra arguments of cmake.
-g Restart CUDA build. -g Restart CUDA build.
-r Remove all intermediate output. -r Remove all intermediate output.
-t Type of the build: dev, test or release (default: dev).
EOF EOF
} }
# Parse flags. # Parse flags.
while getopts "ce:ghr" flag; do while getopts "ce:ghrt:" flag; do
if [[ ${flag} == "c" ]]; then if [[ ${flag} == "c" ]]; then
cuda="OFF" cuda="OFF"
elif [[ ${flag} == "e" ]]; then elif [[ ${flag} == "e" ]]; then
...@@ -33,6 +34,8 @@ while getopts "ce:ghr" flag; do ...@@ -33,6 +34,8 @@ while getopts "ce:ghr" flag; do
cuda="ON" cuda="ON"
elif [[ ${flag} == "r" ]]; then elif [[ ${flag} == "r" ]]; then
remove="YES" remove="YES"
elif [[ ${flag} == "t" ]]; then
build_type=${OPTARG}
elif [[ ${flag} == "h" ]]; then elif [[ ${flag} == "h" ]]; then
usage usage
exit 0 exit 0
...@@ -58,6 +61,10 @@ if [[ ${remove} == "YES" ]]; then ...@@ -58,6 +61,10 @@ if [[ ${remove} == "YES" ]]; then
rm -rf build rm -rf build
fi fi
if [[ -z ${build_type} ]]; then
build_type="dev"
fi
if [[ -z ${cuda} ]]; then if [[ -z ${cuda} ]]; then
if [[ -d build ]]; then if [[ -d build ]]; then
cd build cd build
...@@ -69,7 +76,7 @@ if [[ -z ${cuda} ]]; then ...@@ -69,7 +76,7 @@ if [[ -z ${cuda} ]]; then
else else
mkdir -p build mkdir -p build
cd build cd build
cmake -DBUILD_TYPE=dev -DUSE_CUDA=${cuda} ${extra_args} .. cmake -DBUILD_TYPE=${build_type} -DUSE_CUDA=${cuda} ${extra_args} ..
fi fi
if [[ ${PWD} == "${DGL_HOME}/build" ]]; then if [[ ${PWD} == "${DGL_HOME}/build" ]]; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment