hypre/AUTOTEST/make.sh

56 lines
1.0 KiB
Bash
Raw Normal View History

#!/bin/bash
# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other
2019-07-08 10:26:24 +08:00
# HYPRE Project Developers. See the top-level COPYRIGHT file for details.
#
2019-07-08 10:26:24 +08:00
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
testname=`basename $0 .sh`
# Echo usage information
case $1 in
-h|-help)
2007-12-01 07:24:44 +08:00
cat <<EOF
2007-11-22 08:44:34 +08:00
$0 [-h] {src_dir} [options for make]
2020-05-16 23:30:29 +08:00
where: {src_dir} is the hypre source directory
-spack <dir> compile and link drivers to spack build
-h|-help prints this usage information and exits
This script runs make clean; make [options] in {src_dir}.
Example usage: $0 ../src test
EOF
2007-12-01 07:24:44 +08:00
exit
;;
esac
# Setup
src_dir=`cd $1; pwd`
shift
2020-05-16 23:30:29 +08:00
# Parse the rest of the command line
mopts=""
2020-05-16 23:30:29 +08:00
while [ "$*" ]
do
case $1 in
-spack)
shift; spackdir="$1"; shift
;;
*)
mopts="$mopts $1"; shift
;;
2020-05-16 23:30:29 +08:00
esac
done
2007-11-22 08:44:34 +08:00
# Run make
cd $src_dir
make clean
2020-05-16 23:30:29 +08:00
if [ -n "$spackdir" ]; then
cd $src_dir/test
make HYPRE_BUILD_DIR="$spackdir" $mopts
2020-05-16 23:30:29 +08:00
else
make $mopts
2020-05-16 23:30:29 +08:00
fi