Skip to content

Commit

Permalink
update build script build.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
cheny16 committed Oct 6, 2024
1 parent 72556f6 commit c750e01
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,17 @@ if [ -z "$NETCDF" ]; then
fi

# Name of makefile
MAKE=gfortran.makefile
if [ "$1" = "--target" ]; then
if [ "$2" = "intel" ]; then
MAKE=intel.makefile
fi
if [ "$2" = "intelomp" ]; then
MAKE=intel_omp.makefile
fi
if [ "$2" = "general" ]; then
MAKE=gfortran.makefile
fi
fi

# Define directory names
ROOT=`pwd`
Expand All @@ -27,10 +37,6 @@ cp $SRC/$MAKE .
# Compile SPEEDY and delete source files
make -f $MAKE -s clean
echo 'Compiling SPEEDY'
if [ "$1" = "--profile" ]; then
make -f $MAKE -s profile || { echo "Compilation failed"; exit 1; }
else
make -f $MAKE -s || { echo "Compilation failed"; exit 1; }
fi

make -f $MAKE -s && { echo "Compilation successful"; } || { echo "Compilation failed"; exit 1; }
rm *.f90 *.o $MAKE *.mod

0 comments on commit c750e01

Please sign in to comment.