Skip to content

Commit

Permalink
Add test options to compile.sh and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ckendrick committed Aug 16, 2024
1 parent e957c71 commit ed70652
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ if((CMAKE_BUILD_TYPE STREQUAL "Debug") OR
set(DEBUG_CHECK_ASSERTIONS "1")
set(LIBROM_FLAGS "${LIBROM_FLAGS} -Wall")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBROM_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LIBROM_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT} ${LIBROM_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT} ${LIBROM_FLAGS}" CACHE STRING "" FORCE)

if (CMAKE_HOST_APPLE)
# Fix linker flags for OSX to use classic linker on XCode 15.0+:
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ Compilation options:

- -a: Compile a special build for the LLNL codebase: Ardra
- -d: Compile in debug mode.
- -f: Specify additional compiler flags
- -m: Compile with MFEM (required to run the libROM examples)
- -g: Compile MFEM with GSLib (requires -m)
- -r: Compile unit tests (requires Googletest)
- -s: Compile and use a local SCALAPACK
- -t: Use your own cmake/toolchain
- -u: Update all of libROM's dependencies.

Expand Down Expand Up @@ -92,7 +96,9 @@ Docker container [`librom_env`](https://ghcr.io/llnl/librom/librom_env) provides

# libROM CI

libROM leverages GitHub Actions for CI. The CI currently applies only to commits to pull requests. Unit tests run for all PR commits. Upon the addition of the `LGTM` label, both the unit tests and regression tests run. While the `LGTM` label is still present, all subsequent commits run both unit tests and regression tests.
libROM leverages GitHub Actions for CI. The CI currently applies only to commits to pull requests. Unit tests run for all PR commits. Upon the addition of the `LGTM` label, both the unit tests and regression tests run. While the `LGTM` label is still present, all subsequent commits run both unit tests and regression tests.

To compile and run unit tests locally, build using the `-r` option to `compile.sh` or with `-DENABLE_TESTS=ON`. Building the unit tests will require Googletest to be installed. Unit tests can be run using `ctest` from the root build directory.

# License

Expand Down
18 changes: 15 additions & 3 deletions scripts/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ UPDATE_LIBS=false
INSTALL_SCALAPACK=false
MFEM_USE_GSLIB="Off"
MFEM_USE_LAPACK="Off"
ENABLE_TESTS="Off"
LIBROM_FLAGS=""

cleanup_dependencies() {
pushd .
Expand All @@ -46,7 +48,7 @@ cleanup_dependencies() {


# Get options
while getopts "ah:dh:gh:lh:mh:t:uh:sh" o;
while getopts "ah:dh:gh:lh:mh:t:uh:sh:rh:f:" o;
do
case "${o}" in
a)
Expand All @@ -73,6 +75,12 @@ do
s)
INSTALL_SCALAPACK=true
;;
r)
ENABLE_TESTS="On"
;;
f)
LIBROM_FLAGS=${OPTARG}
;;
*)
echo "Unknown option."
exit 1
Expand Down Expand Up @@ -152,7 +160,9 @@ if [ "$(uname)" == "Darwin" ]; then
cmake ${REPO_PREFIX} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DUSE_MFEM=${USE_MFEM} \
-DMFEM_USE_GSLIB=${MFEM_USE_GSLIB}
-DMFEM_USE_GSLIB=${MFEM_USE_GSLIB} \
-DENABLE_TESTS=${ENABLE_TESTS} \
-DLIBROM_FLAGS="${LIBROM_FLAGS}"
check_result $? librom-config
make
check_result $? librom-build
Expand All @@ -166,7 +176,9 @@ elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DUSE_MFEM=${USE_MFEM} \
-DMFEM_USE_GSLIB=${MFEM_USE_GSLIB}
-DMFEM_USE_GSLIB=${MFEM_USE_GSLIB} \
-DENABLE_TESTS=${ENABLE_TESTS} \
-DLIBROM_FLAGS="${LIBROM_FLAGS}"
check_result $? librom-config
make -j8
check_result $? librom-build
Expand Down

0 comments on commit ed70652

Please sign in to comment.