Skip to content

Commit

Permalink
Merge pull request #13617 from rmcdermo/master
Browse files Browse the repository at this point in the history
Build: add --clean-hypre option to make_fds.sh
  • Loading branch information
rmcdermo authored Oct 23, 2024
2 parents 636bd02 + 2370cf9 commit 7167ff2
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 3 deletions.
7 changes: 7 additions & 0 deletions Build/Scripts/HYPRE/build_hypre.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
#!/bin/bash
CONFMAKE=$1
CLEAN_HYPRE=$2

dir=`pwd`

echo "CLEAN_HYPRE = $CLEAN_HYPRE"
if [ "$CLEAN_HYPRE" = true ]; then
echo "Removing hypre library ..."
rm -r $FIREMODELS/libs/hypre
fi

echo "Checking for hypre library..."

if [ -d "$FIREMODELS/libs/hypre" ]; then
Expand Down
64 changes: 61 additions & 3 deletions Build/impi_intel_linux_db/make_fds.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,74 @@
#!/bin/bash
ARG=$1

# PARSE OPTIONS FOR CLEAN LIBRARY BUILDS ####################################

# Parse the long options first using getopt
OPTIONS=$(getopt -o "" --long clean-hypre,clean-sundials -- "$@")

# Check if getopt parsed successfully
if [ $? -ne 0 ]; then
echo "Error parsing options."
exit 1
fi

# Evaluate the parsed options
eval set -- "$OPTIONS"

# Initialize variables for options
clean_hypre=false
clean_sundials=false
ARG=""

# Loop through the options
while true; do
case "$1" in
--clean-hypre)
clean_hypre=true # Set the flag to true when --clean-hypre is used
shift
;;
--clean-sundials)
clean_sundials=true
shift
;;
--)
shift
break
;;
*)
echo "Invalid option."
exit 1
;;
esac
done

# After all options are processed, check for any remaining positional argument (ARG)
if [ -n "$1" ]; then
ARG=$1
fi

# Use ARG and the options
#echo "ARG is: $ARG"

if [ "$clean_hypre" = true ]; then
echo "Option --clean-hypre is set."
fi

if [ "$clean_sundials" = true ]; then
echo "Option --clean-sundials is set."
fi

# FINISHED WITH CLEANING OPTIONS ###########################################

source ../Scripts/set_intel_compiler.sh $ARG

dir=`pwd`
target=${dir##*/}

# build hypre
source ../Scripts/HYPRE/build_hypre.sh confmake_impi_intel_linux.sh
source ../Scripts/HYPRE/build_hypre.sh confmake_impi_intel_linux.sh $clean_hypre

## build sundials
#source ../Scripts/SUNDIALS/build_sundials.sh
#source ../Scripts/SUNDIALS/build_sundials.sh $arg-1 $arg-2 ... $clean_sundials

# build fds
echo Building $target with Intel MPI and $INTEL_IFORT
Expand Down

0 comments on commit 7167ff2

Please sign in to comment.