X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=products%2Fenv_scripts%2Fopenmpi.py;h=7eb0d67b06519c7898b285779e3f19452f907bfd;hb=dd7a1eb26028895a1e9d516206d528df74c72bc0;hp=38872b1f0cbcd17d784480442d7552224fd143fc;hpb=298f0f1f3babde4391646eecad9c63ec2f3f46c2;p=tools%2Fsat_salome.git diff --git a/products/env_scripts/openmpi.py b/products/env_scripts/openmpi.py index 38872b1..7eb0d67 100644 --- a/products/env_scripts/openmpi.py +++ b/products/env_scripts/openmpi.py @@ -8,16 +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) - 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.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')) + 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): - env.set('MPI_ROOT_DIR', "/usr") # update for cmake - env.set('OPENMPIDIR', "/usr") - env.set('MPI_ROOT', "/usr") + 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 ["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 ["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.set('MPI_INCLUDE_DIR', prereq_inc) + env.prepend('PATH', prereq_bin) + env.prepend('LD_LIBRARY_PATH', os.path.join(prereq_dir,'lib'))