From 141b8815d9106f702138584d92c8c2ea069de67d Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Mon, 12 Jun 2017 12:41:53 -0700 Subject: [PATCH] jenkins: Use a perl regexp for the mpirun versio The sed regexp is a bit challenging to make portable (e.g., what works on Linux may not work in OS X / BSDs). So just switch to Perl, because Perl's regexps are nicely uniform across platforms. Signed-off-by: Jeff Squyres --- jenkins/open-mpi-build-script.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jenkins/open-mpi-build-script.sh b/jenkins/open-mpi-build-script.sh index 71fbc3b..78656f8 100644 --- a/jenkins/open-mpi-build-script.sh +++ b/jenkins/open-mpi-build-script.sh @@ -214,7 +214,9 @@ run_example() { if test "${MPIRUN_MODE}" != "none"; then echo "--> running examples" echo "localhost cpu=2" > "${WORKSPACE}/hostfile" - mpirun_version=`"${WORKSPACE}/install/bin/mpirun" --version | sed -n 's/.*\([0-9]\+\.[0-9]\+\)\..*/\1/p'` + # Note: using perl here because figuring out a portable sed regexp + # proved to be a little challenging. + mpirun_version=`"${WORKSPACE}/install/bin/mpirun --version | perl -wnE 'say $1 if /mpirun [^\d]*(\d+.\d+)/'` echo "--> mpirun version: ${mpirun_version}" case ${mpirun_version} in 1.*|2.0*)