-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathADE_openmpi-4.1.4_CentOS-7.9.sh
56 lines (43 loc) · 1.48 KB
/
ADE_openmpi-4.1.4_CentOS-7.9.sh
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
#------------------------------
# Openmpi-4.1.4
#------------------------------
read -p "Input directory for download package--->" dwpath
read -p "Input installation directory for openmpi-4.1.4--->" openmpdir
read -p "Input modulefiles directory--->" moduledir
wget -P $dwpath https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.4.tar.gz
cd $dwpath
if [ -f "openmpi-4.1.4.tar.gz" ];then
true
else echo "openmpi-4.1.4.tar.gz not downloaded!"
exit 1
fi
if [ ! -n "$openmpdir" ];then
echo "Erro: not a valid directory."
exit 1
fi
if [ ! -d "$openmpdir" ];then
echo "Erro: no permission or not a valid directory."
exit 1
fi
function install_opmp(){
echo "uncompress openmpi-4.1.4.tar.gz and installing..."
tar -zxvf openmpi-4.1.4.tar.gz
cd openmpi-4.1.4
mkdir build && cd build
./../configure --prefix=$openmpdir
make all install
}
install_opmp
mod_name="openmpi-4.1.4"
touch $moduledir/$mod_name
echo "#%Module1.0" >> $moduledir/$mod_name
echo "##" >> $moduledir/$mod_name
echo "##" >> $moduledir/$mod_name
echo "set MPI \"$openmpdir\"" >> $moduledir/$mod_name
echo "prepend-path PATH \"\$MPI/bin\"" >> $moduledir/$mod_name
echo "prepend-path LD_LIBRARY_PATH \"\$MPI/lib\"" >> $moduledir/$mod_name
echo "prepend-path INCLUDE \"\$MPI/include\"" >> $moduledir/$mod_name
echo "prepend-path CPATH \"\$MPI/include\"" >> $moduledir/$mod_name
echo "prepend-path MANPATH \"\$MPI/share/man\"" >> $moduledir/$mod_name
echo "Complete!"