Skip to content

Commit 8e049dc

Browse files
authored
Merge pull request #456 from sourceryinstitute/issue-455-install-sh-fix
Issue 455 install.sh fix for CentOS 6 -Fixes #455 (mostly)
2 parents cb6707a + 6488ab8 commit 8e049dc

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ if ( (NOT MPI_C_FOUND) OR (NOT MPI_Fortran_FOUND) OR (NOT MPIEXEC))
216216
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
217217
OUTPUT_VARIABLE DEFAULT_MPICH_INSTALL_LOC
218218
OUTPUT_QUIET
219-
OUTPUT_STRIP_TRAILING_WHITES_SPACE
219+
OUTPUT_STRIP_TRAILING_WHITESPACE
220220
)
221221
find_program (MY_MPI_EXEC NAMES mpirun mpiexec lamexec srun
222222
PATHS "${DEFAULT_MPICH_INSTALL_LOC}" ENV PATH

prerequisites/install-functions/find_or_install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ find_or_install()
3535
if type "$executable" >& /dev/null; then
3636
printf "yes.\n"
3737
package_in_path=true
38-
package_version_in_path=$("$executable" --version|head -1)
38+
package_version_in_path=$( ("${executable}" --version 2>/dev/null || "${executable}" -V) | head -1)
3939
else
4040
printf "no.\n"
4141
package_in_path=false

prerequisites/stack.sh

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ function stack_size
9999
return 1
100100
fi
101101
# TODO: revise the eval below to eliminate the need for this pop/push
102-
# sequene, which is a workaround to prevent an error that occurs with
103-
# if the stack is new and has not been the target of a stack_push.
102+
# sequene, which is a workaround to prevent an error that occurs with
103+
# if the stack is new and has not been the target of a stack_push.
104104
stack_push $1 __push_junk
105105
stack_pop $1 __pop_trash
106106
eval "$2"='$'"{#_stack_$1[*]}"
@@ -112,7 +112,7 @@ function no_such_stack
112112
stack_exists "$1"
113113
ret=$?
114114
declare -i x
115-
let x="1-$ret"
115+
let x="1-$ret" || true
116116
return $x
117117
}
118118

@@ -183,8 +183,7 @@ function stack_print
183183

184184
while (( _i > 0 ))
185185
do
186-
(( _i = _i - 1 )) || true
187-
eval 'e=$'"{_stack_$1[$_i]}"
186+
eval 'e=$'"{_stack_$1[$((--_i))]}" # pre-decrement
188187
# shellcheck disable=SC2154
189188
tmp="$tmp $e"
190189
done
@@ -210,13 +209,8 @@ function stack_new
210209
return 1
211210
fi
212211

213-
if [[ $(uname) == "Darwin" ]]; then
214-
eval "declare -ag _stack_$1" >& /dev/null || true
215-
eval "declare -ig _stack_$1_i" >& /dev/null || true
216-
else
217-
eval "declare -ag _stack_$1" >& /dev/null
218-
eval "declare -ig _stack_$1_i" >& /dev/null
219-
fi
212+
eval "_stack_$1=()"
213+
eval "_stack_$1_i=0"
220214

221215
variableName="_stack_$1_i"
222216
variableVal="0"

0 commit comments

Comments
 (0)