Skip to content

Commit 7cd5178

Browse files
author
Damian Rouson
committed
Add comments to setup.sh and setup.csh
1 parent d02752f commit 7cd5178

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

prerequisites/install-functions/report_results.sh

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,17 @@ report_results()
4545
echo "# Execute this script via the following command: " | tee -a setup.csh setup.sh
4646
echo "# source ${install_path%/}/setup.sh " | tee -a setup.csh setup.sh
4747
echo " " | tee -a setup.csh setup.sh
48+
if [[ -x "$cmake_install_path/cmake" ]]; then
49+
echo "# Prepend the CMake path to the PATH environment variable:" | tee -a setup.sh setup.csh
50+
echo "if [[ -z \"\$PATH\" ]]; then " >> setup.sh
51+
echo " export PATH=\"${cmake_install_path%/}/\" " >> setup.sh
52+
echo "else " >> setup.sh
53+
echo " export PATH=\"${cmake_install_path%/}/\":\$PATH " >> setup.sh
54+
echo "fi " >> setup.sh
55+
echo "set path = (\"${cmake_install_path%/}\"/\"\$path\") " >> setup.csh
56+
fi
4857
if [[ -x "$fully_qualified_FC" ]]; then
58+
echo "# Prepend the compiler path to the PATH environment variable:" | tee -a setup.sh setup.csh
4959
echo "if [[ -z \"\$PATH\" ]]; then " >> setup.sh
5060
echo " export PATH=\"${compiler_install_root%/}/bin\" " >> setup.sh
5161
echo "else " >> setup.sh
@@ -54,6 +64,7 @@ report_results()
5464
echo "set path = (\"${compiler_install_root%/}\"/bin \"\$path\") " >> setup.csh
5565
fi
5666
if [[ -d "${compiler_install_root%/}/lib" || -d "${compiler_install_root%/}/lib64" ]]; then
67+
echo "# Prepend the compiler library paths to the LD_LIBRARY_PATH environment variable:" | tee -a setup.sh setup.csh
5768
compiler_lib_paths="${compiler_install_root%/}/lib64/:${compiler_install_root%/}/lib"
5869
echo "if [[ -z \"\$LD_LIBRARY_PATH\" ]]; then " >> setup.sh
5970
echo " export LD_LIBRARY_PATH=\"${compiler_lib_paths%/}\" " >> setup.sh
@@ -63,13 +74,14 @@ report_results()
6374
echo "set LD_LIBRARY_PATH = (\"${compiler_lib_paths%/}\"/bin \"\$LD_LIBRARY_PATH\") " >> setup.csh
6475
fi
6576
echo " " >> setup.sh
66-
if [[ -x "$cmake_install_path/cmake" ]]; then
77+
if [[ -x "$mpi_install_root/bin/mpif90" ]]; then
78+
echo "# Prepend the MPI path to the PATH environment variable:" | tee -a setup.sh setup.csh
6779
echo "if [[ -z \"\$PATH\" ]]; then " >> setup.sh
68-
echo " export PATH=\"${cmake_install_path%/}/\" " >> setup.sh
80+
echo " export PATH=\"${mpi_install_root%/}/bin\" " >> setup.sh
6981
echo "else " >> setup.sh
70-
echo " export PATH=\"${cmake_install_path%/}/\":\$PATH " >> setup.sh
82+
echo " export PATH=\"${mpi_install_root%/}/bin\":\$PATH " >> setup.sh
7183
echo "fi " >> setup.sh
72-
echo "set path = (\"${cmake_install_path%/}\"/\"\$path\") " >> setup.csh
84+
echo "set path = (\"${mpi_install_root%/}\"/bin \"\$path\") " >> setup.csh
7385
fi
7486
# In all likelihood, the following paths are only needed if OpenCoarrays built them,
7587
# In by far the most common such use case, they would have been built in a recursive
@@ -80,6 +92,7 @@ report_results()
8092
# user doesn't need them at all (e.g. there was no need to build gfortran from source).
8193
flex_install_path=$("${build_script}" -P flex)
8294
if [[ -x "$flex_install_path/bin/flex" ]]; then
95+
echo "# Prepend the flex path to the PATH environment variable:" | tee -a setup.sh setup.csh
8396
echo "if [[ -z \"\$PATH\" ]]; then " >> setup.sh
8497
echo " export PATH=\"$flex_install_path/bin\" " >> setup.sh
8598
echo "else " >> setup.sh
@@ -89,6 +102,7 @@ report_results()
89102
fi
90103
bison_install_path=$("${build_script}" -P bison)
91104
if [[ -x "$bison_install_path/bin/yacc" ]]; then
105+
echo "# Prepend the bison path to the PATH environment variable:" | tee -a setup.sh setup.csh
92106
echo "if [[ -z \"\$PATH\" ]]; then " >> setup.sh
93107
echo " export PATH=\"$bison_install_path/bin\" " >> setup.sh
94108
echo "else " >> setup.sh
@@ -98,23 +112,17 @@ report_results()
98112
fi
99113
m4_install_path=$("${build_script}" -P m4)
100114
if [[ -x "$m4_install_path/bin/m4" ]]; then
115+
echo "# Prepend the m4 path to the PATH environment variable:" | tee -a setup.sh setup.csh
101116
echo "if [[ -z \"\$PATH\" ]]; then " >> setup.sh
102117
echo " export PATH=\"$m4_install_path/bin\" " >> setup.sh
103118
echo "else " >> setup.sh
104119
echo " export PATH=\"$m4_install_path/bin\":\$PATH " >> setup.sh
105120
echo "fi " >> setup.sh
106121
echo "set path = (\"$m4_install_path\"/bin \"\$path\") " >> setup.csh
107122
fi
108-
if [[ -x "$mpi_install_root/bin/mpif90" ]]; then
109-
echo "if [[ -z \"\$PATH\" ]]; then " >> setup.sh
110-
echo " export PATH=\"${mpi_install_root%/}/bin\" " >> setup.sh
111-
echo "else " >> setup.sh
112-
echo " export PATH=\"${mpi_install_root%/}/bin\":\$PATH " >> setup.sh
113-
echo "fi " >> setup.sh
114-
echo "set path = (\"${mpi_install_root%/}\"/bin \"\$path\") " >> setup.csh
115-
fi
116123
opencoarrays_install_path="${install_path}"
117124
if [[ -x "$opencoarrays_install_path/bin/caf" ]]; then
125+
echo "# Prepend the OpenCoarrays path to the PATH environment variable:" | tee -a setup.sh setup.csh
118126
echo "if [[ -z \"\$PATH\" ]]; then " >> setup.sh
119127
echo " export PATH=\"${opencoarrays_install_path%/}/bin\" " >> setup.sh
120128
echo "else " >> setup.sh

0 commit comments

Comments
 (0)