Skip to content

Commit

Permalink
Error when execute_process fails via COMMAND_ERROR_IS_FATAL ANY
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarrec committed Dec 2, 2024
1 parent a119feb commit 22fcbdd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.17)
cmake_minimum_required(VERSION 3.19)

# Use ccache if available, has to be before "project()"
find_program(CCACHE_PROGRAM NAMES ccache sccache)
Expand Down
9 changes: 5 additions & 4 deletions cmake/RunSimulation.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ if(BUILD_FORTRAN)
find_program(PARAMETRIC_EXE ParametricPreprocessor PATHS "${PRODUCT_PATH}"
NO_DEFAULT_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${IDF_PATH}" "${OUTPUT_DIR_PATH}")
execute_process(COMMAND "${PARAMETRIC_EXE}" "${IDF_FILE}" WORKING_DIRECTORY "${OUTPUT_DIR_PATH}")
execute_process(COMMAND "${PARAMETRIC_EXE}" "${IDF_FILE}" WORKING_DIRECTORY "${OUTPUT_DIR_PATH}" COMMAND_ERROR_IS_FATAL ANY)

# this handles the LBuildingAppGRotPar parametric file
if(EXISTS "${OUTPUT_DIR_PATH}/${IDF_NAME}-G000.idf")
Expand Down Expand Up @@ -100,7 +100,7 @@ if(BUILD_FORTRAN)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${IDF_PATH}" "${OUTPUT_DIR_PATH}/in.idf")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${EPW_PATH}" "${OUTPUT_DIR_PATH}/in.epw")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${PRODUCT_PATH}/Energy+.idd" "${OUTPUT_DIR_PATH}")
execute_process(COMMAND "${EXPANDOBJECTS_EXE}" WORKING_DIRECTORY "${OUTPUT_DIR_PATH}")
execute_process(COMMAND "${EXPANDOBJECTS_EXE}" WORKING_DIRECTORY "${OUTPUT_DIR_PATH}" COMMAND_ERROR_IS_FATAL ANY)

if("${SLAB_RESULT}" GREATER -1)
# Copy files needed for Slab
Expand All @@ -109,7 +109,7 @@ if(BUILD_FORTRAN)
find_program(SLAB_EXE Slab PATHS "${PRODUCT_PATH}" NO_DEFAULT_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH)
message("Executing Slab from ${SLAB_EXE}")
execute_process(COMMAND "${SLAB_EXE}" WORKING_DIRECTORY "${OUTPUT_DIR_PATH}")
execute_process(COMMAND "${SLAB_EXE}" WORKING_DIRECTORY "${OUTPUT_DIR_PATH}" COMMAND_ERROR_IS_FATAL ANY)
# Then copy slab results into the expanded file
file(READ "${OUTPUT_DIR_PATH}/SLABSurfaceTemps.TXT" SLAB_CONTENTS)
file(APPEND "${OUTPUT_DIR_PATH}/expanded.idf" "${SLAB_CONTENTS}")
Expand All @@ -118,11 +118,12 @@ if(BUILD_FORTRAN)
if("${BASEMENT_RESULT}" GREATER -1)
# Copy files needed for Basement
file(COPY "${SOURCE_DIR}/idd/BasementGHT.idd" DESTINATION "${OUTPUT_DIR_PATH}")
file(COPY "${OUTPUT_DIR_PATH}/in.idf" DESTINATION "${OUTPUT_DIR_PATH}/BasementGHTIn.idf")
# Find and run basement
find_program(BASEMENT_EXE Basement PATHS "${PRODUCT_PATH}" NO_DEFAULT_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH)
message("Executing Basement from ${BASEMENT_EXE}")
execute_process(COMMAND "${BASEMENT_EXE}" WORKING_DIRECTORY "${OUTPUT_DIR_PATH}")
execute_process(COMMAND "${BASEMENT_EXE}" WORKING_DIRECTORY "${OUTPUT_DIR_PATH}" COMMAND_ERROR_IS_FATAL ANY)
# Then copy basement results into the expanded file
file(READ "${OUTPUT_DIR_PATH}/EPObjects.TXT" BASEMENT_CONTENTS)
file(APPEND "${OUTPUT_DIR_PATH}/expanded.idf" "${BASEMENT_CONTENTS}")
Expand Down

3 comments on commit 22fcbdd

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10826_Slab (jmarrec) - x86_64-Linux-Ubuntu-24.04-gcc-13.2: OK (2913 of 2917 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 797
  • Failed: 4

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10826_Slab (jmarrec) - x86_64-Linux-Ubuntu-24.04-gcc-13.2-UnitTestsCoverage-RelWithDebInfo: OK (2099 of 2099 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10826_Slab (jmarrec) - x86_64-Linux-Ubuntu-24.04-gcc-13.2-IntegrationCoverage-RelWithDebInfo: OK (797 of 801 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 797
  • Failed: 4

Build Badge Test Badge Coverage Badge

Please sign in to comment.