Skip to content

Commit

Permalink
Add --nobuild option to build script.
Browse files Browse the repository at this point in the history
To enable skipping of actual builds and just invoking CMake. Used in
the context of clang-tidy.
  • Loading branch information
csadorf committed Jul 10, 2023
1 parent ca96fa2 commit 5e44948
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ARGS=$*
REPODIR=$(cd $(dirname $0); pwd)

VALIDTARGETS="clean libcuml cuml cpp-mgtests prims bench prims-bench cppdocs pydocs"
VALIDFLAGS="-v -g -n --allgpuarch --singlegpu --nolibcumltest --nvtx --show_depr_warn --codecov --ccache -h --help "
VALIDFLAGS="-v -g -n --allgpuarch --singlegpu --nolibcumltest --nvtx --show_depr_warn --codecov --ccache --nobuild -h --help "
VALIDARGS="${VALIDTARGETS} ${VALIDFLAGS}"
HELP="$0 [<target> ...] [<flag> ...]
where <target> is:
Expand All @@ -46,6 +46,7 @@ HELP="$0 [<target> ...] [<flag> ...]
--codecov - Enable code coverage support by compiling with Cython linetracing
and profiling enabled (WARNING: Impacts performance)
--ccache - Use ccache to cache previous compilations
--nobuild - Invoke CMake without actually building
--nocloneraft - CMake will clone RAFT even if it is in the environment, use this flag to disable that behavior
--static-treelite - Force CMake to use the Treelite static libs, cloning and building them if necessary
Expand Down Expand Up @@ -135,6 +136,7 @@ LONG_ARGUMENT_LIST=(
"ccache"
"nolibcumltest"
"nocloneraft"
"nobuild"
)

# Short arguments
Expand Down Expand Up @@ -262,7 +264,7 @@ if completeBuild || hasArg libcuml || hasArg prims || hasArg bench || hasArg pri
fi

# If `./build.sh cuml` is called, don't build C/C++ components
if completeBuild || hasArg libcuml || hasArg prims || hasArg bench || hasArg cpp-mgtests; then
if (! hasArg --nobuild) && (completeBuild || hasArg libcuml || hasArg prims || hasArg bench || hasArg cpp-mgtests); then
cd ${LIBCUML_BUILD_DIR}
if [ -n "${INSTALL_TARGET}" ]; then
cmake --build ${LIBCUML_BUILD_DIR} -j${PARALLEL_LEVEL} ${build_args} --target ${INSTALL_TARGET} ${VERBOSE_FLAG}
Expand All @@ -271,14 +273,14 @@ if completeBuild || hasArg libcuml || hasArg prims || hasArg bench || hasArg cpp
fi
fi

if hasArg cppdocs; then
if (! hasArg --nobuild) && hasArg cppdocs; then
cd ${LIBCUML_BUILD_DIR}
cmake --build ${LIBCUML_BUILD_DIR} --target docs_cuml
fi


# Build and (optionally) install the cuml Python package
if completeBuild || hasArg cuml || hasArg pydocs; then
if (! hasArg --nobuild) && (completeBuild || hasArg cuml || hasArg pydocs); then
# Append `-DFIND_CUML_CPP=ON` to CUML_EXTRA_CMAKE_ARGS unless a user specified the option.
if [[ "${CUML_EXTRA_CMAKE_ARGS}" != *"DFIND_CUML_CPP"* ]]; then
CUML_EXTRA_CMAKE_ARGS="${CUML_EXTRA_CMAKE_ARGS} -DFIND_CUML_CPP=ON"
Expand Down
2 changes: 1 addition & 1 deletion ci/run_clang_tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rapids-mamba-retry env create --force -f env.yaml -n clang_tidy
# Temporarily allow unbound variables for conda activation.
set +u && conda activate clang_tidy && set -u

./build.sh libcuml
./build.sh --nobuild libcuml

rapids-logger "Run clang-tidy"

Expand Down

0 comments on commit 5e44948

Please sign in to comment.