From bbf6517f522fb41a07016e22efcf51c720827a15 Mon Sep 17 00:00:00 2001 From: Izaak Beekman Date: Mon, 9 Oct 2017 22:09:48 -0400 Subject: [PATCH 1/3] Fix typo causing error when MPI missing --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cf2aeb719..3e65bea51 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 From b043ed31c934871ba5e01b882ed2484c69e21c15 Mon Sep 17 00:00:00 2001 From: Izaak Beekman Date: Mon, 9 Oct 2017 22:10:26 -0400 Subject: [PATCH 2/3] Handle old yacc on CentOS6 - Script assumed all executables take --version argument, older yaccs only have -V, not uncommon among unix tools --- prerequisites/install-functions/find_or_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prerequisites/install-functions/find_or_install.sh b/prerequisites/install-functions/find_or_install.sh index 6cb55683a..1b611f578 100644 --- a/prerequisites/install-functions/find_or_install.sh +++ b/prerequisites/install-functions/find_or_install.sh @@ -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 From 6488ab8ab95537f8d5340e99d9c67f3986755bed Mon Sep 17 00:00:00 2001 From: Izaak Beekman Date: Mon, 9 Oct 2017 22:11:55 -0400 Subject: [PATCH 3/3] Fix stack.sh for bash 4.1 --- prerequisites/stack.sh | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/prerequisites/stack.sh b/prerequisites/stack.sh index 3ad59a919..3022cd6f4 100644 --- a/prerequisites/stack.sh +++ b/prerequisites/stack.sh @@ -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[*]}" @@ -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 } @@ -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 @@ -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"