-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInstall-Mpi.bash
executable file
·35 lines (28 loc) · 991 Bytes
/
Install-Mpi.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# Importing function run_as_root
source RunAsRoot.bash
# Running as root
run_as_root
# Installing MPI
dnf install --assumeyes openmpi
dnf install --assumeyes openmpi-devel
# Getting the executable path
mpi_executable_path_32="/usr/lib/openmpi/bin/mpirun"
mpi_executable_path_64="/usr/lib64/openmpi/bin/mpirun"
if [ -f "$mpi_executable_path_64" ]; then
mpi_executable_path="$mpi_executable_path_64"
elif [ -f "$mpi_executable_path_32" ]; then
mpi_executable_path="$mpi_executable_path_32"
fi
# Creating executable symbolic link
ln --symbolic "$mpi_executable_path" "/bin/mpirun"
# Getting the compiler path
mpi_compiler_path_32="/usr/lib/openmpi/bin/mpicc"
mpi_compiler_path_64="/usr/lib64/openmpi/bin/mpicc"
if [ -f "$mpi_compiler_path_64" ]; then
mpi_compiler_path="$mpi_compiler_path_64"
elif [ -f "$mpi_compiler_path_32" ]; then
mpi_compiler_path="$mpi_compiler_path_32"
fi
# Creating executable symbolic link
ln --symbolic "$mpi_compiler_path" "/bin/mpicc"