From 038baa0d9863bbea0098673b6e25c5cdf6254314 Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Fri, 4 Feb 2022 16:40:09 +0100 Subject: [PATCH] openmpi environment file should be consistent now. 2/ CentOS 7 uses MPI as well, since topo-ii-vol requires openmpi --- applications/SALOME-master-native.pyconf | 5 ---- applications/SALOME-master.pyconf | 3 ++- products/ParaView.pyconf | 11 +++++++-- products/compil_scripts/topo2volmesh.sh | 30 ++++-------------------- products/env_scripts/openmpi.py | 27 ++++++++++----------- products/topo2volmesh.pyconf | 1 + 6 files changed, 30 insertions(+), 47 deletions(-) diff --git a/applications/SALOME-master-native.pyconf b/applications/SALOME-master-native.pyconf index 7676120..896e31b 100644 --- a/applications/SALOME-master-native.pyconf +++ b/applications/SALOME-master-native.pyconf @@ -201,7 +201,6 @@ __overwrite__ : 'APPLICATION.products.opencv' : '3.2.0' 'APPLICATION.products.cminpack': 'native' 'APPLICATION.products.PyFMI' : {tag: '2.5', base: 'no', section: 'version_2_5_no_pip' } - 'APPLICATION.products.ParaView' : {tag: '5.9.0', base: 'no', section: 'version_5_9_0_UB20_0_4', hpc: 'yes'} } { # On DB10, ParaView fails to find xmlpatterns executable : ParaViewClient.cmake try to find it @@ -212,14 +211,12 @@ __overwrite__ : __condition__ : "VARS.dist in ['DB10']" 'APPLICATION.products.cminpack': 'native' 'APPLICATION.products.PyFMI' : {tag:'2.5', base: 'no', section: 'version_2_5_no_pip' } - 'APPLICATION.products.ParaView' : {tag: '5.9.0', base : 'no', section: 'version_5_9_0_DB10', hpc: 'yes'} } { __condition__ : "VARS.dist in ['DB11']" 'APPLICATION.products.opencv' : '3.2.0' 'APPLICATION.products.cminpack': 'native' 'APPLICATION.products.PyFMI' : {tag:'2.5', base: 'no', section: 'version_2_5_no_pip' } - 'APPLICATION.products.ParaView' : {tag: '5.9.0', base : 'no', section: 'version_5_9_0_DB11', hpc: 'yes'} } { # CentOS 8 repositories don't include sphinxintl package which must be installed through pip. @@ -229,14 +226,12 @@ __overwrite__ : 'APPLICATION.products.cminpack' : '1.3.6' 'APPLICATION.products.PyFMI' : {tag: '2.5', base: 'no', section: 'version_2_5_no_pip' } 'APPLICATION.products.statsmodels' : {tag: '0.6.1', base: 'no', section: 'version_0_6_1_no_pip' } - 'APPLICATION.products.ParaView' : {tag: '5.9.0', base: 'no', section: 'version_5_9_0_CO8', hpc: 'yes'} } { __condition__ : "VARS.dist in ['FD32']" 'APPLICATION.products.opencv' : '3.2.0' 'APPLICATION.products.PyFMI' : {tag: '2.5', base: 'no', section: 'version_2_5_no_pip' } 'APPLICATION.products.openturns' : {tag: '1.17', base: 'no', section: 'version_1_17_FD32' } - 'APPLICATION.products.ParaView' : {tag: '5.9.0', base: 'no', section: 'version_5_9_0_FD32', hpc: 'yes'} } { diff --git a/applications/SALOME-master.pyconf b/applications/SALOME-master.pyconf index 48372ba..0b0d1ab 100644 --- a/applications/SALOME-master.pyconf +++ b/applications/SALOME-master.pyconf @@ -211,7 +211,8 @@ __overwrite__ : } { __condition__ : "VARS.dist in ['CO7']" - 'APPLICATION.rm_products' : ['openmpi', 'mpi4py', 'gcc', 'gmp', 'mpc', 'mpfr'] + 'APPLICATION.rm_products' : ['gcc', 'gmp', 'mpc', 'mpfr'] + 'APPLICATION.products.ParaView' : {tag:'5.9.0', base: 'no', section: 'version_5_9_0_MPI', hpc: 'yes'} } { __condition__ : "VARS.dist in ['CO8']" diff --git a/products/ParaView.pyconf b/products/ParaView.pyconf index a680f98..5dd8b93 100755 --- a/products/ParaView.pyconf +++ b/products/ParaView.pyconf @@ -239,7 +239,8 @@ version_5_9_0_MPI : 'paraview-5.9.0-gcc.11.0.patch', 'paraview.0017-VTK-openMPI-if-devtoolset.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' ] } @@ -265,11 +266,17 @@ version_5_9_0_UB20_0_4 : archive_info : {archive_name : "ParaView-5.9.0-lata.tar.gz"} # two other LATA patches already included in archive patches : ['paraview.0003-ParaViewClient.patch', + 'paraview.0004-ParaView_hdf5.patch', 'paraview.0005-ParaView_find_cgns.patch', + 'paraview.0006-ParaView_find_libxml2.patch', + 'paraview.0007-ParaView_find_freetype.patch', + 'paraview-5.9-VTKM_MPI.patch', 'paraview.0010-ParaView_CATALYST_cmake.patch', 'paraview.0008-ParaView_coincident_rendering.patch', 'paraview.0011-ParaView_protobuf_crash.patch', - 'paraview.0015-Paraview_VTKM_ioss.patch' + 'paraview.0015-Paraview_VTKM_ioss.patch', + 'paraview-5.9.0-gcc.11.0.patch', + 'paraview.0017-VTK-openMPI-if-devtoolset.patch', 'paraview.0018-spns-26351-autoconvert.patch', 'paraview.0019-spns-26344-VTK-OpenMP.patch', 'paraview.0020.findMPI.patch' diff --git a/products/compil_scripts/topo2volmesh.sh b/products/compil_scripts/topo2volmesh.sh index c8843fa..3e3d514 100755 --- a/products/compil_scripts/topo2volmesh.sh +++ b/products/compil_scripts/topo2volmesh.sh @@ -4,32 +4,12 @@ echo "########################################################################## echo "topo2volmesh" $VERSION echo "##########################################################################" +export CC=$(which mpicc) +export CXX=$(which mpicxx) +export MPICXX=$(which mpic++) + CONFIGURE_FLAGS= -if [ -n "$MPI_ROOT_DIR" ] -then - echo "WARNING: setting CC and CXX environment variables and target MPI wrapper" - export CC=${MPI_ROOT_DIR}/bin/mpicc - export CXX=${MPI_ROOT_DIR}/bin/mpicxx - CONFIGURE_FLAGS+=" --with-MPICXX=${MPI_ROOT_DIR}/bin/mpic++" -else - LINUX_DISTRIBUTION="$DIST_NAME$DIST_VERSION" - case $LINUX_DISTRIBUTION in - CO7|CO8|FD30|FD32|FD34) - # check whether openmpi is installed - x=$(yum list installed |grep openmpi) - if [ $? -ne 0 ]; then - echo "ERROR: openMPI is not installed!" - exit 1 - fi - export CC=/usr/lib64/openmpi/bin/mpicc - export CXX=/usr/lib64/openmpi/bin/mpicxx - export PATH=$PATH:/usr/lib64/openmpi/bin - CONFIGURE_FLAGS+=" --with-MPICXX=/usr/lib64/openmpi/bin/mpic++" - ;; - *) - ;; - esac -fi +CONFIGURE_FLAGS+=" --with-MPICXX=${MPICXX}" rm -rf $BUILD_DIR mkdir $BUILD_DIR diff --git a/products/env_scripts/openmpi.py b/products/env_scripts/openmpi.py index 6c17a38..5698ce1 100644 --- a/products/env_scripts/openmpi.py +++ b/products/env_scripts/openmpi.py @@ -9,32 +9,31 @@ def set_env(env, prereq_dir, version): env.set('MPI_ROOT_DIR', prereq_dir) # update for cmake env.set('MPI_ROOT', prereq_dir) env.set('MPI_C_FOUND', os.path.join(prereq_dir,'lib','libmpi.so')) - root = env.get('OPENMPIDIR') - - env.prepend('PATH', os.path.join(root, 'bin')) - env.prepend('PATH', os.path.join(root, 'include')) - env.prepend('LD_LIBRARY_PATH', os.path.join(root, 'lib')) - env.prepend('C_INCLUDE_PATH', os.path.join(root, 'include')) # needed for parallel h5py + env.prepend('PATH', os.path.join(prereq_dir, 'bin')) + env.prepend('PATH', os.path.join(prereq_dir, 'include')) + env.prepend('LD_LIBRARY_PATH', os.path.join(prereq_dir, 'lib')) + env.prepend('C_INCLUDE_PATH', os.path.join(prereq_dir, 'include')) # needed for parallel h5py def set_nativ_env(env): prereq_dir='/usr' + mpibin_dir='/usr/bin' try: import distro if any(distribution in distro.name().lower() for distribution in ["centos", "fedora"]) : prereq_dir='/usr/lib64/openmpi' + mpibin_dir='/usr/lib64/openmpi/bin' + elif any(distribution in distro.name().lower() for distribution in ["debian", "ubuntu"]) : + prereq_dir='/usr/lib/x86_64-linux-gnu/openmpi' except: import platform if any(distribution in platform.linux_distribution()[0].lower() for distribution in ["centos", "fedora"]) : prereq_dir='/usr/lib64/openmpi' + mpibin_dir='/usr/lib64/openmpi/bin' + env.set('MPI_ROOT_DIR', prereq_dir) env.set('OPENMPIDIR', prereq_dir) env.set('MPI_ROOT', prereq_dir) - 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.set('MPI_C_FOUND', os.path.join(prereq_dir,'lib','libmpi.so')) + env.prepend('PATH', mpibin_dir) env.prepend('LD_LIBRARY_PATH', os.path.join(prereq_dir,'lib')) + diff --git a/products/topo2volmesh.pyconf b/products/topo2volmesh.pyconf index 0797b54..e7fa2ec 100644 --- a/products/topo2volmesh.pyconf +++ b/products/topo2volmesh.pyconf @@ -22,6 +22,7 @@ default : } patches : [] depend : [] + opt_depend: ['openmpi'] build_depend : ["cmake"] source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name -- 2.39.2