Skip to content

Commit

Permalink
Fixing build error when MPI is set but not found
Browse files Browse the repository at this point in the history
  • Loading branch information
rsachetto committed Mar 30, 2021
1 parent fb5e59e commit 7f35091
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions bsbash/find_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 7f35091

Please sign in to comment.