Skip to content

Commit

Permalink
IOSS: Use Catch2 again intead of doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
gsjaardema committed Mar 11, 2024
1 parent 541f6de commit 5d3003a
Show file tree
Hide file tree
Showing 14 changed files with 415 additions and 7,992 deletions.
32 changes: 32 additions & 0 deletions TPL/catch2/runcmake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#! /usr/bin/env bash
EXTRA_ARGS=$@

### The following assumes you are building in a subdirectory of ACCESS Root
if [ "X$ACCESS" == "X" ] ; then
ACCESS=$(cd ../../../..; pwd)
echo "ACCESS set to ${ACCESS}"
fi
INSTALL_PATH=${INSTALL_PATH:-${ACCESS}}

SHARED="${SHARED:-YES}"

. ${ACCESS}/TPL/compiler.sh

CFLAGS="-I${INSTALL_PATH}/include"; export CFLAGS
CPPFLAGS="-DNDEBUG"; export CPPFLAGS

rm -f CMakeCache.txt

cmake \
${RPATH} \
-D CMAKE_PREFIX_PATH:PATH=${INSTALL_PATH}/lib \
-D CMAKE_INSTALL_PREFIX:PATH=${INSTALL_PATH} \
-D CMAKE_INSTALL_LIBDIR:PATH=lib \
$EXTRA_ARGS \
..

echo ""
echo " COMPILER: ${CC}"
echo " ACCESS: ${ACCESS}"
echo "INSTALL_PATH: ${INSTALL_PATH}"
echo ""
41 changes: 21 additions & 20 deletions TPLsList.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,27 @@
#

SET( Seacas_TPLS_FINDMODS_CLASSIFICATIONS
X11 "cmake/TPLs/" ST
DLlib "cmake/TPLs/" ST
fmt "cmake/TPLs/" ST
GTest "cmake/TPLs/" PT
Zlib "cmake/TPLs/" ST
Pthread "cmake/TPLs/" PT
MPI "${${PROJECT_NAME}_TRIBITS_DIR}/core/std_tpls/" PT
HDF5 "${${PROJECT_NAME}_TRIBITS_DIR}/common_tpls/" ST
Pnetcdf "${${PROJECT_NAME}_TRIBITS_DIR}/common_tpls/" ST
Netcdf "${${PROJECT_NAME}_TRIBITS_DIR}/common_tpls/" ST
CGNS "${${PROJECT_NAME}_TRIBITS_DIR}/common_tpls/" ST
DataWarp "cmake/TPLs/" ST
METIS "cmake/TPLs/" TT
ParMETIS "cmake/TPLs/" ST
Pamgen "cmake/TPLs/" ST
Matio "cmake/TPLs/" ST
CUDA "cmake/TPLs/" ST
Kokkos "${${PROJECT_NAME}_TRIBITS_DIR}/common_tpls/" ST
Faodel "${PROJECT_SOURCE_DIR}/packages/seacas/cmake/tpls/" ST
Cereal "${PROJECT_SOURCE_DIR}/packages/seacas/cmake/tpls/" ST
X11 "cmake/TPLs/" SS
DLlib "cmake/TPLs/" SS
fmt "cmake/TPLs/" PS
Catch2 "cmake/TPLs/" SS
GTest "cmake/TPLs/" SS
Zlib "cmake/TPLs/" SS
Pthread "cmake/TPLs/" PS
MPI "${${PROJECT_NAME}_TRIBITS_DIR}/core/std_tpls/" PS
HDF5 "${${PROJECT_NAME}_TRIBITS_DIR}/common_tpls/" SS
Pnetcdf "${${PROJECT_NAME}_TRIBITS_DIR}/common_tpls/" SS
Netcdf "${${PROJECT_NAME}_TRIBITS_DIR}/common_tpls/" PS
CGNS "${${PROJECT_NAME}_TRIBITS_DIR}/common_tpls/" PS
DataWarp "cmake/TPLs/" SS
METIS "cmake/TPLs/" SS
ParMETIS "cmake/TPLs/" SS
Pamgen "cmake/TPLs/" SS
Matio "cmake/TPLs/" SS
CUDA "cmake/TPLs/" SS
Kokkos "${${PROJECT_NAME}_TRIBITS_DIR}/common_tpls/" SS
Faodel "${PROJECT_SOURCE_DIR}/packages/seacas/cmake/tpls/" SS
Cereal "${PROJECT_SOURCE_DIR}/packages/seacas/cmake/tpls/" SS
ADIOS2 "${PROJECT_SOURCE_DIR}/packages/seacas/cmake/tpls/FindTPLADIOS2.cmake" EX
Catalyst2 "${PROJECT_SOURCE_DIR}/packages/seacas/cmake/tpls/FindTPLCatalyst2.cmake" EX
# TPLs defined in Zoltan/cmake/Dependencies.cmake that are never enabled
Expand Down
4 changes: 4 additions & 0 deletions cmake-config
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ FAODEL_PATH=${FAODEL_PATH:-${INSTALL_PATH}}
ADIOS2_PATH=${ADIOS2_PATH:-${INSTALL_PATH}}
CATALYST2_PATH=${CATALYST2_PATH:-${INSTALL_PATH}}
GTEST_PATH=${GTEST_PATH:-${INSTALL_PATH}}
CATCH2_PATH=${CATCH2_PATH:-${INSTALL_PATH}}
KOKKOS_PATH=${KOKKOS_PATH:-${INSTALL_PATH}}
METIS_PATH=${METIS_PATH:-${INSTALL_PATH}}
PARMETIS_PATH=${PARMETIS_PATH:-${INSTALL_PATH}}
Expand Down Expand Up @@ -331,6 +332,7 @@ HAVE_FAODEL=$(check_enable "${FAODEL_PATH}/include/faodel/faodelConfig.h")
HAVE_ADIOS2=$(check_enable "${ADIOS2_PATH}/include/adios2.h")
HAVE_CATALYST2=$(check_enable "${CATALYST2_PATH}/include/catalyst-2.0/catalyst.h")
HAVE_GTEST=$(check_enable "${GTEST_PATH}/include/gtest/gtest.h")
HAVE_CATCH2=$(check_enable "${CATCH2_PATH}/include/catch2/catch_all.hpp")
HAVE_KOKKOS=$(check_enable "${KOKKOS_PATH}/include/Kokkos_Core.hpp")
HAVE_METIS=$(check_enable "${METIS_PATH}/include/metis.h")
HAVE_PARMETIS=$(check_enable "${METIS_PATH}/include/parmetis.h")
Expand Down Expand Up @@ -511,6 +513,7 @@ ${MODERN_ARG} \
-D TPL_ENABLE_ADIOS2:BOOL=${HAVE_ADIOS2} \
-D TPL_ENABLE_Catalyst2:BOOL=${HAVE_CATALYST2} \
-D TPL_ENABLE_GTest:BOOL=${HAVE_GTEST} \
-D TPL_ENABLE_Catch2:BOOL=${HAVE_CATCH2} \
-D TPL_ENABLE_Kokkos:BOOL=${HAVE_KOKKOS} \
-D TPL_ENABLE_METIS:BOOL=${HAVE_METIS} \
-D TPL_ENABLE_ParMETIS:BOOL=${HAVE_PARMETIS} \
Expand Down Expand Up @@ -571,6 +574,7 @@ echo " METIS: ${HAVE_METIS}"
echo " PARMETIS: ${HAVE_PARMETIS}"
echo " FAODEL: ${HAVE_FAODEL}"
echo " GTEST: ${HAVE_GTEST}"
echo " CATCH2: ${HAVE_CATCH2}"
echo " DOXYGEN: ${DOXYGEN}"
echo ""

Expand Down
46 changes: 46 additions & 0 deletions install-tpl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ CATALYST2=$(check_valid CATALYST2)
GTEST=${GTEST:-${FAODEL}}
GTEST=$(check_valid GTEST)

CATCH2=${CATCH2:-YES}
CATCH2=$(check_valid CATCH2)


SUDO=${SUDO:-}
JOBS=${JOBS:-2}
Expand Down Expand Up @@ -219,6 +222,7 @@ if [ $# -gt 0 ]; then
echo " FAODEL = ${FAODEL}"
echo " ADIOS2 = ${ADIOS2}"
echo " CATALYST2 = ${CATALYST2}"
echo " CATCH2 = ${CATCH2}"
echo " GTEST = ${GTEST}"
echo ""
echo " SUDO = ${SUDO} (empty unless need superuser permission via 'sudo')"
Expand Down Expand Up @@ -976,6 +980,48 @@ then
fi
fi

# =================== INSTALL catch2 ===============
if [ "$CATCH2" == "YES" ]
then
if [ "$FORCE" == "YES" ] || ! [ -e $INSTALL_PATH/lib/libcatch.a ]
then
echo "${txtgrn}+++ gtest${txtrst}"
cd $ACCESS || exit
cd TPL/catch2 || exit
if [ "$DOWNLOAD" == "YES" ]
then
echo "${txtgrn}+++ Downloading...${txtrst}"
rm -rf Catch2
git clone https://github.com/catchorg/Catch2.git
fi

if [ "$BUILD" == "YES" ]
then
echo "${txtgrn}+++ Configuring, Building, and Installing...${txtrst}"
cd Catch2 || exit
git checkout v3.5.3
rm -rf build
mkdir build
cd build || exit
CRAY=${CRAY} SHARED=${SHARED} DEBUG=${DEBUG} bash -x ../../runcmake.sh
if [[ $? != 0 ]]
then
echo 1>&2 ${txtred}couldn\'t configure cmake for Catch2. exiting.${txtrst}
exit 1
fi

make -j${JOBS} && ${SUDO} make "VERBOSE=${VERBOSE}" install
if [[ $? != 0 ]]
then
echo 1>&2 ${txtred}couldn\'t build Catch2. exiting.${txtrst}
exit 1
fi
fi
else
echo "${txtylw}+++ Catch2 already installed. Skipping download and installation.${txtrst}"
fi
fi

# =================== INSTALL PARALLEL ===============
if [ "$GNU_PARALLEL" == "YES" ]
then
Expand Down
4 changes: 2 additions & 2 deletions packages/seacas/libraries/ioss/cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
if(CMAKE_PROJECT_NAME STREQUAL "Trilinos")
TRIBITS_PACKAGE_DEFINE_DEPENDENCIES(
LIB_OPTIONAL_PACKAGES SEACASExodus Pamgen Zoltan Kokkos
LIB_OPTIONAL_TPLS HDF5 CGNS ParMETIS Faodel Cereal DLlib Pthread DataWarp ADIOS2 Catalyst2 ${SEACAS_GTest_TPL_name}
LIB_OPTIONAL_TPLS HDF5 CGNS ParMETIS Faodel Cereal DLlib Pthread DataWarp ADIOS2 Catalyst2 ${SEACAS_GTest_TPL_name} Catch2
)
else()
TRIBITS_PACKAGE_DEFINE_DEPENDENCIES(
LIB_REQUIRED_TPLS fmt
LIB_OPTIONAL_PACKAGES SEACASExodus Zoltan
LIB_OPTIONAL_TPLS HDF5 Pamgen CGNS ParMETIS Faodel Cereal DLlib Pthread ADIOS2 Catalyst2 ${SEACAS_GTest_TPL_name} Kokkos DataWarp
LIB_OPTIONAL_TPLS HDF5 Pamgen CGNS ParMETIS Faodel Cereal DLlib Pthread ADIOS2 Catalyst2 ${SEACAS_GTest_TPL_name} Kokkos DataWarp Catch2
)
endif()

Expand Down
Loading

0 comments on commit 5d3003a

Please sign in to comment.