From b00e0a426a58940668d47208ab6dc2d0c26c6b0a Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Tue, 25 Jan 2022 15:48:36 +0100 Subject: [PATCH] spns #24419 - openmpi partiel --- applications/SALOME-master.pyconf | 16 ++++++++++++++++ products/compil_scripts/hdf5-1.10.3.sh | 2 ++ products/env_scripts/openmpi.py | 19 ++++++++++++++----- products/openmpi.pyconf | 9 ++++++++- 4 files changed, 40 insertions(+), 6 deletions(-) diff --git a/applications/SALOME-master.pyconf b/applications/SALOME-master.pyconf index fb38e38..d29eda2 100644 --- a/applications/SALOME-master.pyconf +++ b/applications/SALOME-master.pyconf @@ -51,6 +51,7 @@ APPLICATION : freetype : '2.9.1' gcc : '8.5.0' mpc : 'native' + mpi4py: '3.0.3' gmp : 'native' mpfr : 'native' gmsh : '4.8.4' @@ -76,6 +77,7 @@ APPLICATION : omniORB : '4.2.2' omniORBpy : '4.2.2' opencv : '3.2.0' + openmpi : '3.1.6' openturns: '1.17' openVKL: '0.11.0' ospray : '2.4.0' @@ -204,4 +206,18 @@ __overwrite__ : __condition__ : "VARS.dist not in ['DB08','DB09', 'FD30']" 'APPLICATION.rm_products' : ['gcc', 'gmp', 'mpc', 'mpfr'] } + { + __condition__ : "VARS.dist in ['DB09']" + 'APPLICATION.products.hdf5' : {tag:'1.10.3', base: 'no', section: 'version_1_10_3', hpc: 'yes'} + 'APPLICATION.products.cgns' : {tag:'4.1.1', base: 'no', section: 'default', hpc: 'yes'} + 'APPLICATION.products.ParaView' : {tag:'5.9.0', base: 'no', section: 'version_5_9_0_MPI', hpc: 'yes'} + 'APPLICATION.products.MeshGems' : {tag:'2.14-1', base: 'no', section: 'version_2_14_1', hpc: 'yes'} + 'APPLICATION.products.PARAVIS' : {tag:'master', base: 'no', section: 'default_MPI', hpc: 'yes'} + 'APPLICATION.products.MEDCOUPLING' : {tag:'master', base: 'no', section: 'default_MPI', hpc: 'yes'} + } + { + __condition__ : "VARS.dist not in ['DB09']" + 'APPLICATION.rm_products' : ['openmpi', 'mpi4py'] + } + ] diff --git a/products/compil_scripts/hdf5-1.10.3.sh b/products/compil_scripts/hdf5-1.10.3.sh index a53a0c0..c132313 100755 --- a/products/compil_scripts/hdf5-1.10.3.sh +++ b/products/compil_scripts/hdf5-1.10.3.sh @@ -22,6 +22,8 @@ then CMAKE_OPTIONS+=" -DHDF5_ENABLE_PARALLEL:BOOL=ON" CMAKE_OPTIONS+=" -DHDF5_BUILD_CPP_LIB:BOOL=ON" CMAKE_OPTIONS+=" -DHDF5_BUILD_TOOLS:BOOL=ON" + export CC=$(which mpicc) + export CXX=$(which mpic++) else CMAKE_OPTIONS+=" -DHDF5_ENABLE_PARALLEL:BOOL=OFF" CMAKE_OPTIONS+=" -DHDF5_BUILD_CPP_LIB:BOOL=ON" diff --git a/products/env_scripts/openmpi.py b/products/env_scripts/openmpi.py index 38872b1..45c7b23 100644 --- a/products/env_scripts/openmpi.py +++ b/products/env_scripts/openmpi.py @@ -16,8 +16,17 @@ def set_env(env, prereq_dir, version): env.prepend('C_INCLUDE_PATH', os.path.join(root, 'include')) # needed for parallel h5py def set_nativ_env(env): - env.set('MPI_ROOT_DIR', "/usr") # update for cmake - env.set('OPENMPIDIR', "/usr") - env.set('MPI_ROOT', "/usr") - - + prereq_dir='/usr' + try: + import distro + if any(distribution in distro.name().lower() for distribution in ["centos", "fedora"]) : + prereq_dir='/usr/lib64/openmpi' + except: + import platform + if any(distribution in platform.linux_distribution()[0].lower() for distribution in ["centos", "fedora"]) : + prereq_dir='/usr/lib64/openmpi' + env.set('MPI_ROOT_DIR', prereq_dir) + env.set('OPENMPIDIR', prereq_dir) + env.set('MPI_ROOT', prereq_dir) + env.prepend('PATH', os.path.join(prereq_dir, 'bin')) + env.prepend('LD_LIBRARY_PATH', os.path.join(prereq_dir,'lib')) diff --git a/products/openmpi.pyconf b/products/openmpi.pyconf index cfc6ac4..5bd6c6a 100644 --- a/products/openmpi.pyconf +++ b/products/openmpi.pyconf @@ -4,6 +4,13 @@ default : build_source : "script" compil_script : $name + ".sh" get_source : "archive" + system_info : + { + rpm : ["openmpi"] + rpm_dev : ["openmpi-devel"] + apt : ["libopenmpi2"] + apt_dev : ["libopenmpi-dev"] + } environ : { env_script : $name + ".py" @@ -14,4 +21,4 @@ default : source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name install_dir : 'base' -} \ No newline at end of file +} -- 2.39.2