Skip to content

Commit

Permalink
Merge pull request #456 from sourceryinstitute/issue-455-install-sh-fix
Browse files Browse the repository at this point in the history
Issue 455 install.sh fix for CentOS 6

 -Fixes #455 (mostly)
  • Loading branch information
zbeekman committed Oct 10, 2017
2 parents cb6707a + 6488ab8 commit 8e049dc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ if ( (NOT MPI_C_FOUND) OR (NOT MPI_Fortran_FOUND) OR (NOT MPIEXEC))
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE DEFAULT_MPICH_INSTALL_LOC
OUTPUT_QUIET
OUTPUT_STRIP_TRAILING_WHITES_SPACE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
find_program (MY_MPI_EXEC NAMES mpirun mpiexec lamexec srun
PATHS "${DEFAULT_MPICH_INSTALL_LOC}" ENV PATH
Expand Down
2 changes: 1 addition & 1 deletion prerequisites/install-functions/find_or_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ find_or_install()
if type "$executable" >& /dev/null; then
printf "yes.\n"
package_in_path=true
package_version_in_path=$("$executable" --version|head -1)
package_version_in_path=$( ("${executable}" --version 2>/dev/null || "${executable}" -V) | head -1)
else
printf "no.\n"
package_in_path=false
Expand Down
18 changes: 6 additions & 12 deletions prerequisites/stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ function stack_size
return 1
fi
# TODO: revise the eval below to eliminate the need for this pop/push
# sequene, which is a workaround to prevent an error that occurs with
# if the stack is new and has not been the target of a stack_push.
# sequene, which is a workaround to prevent an error that occurs with
# if the stack is new and has not been the target of a stack_push.
stack_push $1 __push_junk
stack_pop $1 __pop_trash
eval "$2"='$'"{#_stack_$1[*]}"
Expand All @@ -112,7 +112,7 @@ function no_such_stack
stack_exists "$1"
ret=$?
declare -i x
let x="1-$ret"
let x="1-$ret" || true
return $x
}

Expand Down Expand Up @@ -183,8 +183,7 @@ function stack_print

while (( _i > 0 ))
do
(( _i = _i - 1 )) || true
eval 'e=$'"{_stack_$1[$_i]}"
eval 'e=$'"{_stack_$1[$((--_i))]}" # pre-decrement
# shellcheck disable=SC2154
tmp="$tmp $e"
done
Expand All @@ -210,13 +209,8 @@ function stack_new
return 1
fi

if [[ $(uname) == "Darwin" ]]; then
eval "declare -ag _stack_$1" >& /dev/null || true
eval "declare -ig _stack_$1_i" >& /dev/null || true
else
eval "declare -ag _stack_$1" >& /dev/null
eval "declare -ig _stack_$1_i" >& /dev/null
fi
eval "_stack_$1=()"
eval "_stack_$1_i=0"

variableName="_stack_$1_i"
variableVal="0"
Expand Down

0 comments on commit 8e049dc

Please sign in to comment.