Skip to content
Closed
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion Build/Scripts/HYPRE/build_hypre.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ if [ -d "$FIREMODELS/hypre" ]; then
echo "Checking out v2.32.0"
$(git checkout v2.32.0)
fi
cd $FIREMODELS/hypre/src
cd $FIREMODELS/hypre/src/cmbuild
rm -r $FIREMODELS/hypre/src/cmbuild/*
export HYPRE_VERSION=$(git describe)
echo "Cleaning hypre repository..."
make distclean
Expand Down
19 changes: 19 additions & 0 deletions Build/Scripts/HYPRE/confmake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export HYPRE_INSTALL_PREFIX=$FIREMODELS/libs/hypre/$HYPRE_VERSION

if [[ "$FDS_BUILD_TARGET" == *"intel"* ]]; then
C_FLAGS="-O3 -fno-unsafe-math-optimizations -fp-model=precise"
else
C_FLAGS="-O3"
fi

cmake ../ \
-DCMAKE_INSTALL_PREFIX=$HYPRE_INSTALL_PREFIX \
-DCMAKE_C_COMPILER=$CC \
-DCMAKE_C_FLAGS=$C_FLAGS \
-DCMAKE_INSTALL_LIBDIR="lib"
#-DCMAKE_OSX_DEPLOYMENT_TARGET="14.0"

# ./configure CC=$CC FC=mpiifort CFLAGS="-O3 -fno-unsafe-math-optimizations -fp-model=precise" FFLAGS="-O3 -fno-unsafe-math-optimizations -fp-model=precise" \
# --prefix=$FIREMODELS/libs/hypre/$HYPRE_VERSION

make install
13 changes: 0 additions & 13 deletions Build/Scripts/HYPRE/confmake_impi_intel_linux.sh

This file was deleted.

16 changes: 16 additions & 0 deletions Build/Scripts/SUNDIALS/confmake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export SUNDIALS_INSTALL_PREFIX=$FIREMODELS/libs/sundials/$SUNDIALS_VERSION

cmake ../ \
-DCMAKE_INSTALL_PREFIX=$SUNDIALS_INSTALL_PREFIX \
-DEXAMPLES_INSTALL_PATH=$SUNDIALS_INSTALL_PREFIX/examples \
-DCMAKE_C_COMPILER=$CC \
-DCMAKE_CXX_COMPILER=$CXX \
-DCMAKE_Fortran_COMPILER=$FC \
-DBUILD_FORTRAN_MODULE_INTERFACE=ON \
-DEXAMPLES_ENABLE_CXX=OFF \
-DEXAMPLES_ENABLE_CUDA=OFF \
-DEXAMPLES_ENABLE_F2003=OFF \
-DENABLE_OPENMP=OFF \
-DCMAKE_INSTALL_LIBDIR="lib"

make install
35 changes: 0 additions & 35 deletions Build/Scripts/SUNDIALS/confmake_impi_intel_linux.sh

This file was deleted.

72 changes: 72 additions & 0 deletions Build/Scripts/build_thirdparty_libs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 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 [[ $# -gt 0 ]]; 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

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 ###########################################

# Decide compilers
echo "Before setting tpt comp"
source ../Scripts/set_thirdparty_compilers.sh

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

## build sundials
source ../Scripts/SUNDIALS/build_sundials.sh confmake.sh $clean_sundials


# Use ARG and the options
#echo "ARG is: $ARG"
if [ "$SOURCE_INTEL_IFORT" -eq 1 ]; then
source ../Scripts/set_intel_compiler.sh $ARG
fi
150 changes: 150 additions & 0 deletions Build/Scripts/set_thirdparty_compilers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
echo "FDS build target = $FDS_BUILD_TARGET"

# For following variables 1- indicate availble through
# environment variable CCCOMP, CXXCOMP, and FCCOMP
set_CC=0
set_CXX=0
set_FC=0

if [ -n "$CCCOMP" ]; then
CC=$CCCOMP
set_CC=1
fi

if [ -n "$CXXCOMP" ]; then
CXX=$CXXCOMP
set_CXX=1
fi

if [ -n "$FCCOMP" ]; then
FC=$FCCOMP
set_FC=1
fi

if [[ "$FDS_BUILD_TARGET" == *"intel"* ]]; then
# Check for Intel C compiler
if [ $set_CC -eq 0 ]; then
if command -v mpiicx &> /dev/null; then
CC=mpiicx
elif command -v icx &> /dev/null; then
CC=icx
elif command -v mpiicc &> /dev/null; then
CC=mpiicc
elif command -v icc &> /dev/null; then
CC=icc
else
echo "Error: Any of mpiicx, icx, mpiicc, or icc is not available on this system."
exit 1
fi
fi

# Check for Intel C++ compiler
if [ $set_CXX -eq 0 ]; then
if command -v mpiicpx &> /dev/null; then
CXX=mpiicpx
elif command -v icpx &> /dev/null; then
CXX=icpx
elif command -v mpiicpc &> /dev/null; then
CXX=mpiicpc
elif command -v icpc &> /dev/null; then
CXX=icpc
else
echo "Error: Any of mpiicpx, icpx, mpiicpc, or icpc is not available on this system."
exit 1
fi
fi

# Check for Intel Fortran compiler (ifort). ifx will be added in future.
if [ $set_FC -eq 0 ]; then
if command -v mpiifort &> /dev/null; then
FC=mpiifort
elif command -v ifort &> /dev/null; then
FC=ifort
else
echo "Error: Any of mpiifort, or ifort is not available on this system."
exit 1
fi
fi
elif [[ "$FDS_BUILD_TARGET" == *"osx"* ]]; then
# Check for C compiler (mpicc, gcc, clang)
if [ $set_CC -eq 0 ]; then
if command -v mpicc &> /dev/null; then
CC=mpicc
elif command -v gcc &> /dev/null; then
CC=gcc
elif command -v clang &> /dev/null; then
CC=clang
else
echo "Error: Any of mpicc, gcc, or clang is not available on this system."
exit 1
fi
fi

# Check for clang C++ compiler (mpicxx, g++, clang ++)
if [ $set_CXX -eq 0 ]; then
if command -v mpicxx &> /dev/null; then
CXX=mpicxx
elif command -v g++ &> /dev/null; then
CXX=g++
elif command -v clang++ &> /dev/null; then
CXX=clang++
else
echo "Error: Any of mpicxx, g++, or clang++ is not available on this system."
exit 1
fi
fi

# Check for Fortran compiler (gfortran)
if [ $set_FC -eq 0 ]; then
if command -v mpifort &> /dev/null; then
FC=mpifort
elif command -v gfortran &> /dev/null; then
FC=gfortran
else
echo "Error: gfortran is not available on this system."
exit 1
fi
fi
else #gnu
# Check for gnu C compiler (gcc)
if [ $set_CC -eq 0 ]; then
if command -v mpicc &> /dev/null; then
CC=mpicc
elif command -v gcc &> /dev/null; then
CC=gcc
else
echo "Error: Any of mpicc, gcc is not available on this system."
exit 1
fi
fi

# Check for Intel C++ compiler (g++)
if [ $set_CXX -eq 0 ]; then
if command -v mpicxx &> /dev/null; then
CXX=mpicxx
elif command -v g++ &> /dev/null; then
CXX=g++
else
echo "Error: Any of mpicxx, g++ is not available on this system."
exit 1
fi
fi

# Check for Fortran compiler (gfortran)
if [ $set_FC -eq 0 ]; then
if command -v gfortran &> /dev/null; then
FC=gfortran
else
echo "Error: gfortran is not available on this system."
exit 1
fi
fi
fi

echo "C Compiler CC=$CC"
echo "C++ compiler CXX=$CXX"
echo "Fortran compiler FC=$FC"

export CC=$CC
export CXX=$CXX
export FC=$FC
69 changes: 4 additions & 65 deletions Build/impi_intel_linux_db/make_fds.sh
Original file line number Diff line number Diff line change
@@ -1,74 +1,13 @@
#!/bin/bash

# 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 $clean_hypre
# Compile third-party libraries.
export FDS_BUILD_TARGET=$target
export SOURCE_INTEL_IFORT=1
source ../Scripts/build_thirdparty_libs.sh "$@"

## build sundials
source ../Scripts/SUNDIALS/build_sundials.sh confmake_impi_intel_linux.sh $clean_sundials

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