X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=products%2Fenv_scripts%2Fopenmpi.py;h=7eb0d67b06519c7898b285779e3f19452f907bfd;hb=dd7a1eb26028895a1e9d516206d528df74c72bc0;hp=7e26a0a94d56c6c8a626bd0b4a17a47e96db4456;hpb=ad3dc69d08b72b915e5a3ebba94ab8c9e88a33d7;p=tools%2Fsat_salome.git diff --git a/products/env_scripts/openmpi.py b/products/env_scripts/openmpi.py index 7e26a0a..7eb0d67 100644 --- a/products/env_scripts/openmpi.py +++ b/products/env_scripts/openmpi.py @@ -8,27 +8,44 @@ def set_env(env, prereq_dir, version): env.set('OPAL_PREFIX', prereq_dir) # be able to move openmpi install (packages) env.set('MPI_ROOT_DIR', prereq_dir) # update for cmake env.set('MPI_ROOT', prereq_dir) + env.set('MPI_INCLUDE_DIR', os.path.join(prereq_dir, 'include')) + env.set('MPI_C_COMPILER', os.path.join(prereq_dir, 'bin', 'mpicc')) + env.set('MPI_CXX_COMPILER', os.path.join(prereq_dir, 'bin', 'mpicxx')) + env.set('MPI_Fortran_COMPILER', os.path.join(prereq_dir, 'bin', 'mpifort')) + env.set('MPIEXEC_EXECUTABLE', os.path.join(prereq_dir, 'bin', 'mpiexec')) 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' + prereq_bin='/usr/bin' + prereq_inc='/usr/include/openmpi' try: import distro - if any(distribution in distro.name().lower() for distribution in ["centos", "fedora"]) : + if any(distribution in distro.name().lower() for distribution in ["rocky", "centos", "fedora"]) : prereq_dir='/usr/lib64/openmpi' + prereq_bin='/usr/lib64/openmpi/bin' + prereq_inc='/usr/include/openmpi-x86_64' + elif any(distribution in distro.name().lower() for distribution in ["debian", "ubuntu"]) : + prereq_dir='/usr/lib/x86_64-linux-gnu/openmpi' + prereq_inc= '/usr/lib/x86_64-linux-gnu/openmpi/include' except: import platform - if any(distribution in platform.linux_distribution()[0].lower() for distribution in ["centos", "fedora"]) : + if any(distribution in platform.linux_distribution()[0].lower() for distribution in ["rocky", "centos", "fedora"]) : prereq_dir='/usr/lib64/openmpi' + prereq_bin='/usr/lib64/openmpi/bin' + prereq_inc='/usr/include/openmpi-x86_64' + env.set('MPI_ROOT_DIR', prereq_dir) env.set('OPENMPIDIR', prereq_dir) env.set('MPI_ROOT', prereq_dir) + env.set('MPI_C_COMPILER', os.path.join(prereq_bin,'mpicc')) + env.set('MPI_CXX_COMPILER', os.path.join(prereq_bin,'mpicxx')) env.set('MPI_C_FOUND', os.path.join(prereq_dir,'lib','libmpi.so')) - env.prepend('PATH', os.path.join(prereq_dir, 'bin')) + env.set('MPI_INCLUDE_DIR', prereq_inc) + env.prepend('PATH', prereq_bin) env.prepend('LD_LIBRARY_PATH', os.path.join(prereq_dir,'lib')) +