From 7f35091808003f46181f9ce2c83e3350df79c89c Mon Sep 17 00:00:00 2001 From: Rafael Sachetto Date: Tue, 30 Mar 2021 14:10:29 -0300 Subject: [PATCH] Fixing build error when MPI is set but not found --- bsbash/find_functions.sh | 7 +++++++ build.sh | 10 +++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/bsbash/find_functions.sh b/bsbash/find_functions.sh index 6e4dd7a6..4e4bd9f8 100644 --- a/bsbash/find_functions.sh +++ b/bsbash/find_functions.sh @@ -115,6 +115,13 @@ FIND_MPI () { MPI_INCLUDE_PATH='' fi + if [ ! -d "$MPI_INCLUDE_PATH" ] || [ ! -d "$MPI_LIBRARY_PATH" ]; then + MPI_FOUND='' + MPI_INCLUDE_PATH='' + MPI_LIBRARY_PATH='' + MPI_LIBRARIES='' + fi + export MPI_FOUND export MPI_LIBRARIES export MPI_LIBRARY_PATH diff --git a/build.sh b/build.sh index a020808b..407dfecf 100755 --- a/build.sh +++ b/build.sh @@ -222,25 +222,25 @@ if [ -n "$COMPILE_MPI" ]; then if [ -n "$MPI_INCLUDE_PATH" ]; then INCLUDE_P="-I$MPI_INCLUDE_PATH" fi - COMPILE_EXECUTABLE "MonoAlg3D_batch" "$SRC_FILES" "$HDR_FILES" "$STATIC_DEPS" "$DYNAMIC_DEPS" "$EXTRA_LIB_PATH" "$INCLUDE_P" + COMPILE_EXECUTABLE "MonoAlg3D_batch" "$SRC_FILES" "$HDR_FILES" "$STATIC_DEPS" "$DYNAMIC_DEPS" "$CUDA_LIBRARY_PATH $EXTRA_LIB_PATH" "$INCLUDE_P" fi fi if [ -n "$COMPILE_GUI" ]; then - COMPILE_EXECUTABLE "MonoAlg3D_visualizer" "src/main_visualizer.c" "" "$STATIC_DEPS" "$DYNAMIC_DEPS" "$EXTRA_LIB_PATH $LIBRARY_OUTPUT_DIRECTORY" + COMPILE_EXECUTABLE "MonoAlg3D_visualizer" "src/main_visualizer.c" "" "$STATIC_DEPS" "$DYNAMIC_DEPS" "$CUDA_LIBRARY_PATH $EXTRA_LIB_PATH $LIBRARY_OUTPUT_DIRECTORY" fi if [ -n "$COMPILE_CONVERTER" ]; then - COMPILE_EXECUTABLE "MonoAlg3D_converter" "src/main_converter.c" "" "$STATIC_DEPS" "$DYNAMIC_DEPS" "$EXTRA_LIB_PATH $LIBRARY_OUTPUT_DIRECTORY" + COMPILE_EXECUTABLE "MonoAlg3D_converter" "src/main_converter.c" "" "$STATIC_DEPS" "$DYNAMIC_DEPS" "$CUDA_LIBRARY_PATH $EXTRA_LIB_PATH $LIBRARY_OUTPUT_DIRECTORY" fi if [ -n "$COMPILE_FIBER_CONVERTER" ]; then - COMPILE_EXECUTABLE "MonoAlg3D_fiber_converter" "src/main_fiber_converter.c" "" "$STATIC_DEPS" "$DYNAMIC_DEPS" "$EXTRA_LIB_PATH $LIBRARY_OUTPUT_DIRECTORY" + COMPILE_EXECUTABLE "MonoAlg3D_fiber_converter" "src/main_fiber_converter.c" "" "$STATIC_DEPS" "$DYNAMIC_DEPS" "$CUDA_LIBRARY_PATH $EXTRA_LIB_PATH $LIBRARY_OUTPUT_DIRECTORY" fi if [ -n "$COMPILE_POSTPROCESSOR" ]; then - COMPILE_EXECUTABLE "MonoAlg3D_postprocessor" "src/main_postprocessor.c" "" "$STATIC_DEPS" "$DYNAMIC_DEPS" "$EXTRA_LIB_PATH $LIBRARY_OUTPUT_DIRECTORY" + COMPILE_EXECUTABLE "MonoAlg3D_postprocessor" "src/main_postprocessor.c" "" "$STATIC_DEPS" "$DYNAMIC_DEPS" "$CUDA_LIBRARY_PATH $EXTRA_LIB_PATH $LIBRARY_OUTPUT_DIRECTORY" ADD_SUBDIRECTORY "src/postprocessing_library/" fi