From 629d365bdf0dc40660a37c469e0dd888db0ec317 Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Wed, 2 Feb 2022 13:05:16 +0100 Subject: [PATCH] bos #28849 - Debian 10 until a more robust approach is found --- products/ParaView.pyconf | 3 ++- products/env_scripts/openmpi.py | 8 +++++++- products/patches/paraview.0020.findMPI.patch | 14 ++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 products/patches/paraview.0020.findMPI.patch diff --git a/products/ParaView.pyconf b/products/ParaView.pyconf index 702346f..ee02ffe 100755 --- a/products/ParaView.pyconf +++ b/products/ParaView.pyconf @@ -326,7 +326,8 @@ version_5_9_0_DB10 : 'paraview.0017-ParaView_protobuf_crash.patch', 'paraview.0015-Paraview_VTKM_ioss.patch' 'paraview.0018-spns-26351-autoconvert.patch', - 'paraview.0019-spns-26344-VTK-OpenMP.patch' + 'paraview.0019-spns-26344-VTK-OpenMP.patch', + 'paraview.0020.findMPI.patch' ] } diff --git a/products/env_scripts/openmpi.py b/products/env_scripts/openmpi.py index 7e26a0a..6c17a38 100644 --- a/products/env_scripts/openmpi.py +++ b/products/env_scripts/openmpi.py @@ -29,6 +29,12 @@ def set_nativ_env(env): env.set('MPI_ROOT_DIR', prereq_dir) env.set('OPENMPIDIR', prereq_dir) env.set('MPI_ROOT', prereq_dir) - env.set('MPI_C_FOUND', os.path.join(prereq_dir,'lib','libmpi.so')) + mpiclib_dir=prereq_dir + try: + if "debian" in distro.name().lower() and any(version in distro.version() for version in ["10"]) : + mpiclib_dir='/usr/lib/x86_64-linux-gnu/openmpi' + except: + pass + env.set('MPI_C_FOUND', os.path.join(mpiclib_dir,'lib','libmpi.so')) env.prepend('PATH', os.path.join(prereq_dir, 'bin')) env.prepend('LD_LIBRARY_PATH', os.path.join(prereq_dir,'lib')) diff --git a/products/patches/paraview.0020.findMPI.patch b/products/patches/paraview.0020.findMPI.patch new file mode 100644 index 0000000..09cdbd8 --- /dev/null +++ b/products/patches/paraview.0020.findMPI.patch @@ -0,0 +1,14 @@ +diff -Naur ParaView_ref/VTK/CMake/patches/3.17/FindMPI.cmake ParaView_new/VTK/CMake/patches/3.17/FindMPI.cmake +--- ParaView_ref/VTK/CMake/patches/3.17/FindMPI.cmake 2022-02-02 10:45:40.273534527 +0100 ++++ ParaView_new/VTK/CMake/patches/3.17/FindMPI.cmake 2022-02-02 12:20:19.005537074 +0100 +@@ -1727,6 +1727,10 @@ + list(APPEND _MPI_REQ_VARS "MPI_MPICXX_FOUND") + endif() + ++if(DEFINED ENV{MPI_C_FOUND}) ++ set(MPI_C_FOUND $ENV{MPI_C_FOUND}) ++endif() ++ + find_package_handle_standard_args(MPI + REQUIRED_VARS ${_MPI_REQ_VARS} + VERSION_VAR ${_MPI_MIN_VERSION} -- 2.39.2