diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 88bf495f9..990396308 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -80,7 +80,6 @@ repos: hooks: - id: shellcheck args: ["--severity=warning"] - files: ^ci/ default_language_version: python: python3 diff --git a/build.sh b/build.sh index 9165dbfbe..7cb9aa82c 100755 --- a/build.sh +++ b/build.sh @@ -23,7 +23,7 @@ ARGS=$* # NOTE: ensure all dir changes are relative to the location of this # script, and that this script resides in the repo dir! -REPODIR=$(cd $(dirname $0); pwd) +REPODIR=$(cd "$(dirname "$0")"; pwd) LIBCUOPT_BUILD_DIR=${LIBCUOPT_BUILD_DIR:=${REPODIR}/cpp/build} LIBMPS_PARSER_BUILD_DIR=${LIBMPS_PARSER_BUILD_DIR:=${REPODIR}/cpp/libmps_parser/build} @@ -77,8 +77,8 @@ INSTALL_TARGET=install BUILD_DISABLE_DEPRECATION_WARNING=ON BUILD_ALL_GPU_ARCH=0 BUILD_CI_ONLY=0 -CACHE_ARGS="" -PYTHON_ARGS_FOR_INSTALL="-m pip install --no-build-isolation --no-deps" +CACHE_ARGS=() +PYTHON_ARGS_FOR_INSTALL=("-m" "pip" "install" "--no-build-isolation" "--no-deps") LOGGING_ACTIVE_LEVEL="INFO" FETCH_RAPIDS=ON @@ -91,35 +91,35 @@ BUILD_ABI=${BUILD_ABI:=ON} export CMAKE_GENERATOR=Ninja function hasArg { - (( ${NUMARGS} != 0 )) && (echo " ${ARGS} " | grep -q " $1 ") + (( NUMARGS != 0 )) && (echo " ${ARGS} " | grep -q " $1 ") } function buildAll { - (( ${NUMARGS} == 0 )) || !(echo " ${ARGS} " | grep -q " [^-]\+ ") + (( NUMARGS == 0 )) || ! (echo " ${ARGS} " | grep -q " [^-]\+ ") } function cacheTool { # Check for multiple cache options - if [[ $(echo $ARGS | { grep -Eo "\-\-cache\-tool" || true; } | wc -l ) -gt 1 ]]; then + if [[ $(echo "$ARGS" | { grep -Eo "\-\-cache\-tool" || true; } | wc -l ) -gt 1 ]]; then echo "Multiple --cache-tool options were provided, please provide only one: ${ARGS}" exit 1 fi # Check for cache tool option - if [[ -n $(echo $ARGS | { grep -E "\-\-cache\-tool" || true; } ) ]]; then + if [[ -n $(echo "$ARGS" | { grep -E "\-\-cache\-tool" || true; } ) ]]; then # There are possible weird edge cases that may cause this regex filter to output nothing and fail silently # the true pipe will catch any weird edge cases that may happen and will cause the program to fall back # on the invalid option error - CACHE_TOOL=$(echo $ARGS | sed -e 's/.*--cache-tool=//' -e 's/ .*//') + CACHE_TOOL=$(echo "$ARGS" | sed -e 's/.*--cache-tool=//' -e 's/ .*//') if [[ -n ${CACHE_TOOL} ]]; then # Remove the full CACHE_TOOL argument from list of args so that it passes validArgs function ARGS=${ARGS//--cache-tool=$CACHE_TOOL/} - CACHE_ARGS="-DCMAKE_CUDA_COMPILER_LAUNCHER=${CACHE_TOOL} -DCMAKE_C_COMPILER_LAUNCHER=${CACHE_TOOL} -DCMAKE_CXX_COMPILER_LAUNCHER=${CACHE_TOOL}" + CACHE_ARGS=("-DCMAKE_CUDA_COMPILER_LAUNCHER=${CACHE_TOOL}" "-DCMAKE_C_COMPILER_LAUNCHER=${CACHE_TOOL}" "-DCMAKE_CXX_COMPILER_LAUNCHER=${CACHE_TOOL}") fi fi } function loggingArgs { - if [[ $(echo $ARGS | { grep -Eo "\-l" || true; } | wc -l ) -gt 1 ]]; then + if [[ $(echo "$ARGS" | { grep -Eo "\-l" || true; } | wc -l ) -gt 1 ]]; then echo "Multiple -l logging options were provided, please provide only one: ${ARGS}" exit 1 fi @@ -127,17 +127,17 @@ function loggingArgs { LOG_LEVEL_LIST=("TRACE" "DEBUG" "INFO" "WARN" "ERROR" "CRITICAL" "OFF") # Check for logging option - if [[ -n $(echo $ARGS | { grep -E "\-l" || true; } ) ]]; then - LOGGING_ARGS=$(echo $ARGS | { grep -Eo "\-l=\S+" || true; }) + if [[ -n $(echo "$ARGS" | { grep -E "\-l" || true; } ) ]]; then + LOGGING_ARGS=$(echo "$ARGS" | { grep -Eo "\-l=\S+" || true; }) if [[ -n ${LOGGING_ARGS} ]]; then # Remove the full log argument from list of args so that it passes validArgs function ARGS=${ARGS//$LOGGING_ARGS/} # Filter the full argument down to just the extra string that will be added to cmake call - LOGGING_ARGS=$(echo $LOGGING_ARGS | sed -e 's/^"//' -e 's/"$//' | cut -c4- | grep -Eo "\S+" | tr '[:lower:]' '[:upper:]') - if [[ "${LOG_LEVEL_LIST[@]}" =~ $LOGGING_ARGS ]]; then + LOGGING_ARGS=$(echo "$LOGGING_ARGS" | sed -e 's/^"//' -e 's/"$//' | cut -c4- | grep -Eo "\S+" | tr '[:lower:]' '[:upper:]') + if [[ "${LOG_LEVEL_LIST[*]}" =~ $LOGGING_ARGS ]]; then LOGGING_ACTIVE_LEVEL=$LOGGING_ARGS else - echo "Invalid logging arg $LOGGING_ARGS, expected any of ${LOG_LEVEL_LIST[@]}" + echo "Invalid logging arg $LOGGING_ARGS, expected any of ${LOG_LEVEL_LIST[*]}" exit 1 fi fi @@ -146,24 +146,26 @@ function loggingArgs { function cmakeArgs { # Check for multiple cmake args options - if [[ $(echo $ARGS | { grep -Eo "\-\-cmake\-args" || true; } | wc -l ) -gt 1 ]]; then + if [[ $(echo "$ARGS" | { grep -Eo "\-\-cmake\-args" || true; } | wc -l ) -gt 1 ]]; then echo "Multiple --cmake-args options were provided, please provide only one: ${ARGS}" exit 1 fi # Check for cmake args option - if [[ -n $(echo $ARGS | { grep -E "\-\-cmake\-args" || true; } ) ]]; then + if [[ -n $(echo "$ARGS" | { grep -E "\-\-cmake\-args" || true; } ) ]]; then # There are possible weird edge cases that may cause this regex filter to output nothing and fail silently # the true pipe will catch any weird edge cases that may happen and will cause the program to fall back # on the invalid option error - EXTRA_CMAKE_ARGS=$(echo $ARGS | { grep -Eo "\-\-cmake\-args=\".+\"" || true; }) + EXTRA_CMAKE_ARGS=$(echo "$ARGS" | { grep -Eo "\-\-cmake\-args=\".+\"" || true; }) if [[ -n ${EXTRA_CMAKE_ARGS} ]]; then # Remove the full EXTRA_CMAKE_ARGS argument from list of args so that it passes validArgs function ARGS=${ARGS//$EXTRA_CMAKE_ARGS/} # Filter the full argument down to just the extra string that will be added to cmake call - EXTRA_CMAKE_ARGS=$(echo $EXTRA_CMAKE_ARGS | grep -Eo "\".+\"" | sed -e 's/^"//' -e 's/"$//') + EXTRA_CMAKE_ARGS=$(echo "$EXTRA_CMAKE_ARGS" | grep -Eo "\".+\"" | sed -e 's/^"//' -e 's/"$//') fi fi + + read -ra EXTRA_CMAKE_ARGS <<< "$EXTRA_CMAKE_ARGS" } @@ -173,7 +175,7 @@ if hasArg -h || hasArg --help; then fi # Check for valid usage -if (( ${NUMARGS} != 0 )); then +if (( NUMARGS != 0 )); then cacheTool cmakeArgs loggingArgs @@ -215,12 +217,27 @@ if hasArg --show_depr_warn; then BUILD_DISABLE_DEPRECATION_WARNING=OFF fi +function contains_string { + local search_string="$1" + shift + local array=("$@") + + for element in "${array[@]}"; do + if [[ "$element" == *"$search_string"* ]]; then + return 0 + fi + done + + return 1 +} + # Append `-DFIND_CUOPT_CPP=ON` to CMAKE_ARGS unless a user specified the option. -if [[ "${EXTRA_CMAKE_ARGS}" != *"DFIND_CUOPT_CPP"* ]]; then - EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DFIND_CUOPT_CPP=ON" +if ! contains_string "DFIND_CUOPT_CPP" "${EXTRA_CMAKE_ARGS[@]}"; then + EXTRA_CMAKE_ARGS+=("-DFIND_CUOPT_CPP=ON") fi -if [[ "${EXTRA_CMAKE_ARGS}" != *"DFIND_MPS_PARSER_CPP"* ]]; then - EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DFIND_MPS_PARSER_CPP=ON" + +if ! contains_string "DFIND_MPS_PARSER_CPP" "${EXTRA_CMAKE_ARGS[@]}"; then + EXTRA_CMAKE_ARGS+=("-DFIND_MPS_PARSER_CPP=ON") fi # If clean given, run it prior to any other steps @@ -230,14 +247,14 @@ if hasArg clean; then # The find removes all contents but leaves the dirs, the rmdir # attempts to remove the dirs but can fail safely. for bd in ${BUILD_DIRS}; do - if [ -d ${bd} ]; then - find ${bd} -mindepth 1 -delete - rmdir ${bd} || true + if [ -d "${bd}" ]; then + find "${bd}" -mindepth 1 -delete + rmdir "${bd}" || true fi done # Cleaning up python artifacts - find ${REPODIR}/python/ | grep -E "(__pycache__|\.pyc|\.pyo|\.so|\_skbuild$)" | xargs rm -rf + find "${REPODIR}"/python/ | grep -E "(__pycache__|\.pyc|\.pyo|\.so|\_skbuild$)" | xargs rm -rf fi @@ -249,7 +266,7 @@ fi if [ ${BUILD_ALL_GPU_ARCH} -eq 1 ]; then CUOPT_CMAKE_CUDA_ARCHITECTURES="RAPIDS" echo "Building for *ALL* supported GPU architectures..." -else +else if [ ${BUILD_CI_ONLY} -eq 1 ]; then if [[ ${CUDA_VERSION} == 11* ]]; then CUOPT_CMAKE_CUDA_ARCHITECTURES="70-real;80" @@ -267,12 +284,12 @@ fi ################################################################################ # Configure, build, and install libmps_parser if buildAll || hasArg libmps_parser; then - mkdir -p ${LIBMPS_PARSER_BUILD_DIR} - cd ${LIBMPS_PARSER_BUILD_DIR} + mkdir -p "${LIBMPS_PARSER_BUILD_DIR}" + cd "${LIBMPS_PARSER_BUILD_DIR}" cmake -DDEFINE_ASSERT=${DEFINE_ASSERT} \ - -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \ - ${CACHE_ARGS} \ - ${REPODIR}/cpp/libmps_parser/ + -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \ + "${CACHE_ARGS[@]}" \ + "${REPODIR}"/cpp/libmps_parser/ if hasArg -n; then cmake --build "${LIBMPS_PARSER_BUILD_DIR}" ${VERBOSE_FLAG} @@ -284,61 +301,62 @@ fi ################################################################################ # Configure, build, and install libcuopt if buildAll || hasArg libcuopt; then - mkdir -p ${LIBCUOPT_BUILD_DIR} - cd ${LIBCUOPT_BUILD_DIR} + mkdir -p "${LIBCUOPT_BUILD_DIR}" + cd "${LIBCUOPT_BUILD_DIR}" cmake -DDEFINE_ASSERT=${DEFINE_ASSERT} \ - -DDEFINE_BENCHMARK=${DEFINE_BENCHMARK} \ + -DDEFINE_BENCHMARK="${DEFINE_BENCHMARK}" \ -DDEFINE_PDLP_VERBOSE_MODE=${DEFINE_PDLP_VERBOSE_MODE} \ - -DLIBCUOPT_LOGGING_LEVEL=${LOGGING_ACTIVE_LEVEL} \ - -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \ + -DLIBCUOPT_LOGGING_LEVEL="${LOGGING_ACTIVE_LEVEL}" \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \ -DCMAKE_CUDA_ARCHITECTURES=${CUOPT_CMAKE_CUDA_ARCHITECTURES} \ -DDISABLE_DEPRECATION_WARNING=${BUILD_DISABLE_DEPRECATION_WARNING} \ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ -DFETCH_RAPIDS=${FETCH_RAPIDS} \ - ${EXTRA_CMAKE_ARGS} \ - ${REPODIR}/cpp + "${EXTRA_CMAKE_ARGS[@]}" \ + "${REPODIR}"/cpp if hasArg -n; then cmake --build "${LIBCUOPT_BUILD_DIR}" ${VERBOSE_FLAG} else - cmake --build "${LIBCUOPT_BUILD_DIR}" --target ${INSTALL_TARGET} ${VERBOSE_FLAG} -j${PARALLEL_LEVEL} + cmake --build "${LIBCUOPT_BUILD_DIR}" --target ${INSTALL_TARGET} ${VERBOSE_FLAG} -j"${PARALLEL_LEVEL}" fi fi # Build and install the cuopt Python package if buildAll || hasArg cuopt; then - cd ${REPODIR}/python/cuopt + cd "${REPODIR}"/python/cuopt - SKBUILD_CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${INSTALL_PREFIX};-DCMAKE_LIBRARY_PATH=${LIBCUOPT_BUILD_DIR};-DCMAKE_CUDA_ARCHITECTURES=${CUOPT_CMAKE_CUDA_ARCHITECTURES};${EXTRA_CMAKE_ARGS}" \ - python ${PYTHON_ARGS_FOR_INSTALL} . + # $EXTRA_CMAKE_ARGS gets concatenated into a string with [*] and then we find/replace spaces with semi-colons + SKBUILD_CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${INSTALL_PREFIX};-DCMAKE_LIBRARY_PATH=${LIBCUOPT_BUILD_DIR};-DCMAKE_CUDA_ARCHITECTURES=${CUOPT_CMAKE_CUDA_ARCHITECTURES};${EXTRA_CMAKE_ARGS[*]// /;}" \ + python "${PYTHON_ARGS_FOR_INSTALL[@]}" . fi # Build and install the cuopt MPS parser Python package if buildAll || hasArg cuopt_mps_parser; then - cd ${REPODIR}/python/cuopt/cuopt/linear_programming + cd "${REPODIR}"/python/cuopt/cuopt/linear_programming - SKBUILD_CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${INSTALL_PREFIX};-DCMAKE_LIBRARY_PATH=${LIBCUOPT_BUILD_DIR};-DCMAKE_CUDA_ARCHITECTURES=${CUOPT_CMAKE_CUDA_ARCHITECTURES};${EXTRA_CMAKE_ARGS}" \ - python ${PYTHON_ARGS_FOR_INSTALL} . + SKBUILD_CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${INSTALL_PREFIX};-DCMAKE_LIBRARY_PATH=${LIBCUOPT_BUILD_DIR};-DCMAKE_CUDA_ARCHITECTURES=${CUOPT_CMAKE_CUDA_ARCHITECTURES};${EXTRA_CMAKE_ARGS[*]// /;}" \ + python "${PYTHON_ARGS_FOR_INSTALL[@]}" . fi # Build and install the cuopt_server Python package if buildAll || hasArg cuopt_server; then - cd ${REPODIR}/python/cuopt_server - python ${PYTHON_ARGS_FOR_INSTALL} . + cd "${REPODIR}"/python/cuopt_server + python "${PYTHON_ARGS_FOR_INSTALL[@]}" . fi # Build and install the cuopt_sh_client Python package if buildAll || hasArg cuopt_sh_client; then - cd ${REPODIR}/python/cuopt_self_hosted/ - python ${PYTHON_ARGS_FOR_INSTALL} . + cd "${REPODIR}"/python/cuopt_self_hosted/ + python "${PYTHON_ARGS_FOR_INSTALL[@]}" . fi # Build the docs if buildAll || hasArg docs; then - cd ${REPODIR}/cpp/doxygen + cd "${REPODIR}"/cpp/doxygen doxygen Doxyfile - cd ${REPODIR}/docs/cuopt + cd "${REPODIR}"/docs/cuopt make clean make html fi diff --git a/datasets/get_test_data.sh b/datasets/get_test_data.sh index 7d8f0edb5..a95ef830f 100755 --- a/datasets/get_test_data.sh +++ b/datasets/get_test_data.sh @@ -1,3 +1,4 @@ +#!/bin/bash # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # @@ -86,7 +87,7 @@ ALL_DATASET_DATA="${TSP_DATASET_DATA} ${CVRP_DATASET_DATA} ${ACVRP_DATASET_DATA} NUMARGS=$# ARGS=$* function hasArg { - (( ${NUMARGS} != 0 )) && (echo " ${ARGS} " | grep -q " $1 ") + (( NUMARGS != 0 )) && (echo " ${ARGS} " | grep -q " $1 ") } if hasArg -h || hasArg --help; then @@ -111,7 +112,9 @@ else DATASET_DATA="${ALL_DATASET_DATA}" fi +# shellcheck disable=SC2207 URLS=($(echo "$DATASET_DATA"|awk '{if (NR%4 == 3) print $0}')) # extract 3rd fields to a bash array +# shellcheck disable=SC2207 DESTDIRS=($(echo "$DATASET_DATA"|awk '{if (NR%4 == 0) print $0}')) # extract 4th fields to a bash array echo Downloading ... @@ -121,7 +124,7 @@ rm -rf tmp mkdir tmp cd tmp # Loop through URLs with error handling -for url in ${URLS[*]}; do +for url in "${URLS[@]}"; do # Try up to 3 times with continue option wget -4 --tries=3 --continue --progress=dot:mega --retry-connrefused "${url}" || { echo "Failed to download: ${url}" @@ -132,10 +135,10 @@ cd .. # Setup the destination dirs, removing any existing ones first! for index in ${!DESTDIRS[*]}; do - rm -rf ${DESTDIRS[$index]} + rm -rf "${DESTDIRS[$index]}" done for index in ${!DESTDIRS[*]}; do - mkdir -p ${DESTDIRS[$index]} + mkdir -p "${DESTDIRS[$index]}" done # Iterate over the arrays and untar the nth tarfile to the nth dest directory. @@ -144,18 +147,18 @@ echo Decompressing ... set +e # Disable exit on error for the entire script for index in ${!DESTDIRS[*]}; do - tfname=$(basename ${URLS[$index]}) + tfname=$(basename "${URLS[$index]}") - if file --mime-type "tmp/${tfname}" | grep -q gzip$; then - tar xvzf tmp/${tfname} -C ${DESTDIRS[$index]} || true - elif file --mime-type "tmp/${tfname}" | grep -q zip$; then - unzip tmp/${tfname} -d ${DESTDIRS[$index]} || true + if file --mime-type "tmp/${tfname}" | grep -q gzip$; then + tar xvzf tmp/"${tfname}" -C "${DESTDIRS[$index]}" || true + elif file --mime-type "tmp/${tfname}" | grep -q zip$; then + unzip tmp/"${tfname}" -d "${DESTDIRS[$index]}" || true else - tar xvf tmp/${tfname} -C ${DESTDIRS[$index]} || true + tar xvf tmp/"${tfname}" -C "${DESTDIRS[$index]}" || true fi - if ls ${DESTDIRS[$index]}/*.gz >/dev/null 2>&1; then - gzip -d ${DESTDIRS[$index]}/* || true + if ls "${DESTDIRS[$index]}"/*.gz >/dev/null 2>&1; then + gzip -d "${DESTDIRS[$index]}"/* || true fi done diff --git a/datasets/linear_programming/download_pdlp_test_dataset.sh b/datasets/linear_programming/download_pdlp_test_dataset.sh index 0580298b1..1c4f47b5a 100755 --- a/datasets/linear_programming/download_pdlp_test_dataset.sh +++ b/datasets/linear_programming/download_pdlp_test_dataset.sh @@ -1,3 +1,4 @@ +#!/bin/bash # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # @@ -13,10 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash - - - set -euo pipefail # 10 easiest Mittleman instances diff --git a/datasets/mip/download_miplib_test_dataset.sh b/datasets/mip/download_miplib_test_dataset.sh index 3aafc9d9c..d0eb0d2b9 100755 --- a/datasets/mip/download_miplib_test_dataset.sh +++ b/datasets/mip/download_miplib_test_dataset.sh @@ -1,3 +1,4 @@ +#!/bin/bash # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # @@ -13,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash - INSTANCES=( "50v-10" "fiball" @@ -45,9 +44,8 @@ for INSTANCE in "${INSTANCES[@]}"; do OUTFILE="${BASEDIR}/${INSTANCE}.mps.gz" wget -4 --tries=3 --continue --progress=dot:mega --retry-connrefused "${URL}" -O "${OUTFILE}" || { - echo "Failed to download: ${url}" + echo "Failed to download: ${URL}" continue } gunzip -f "${OUTFILE}" done - diff --git a/datasets/mip/presolve_instance.sh b/datasets/mip/presolve_instance.sh index a0a6604e2..c679b173f 100755 --- a/datasets/mip/presolve_instance.sh +++ b/datasets/mip/presolve_instance.sh @@ -1,3 +1,4 @@ +#!/bin/bash # SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # @@ -26,7 +27,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash for file in miplib2017/* do /home/scratch.acoerduek_sw/papilo/build/bin/papilo presolve -f $file -r reduced_$file diff --git a/print_env.sh b/print_env.sh index 0bfccbcba..b211542d8 100644 --- a/print_env.sh +++ b/print_env.sh @@ -1,3 +1,4 @@ +#!/bin/bash # SPDX-FileCopyrightText: Copyright (c) 2020-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # @@ -12,9 +13,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -#!/usr/bin/env bash -# Copyright (c) 2020-2025, NVIDIA CORPORATION. +# # Reports relevant environment information useful for diagnosing and # debugging cuOpt issues. # Usage: @@ -100,4 +99,4 @@ echo " " print_env | while read -r line; do echo " $line" done -echo "" \ No newline at end of file +echo "" diff --git a/python/libcuopt/libcuopt/tests/test_cli.sh b/python/libcuopt/libcuopt/tests/test_cli.sh index 6b217e123..49ccd48ce 100644 --- a/python/libcuopt/libcuopt/tests/test_cli.sh +++ b/python/libcuopt/libcuopt/tests/test_cli.sh @@ -18,7 +18,8 @@ set -euo pipefail # Add cuopt_cli path to PATh variable -export PATH="$(pyenv root)/versions/$(pyenv version-name)/bin:$PATH" +PATH="$(pyenv root)/versions/$(pyenv version-name)/bin:$PATH" +export PATH # Test the CLI @@ -30,8 +31,8 @@ cuopt_cli --help | grep -q "Usage: cuopt_cli" || (echo "Expected usage informati # Run solver and check for optimal status - fail if not found -cuopt_cli ${RAPIDS_DATASET_ROOT_DIR}/linear_programming/good-mps-1.mps | grep -q "Status: " || (echo "Expected solution not found" && exit 1) +cuopt_cli "${RAPIDS_DATASET_ROOT_DIR}"/linear_programming/good-mps-1.mps | grep -q "Status: " || (echo "Expected solution not found" && exit 1) # Add a for mixed integer programming test with options -cuopt_cli ${RAPIDS_DATASET_ROOT_DIR}/mip/sample.mps --mip-absolute-gap 0.01 --time-limit 10 | grep -q "Solution objective" || (echo "Expected solution objective not found" && exit 1) +cuopt_cli "${RAPIDS_DATASET_ROOT_DIR}"/mip/sample.mps --mip-absolute-gap 0.01 --time-limit 10 | grep -q "Solution objective" || (echo "Expected solution objective not found" && exit 1)