Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: check for hypre library and skip building if it exists #13616

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion Build/Scripts/HYPRE/build_hypre.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,37 @@
#!/bin/bash
CONFMAKE=$1

echo "Checking for hypre repository..."
dir=`pwd`

echo "Checking for hypre library..."

if [ -d "$FIREMODELS/libs/hypre" ]; then
echo "Hypre library exists. Skipping hypre build."
# List all directories under $FIREMODELS/libs/hypre
hypre_lib_dir=$(ls -d $FIREMODELS/libs/hypre/*/)
# Extract the version part (removes the leading path)
HYPRE_VERSION=$(basename $hypre_lib_dir)
export HYPRE_HOME=$FIREMODELS/libs/hypre/$HYPRE_VERSION
echo "Hypre library:" $FIREMODELS/libs/hypre/$HYPRE_VERSION
return 0
else
echo "Hypre library does not exist."
fi

echo "Checking for hypre repository..."

if [ -d "$FIREMODELS/hypre" ]; then
echo "Hypre repository exists. Building hypre library."
cd $FIREMODELS/hypre/src
export HYPRE_VERSION=$(git describe)
echo "Cleaning hypre repository..."
make distclean
cp $FIREMODELS/fds/Build/Scripts/HYPRE/$CONFMAKE .
./$CONFMAKE
cd $dir
export HYPRE_HOME=$FIREMODELS/libs/hypre/$HYPRE_VERSION
echo "Hypre library:" $FIREMODELS/libs/hypre/$HYPRE_VERSION
return 0
else
echo "Hypre repository does not exist."
fi