From 501b19422265a3bff593f5f85b80c92f6b19a800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <klinkovsky@mmg.fjfi.cvut.cz> Date: Fri, 15 Oct 2021 22:50:47 +0200 Subject: [PATCH] Documentation: fixed mpirun commands in CMakeLists.txt --- Documentation/Examples/Containers/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Documentation/Examples/Containers/CMakeLists.txt b/Documentation/Examples/Containers/CMakeLists.txt index 8d4c0b166d..d941d3db1e 100644 --- a/Documentation/Examples/Containers/CMakeLists.txt +++ b/Documentation/Examples/Containers/CMakeLists.txt @@ -21,7 +21,9 @@ if( BUILD_CUDA ) if( ${BUILD_MPI} ) foreach( target IN ITEMS ${MPI_COMMON_EXAMPLES} ) cuda_add_executable( ${target}-cuda ${target}.cu OPTIONS ) - add_custom_command( COMMAND "mpirun" ${mpirun_parameters} ${target}-cuda > ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/${target}.out OUTPUT ${target}.out ) + add_custom_command( COMMAND "mpirun" ${mpirun_parameters} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${target}-cuda${CMAKE_EXECUTABLE_SUFFIX}" > ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/${target}.out + DEPENDS ${target}-cuda + OUTPUT ${target}.out ) set( CUDA_OUTPUTS ${CUDA_OUTPUTS} ${target}.out ) endforeach() endif() @@ -34,7 +36,9 @@ else() if( ${BUILD_MPI} ) foreach( target IN ITEMS ${MPI_COMMON_EXAMPLES} ) add_executable( ${target} ${target}.cpp ) - add_custom_command( COMMAND "mpirun" ${mpirun_parameters} ${target} > ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/${target}.out OUTPUT ${target}.out ) + add_custom_command( COMMAND "mpirun" ${mpirun_parameters} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${target}${CMAKE_EXECUTABLE_SUFFIX}" > ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/${target}.out + DEPENDS ${target} + OUTPUT ${target}.out ) set( HOST_OUTPUTS ${HOST_OUTPUTS} ${target}.out ) endforeach() endif() -- GitLab