Skip to content

Commit bce1494

Browse files
committed
address review comments
1 parent e0d89ac commit bce1494

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

build.sh

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ REPODIR=$(cd "$(dirname "$0")"; pwd)
1515
LIBCUOPT_BUILD_DIR=${LIBCUOPT_BUILD_DIR:=${REPODIR}/cpp/build}
1616
LIBMPS_PARSER_BUILD_DIR=${LIBMPS_PARSER_BUILD_DIR:=${REPODIR}/cpp/libmps_parser/build}
1717

18-
VALIDARGS="clean libcuopt libmps_parser cuopt_mps_parser cuopt cuopt_server cuopt_sh_client docs deb -a -b -g -fsanitize -v -j -l= --verbose-pdlp --build-lp-only --no-fetch-rapids --skip-c-python-adapters --skip-tests-build --skip-routing-build --skip-fatbin-write --host-lineinfo [--cmake-args=\\\"<args>\\\"] [--cache-tool=<tool>] -n --allgpuarch --ci-only-arch --show_depr_warn -h --help"
18+
VALIDARGS="clean libcuopt libmps_parser cuopt_mps_parser cuopt cuopt_server cuopt_sh_client docs deb -a -b -g -fsanitize -v -l= --verbose-pdlp --build-lp-only --no-fetch-rapids --skip-c-python-adapters --skip-tests-build --skip-routing-build --skip-fatbin-write --host-lineinfo [--cmake-args=\\\"<args>\\\"] [--cache-tool=<tool>] -n --allgpuarch --ci-only-arch --show_depr_warn -h --help"
1919
HELP="$0 [<target> ...] [<flag> ...]
2020
where <target> is:
2121
clean - remove all existing build artifacts and configuration (start over)
@@ -34,7 +34,6 @@ HELP="$0 [<target> ...] [<flag> ...]
3434
-b - Build with benchmark settings
3535
-fsanitize - Build with sanitizer
3636
-n - no install step
37-
-j - parallel build jobs (unlimited if no value, or -j<N> for N threads)
3837
--no-fetch-rapids - don't fetch rapids dependencies
3938
-l= - log level. Options are: TRACE | DEBUG | INFO | WARN | ERROR | CRITICAL | OFF. Default=INFO
4039
--verbose-pdlp - verbose mode for pdlp solver
@@ -86,7 +85,7 @@ CACHE_ARGS=()
8685
PYTHON_ARGS_FOR_INSTALL=("-m" "pip" "install" "--no-build-isolation" "--no-deps")
8786
LOGGING_ACTIVE_LEVEL="INFO"
8887
FETCH_RAPIDS=ON
89-
PARALLEL_LEVEL=""
88+
PARALLEL_LEVEL=${PARALLEL_LEVEL:=$(nproc)}
9089

9190
# Set defaults for vars that may not have been defined externally
9291
# FIXME: if PREFIX is not set, check CONDA_PREFIX, but there is no fallback
@@ -174,26 +173,6 @@ function cmakeArgs {
174173
read -ra EXTRA_CMAKE_ARGS <<< "$EXTRA_CMAKE_ARGS"
175174
}
176175

177-
function parallelArgs {
178-
# Check for -j option
179-
if [[ -n $(echo "$ARGS" | { grep -E "\-j" || true; } ) ]]; then
180-
# Extract -j with optional number (e.g., -j, -j8, -j16)
181-
PARALLEL_ARG=$(echo "$ARGS" | { grep -Eo "\-j[0-9]*" || true; } | head -1)
182-
if [[ -n ${PARALLEL_ARG} ]]; then
183-
# Remove the -j argument from list of args so that it passes validArgs function
184-
ARGS=${ARGS//$PARALLEL_ARG/}
185-
# Extract the number if present
186-
PARALLEL_NUM=$(echo "$PARALLEL_ARG" | sed 's/-j//')
187-
if [[ -z ${PARALLEL_NUM} ]]; then
188-
# If no number specified, use nproc
189-
PARALLEL_LEVEL=$(nproc)
190-
else
191-
PARALLEL_LEVEL=${PARALLEL_NUM}
192-
fi
193-
fi
194-
fi
195-
}
196-
197176

198177
if hasArg -h || hasArg --help; then
199178
echo "${HELP}"
@@ -205,7 +184,6 @@ if (( NUMARGS != 0 )); then
205184
cacheTool
206185
cmakeArgs
207186
loggingArgs
208-
parallelArgs
209187
for a in ${ARGS}; do
210188
if ! (echo " ${VALIDARGS} " | grep -q " ${a} "); then
211189
echo "Invalid option: ${a}"

0 commit comments

Comments
 (0)