Skip to content

Commit

Permalink
more work on cmake build
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardhartnett committed Aug 26, 2020
1 parent 6eb1b7a commit c0466f9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/a3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ jobs:
export CC=mpicc
mkdir build
cd build
cmake -Wno-dev -DMPIEXEC='mpiexec --oversubscribe' -DNetCDF_C_LIBRARY=/home/runner/netcdf-c/lib/libnetcdf.so -DNetCDF_C_INCLUDE_DIR=/home/runner/netcdf-c/include -DPnetCDF_PATH='/home/runner/pnetcdf' -DPIO_ENABLE_FORTRAN=Off -DPIO_HDF5_LOGGING=On -DPIO_USE_MALLOC=On -DPIO_ENABLE_LOGGING=On -DPIO_ENABLE_TIMING=Off .. || (cat CMakeFiles/CMakeOutput.log && cat CMakeFiles/CMakeError.log)
cmake -Wno-dev -DWITH_MPIEXEC='mpiexec --oversubscribe' -DNetCDF_C_LIBRARY=/home/runner/netcdf-c/lib/libnetcdf.so -DNetCDF_C_INCLUDE_DIR=/home/runner/netcdf-c/include -DPnetCDF_PATH='/home/runner/pnetcdf' -DPIO_ENABLE_FORTRAN=Off -DPIO_HDF5_LOGGING=On -DPIO_USE_MALLOC=On -DPIO_ENABLE_LOGGING=On -DPIO_ENABLE_TIMING=Off .. || (cat CMakeFiles/CMakeOutput.log && cat CMakeFiles/CMakeError.log)
ls -l tests/cunit
cat tests/cunit/run_tests.sh
make VERBOSE=1
Expand Down
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ set(PIO_VERSION_PATCH ${VERSION_PATCH})
# This is needed for the libpio.settings file.
SET(PACKAGE_VERSION ${PIO_VERSION_MAJOR}.${PIO_VERSION_MINOR}.${PIO_VERSION_PATCH})

# This provides cmake_print_variables() function for debugging.
include(CMakePrintHelpers)

# Determine the configure date.
IF(DEFINED ENV{SOURCE_DATE_EPOCH})
EXECUTE_PROCESS(
Expand Down Expand Up @@ -444,8 +447,9 @@ configure_file (
)

# Configure test scripts.
if (NOT MPIEXEC)
set(MPIEXEC mpiexec)
cmake_print_variables(WITH_MPIEXEC)
if (NOT WITH_MPIEXEC)
set(WITH_MPIEXEC mpiexec)
endif()
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/tests/cunit/run_tests.sh.in
Expand Down
6 changes: 3 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ AC_MSG_CHECKING([whether a user specified program to run mpi programs])
AC_ARG_WITH([mpiexec],
[AS_HELP_STRING([--with-mpiexec=<command>],
[Specify command to launch MPI parallel tests.])],
[MPIEXEC=$with_mpiexec], [MPIEXEC=mpiexec])
AC_MSG_RESULT([$MPIEXEC])
AC_SUBST([MPIEXEC], [$MPIEXEC])
[WITH_MPIEXEC=$with_mpiexec], [WITH_MPIEXEC=mpiexec])
AC_MSG_RESULT([$WITH_MPIEXEC])
AC_SUBST([WITH_MPIEXEC], [$WITH_MPIEXEC])

# Is doxygen installed?
AC_CHECK_PROGS([DOXYGEN], [doxygen])
Expand Down
4 changes: 2 additions & 2 deletions examples/c/run_tests.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ for EXAMPLE in $PIO_EXAMPLES
do
success1=false
echo "running ${EXAMPLE}"
@MPIEXEC@ -n 4 ./${EXAMPLE} && success1=true
@WITH_MPIEXEC@ -n 4 ./${EXAMPLE} && success1=true
if test $success1 = false; then
break
fi
Expand All @@ -29,7 +29,7 @@ for EXAMPLE in $PIO_EXAMPLES_16
do
success2=false
echo "running ${EXAMPLE}"
@MPIEXEC@ -n 16 ./${EXAMPLE} && success2=true
@WITH_MPIEXEC@ -n 16 ./${EXAMPLE} && success2=true
if test $success2 = false; then
break
fi
Expand Down
4 changes: 2 additions & 2 deletions tests/cunit/run_tests.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ for TEST in $PIO_TESTS
do
success1=false
echo "running ${TEST}"
@MPIEXEC@ -n 4 ./${TEST} && success1=true
@WITH_MPIEXEC@ -n 4 ./${TEST} && success1=true
if test $success1 = false; then
break
fi
Expand All @@ -38,7 +38,7 @@ for TEST in $PIO_TESTS_8
do
success2=false
echo "running ${TEST}"
@MPIEXEC@ -n 8 ./${TEST} && success2=true
@WITH_MPIEXEC@ -n 8 ./${TEST} && success2=true
if test $success2 = false; then
break
fi
Expand Down

0 comments on commit c0466f9

Please sign in to comment.