Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit efa3c3a

Browse files
committed
examples: update ompi_info bindings checks
Use "-q" option to grep/egrep to suppress output (we only need the exit status). Also, use egrep for the "use mpi" check, because some versions of ompi_info say 'bindings:use_mpi:yes' and others say 'bindings:use_mpi:"yes' (i.e., with the double quote). This regexp will work with both versions. (cherry picked from commit open-mpi/ompi@677a31b)
1 parent 6c9e0b5 commit efa3c3a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,19 @@ all: hello_c ring_c connectivity_c
8484
# MPI examples
8585

8686
mpi:
87-
@ if ompi_info --parsable | grep bindings:cxx:yes >/dev/null; then \
87+
@ if ompi_info --parsable | grep -q bindings:cxx:yes >/dev/null; then \
8888
$(MAKE) hello_cxx ring_cxx; \
8989
fi
90-
@ if ompi_info --parsable | grep bindings:mpif.h:yes >/dev/null; then \
90+
@ if ompi_info --parsable | grep -q bindings:mpif.h:yes >/dev/null; then \
9191
$(MAKE) hello_mpifh ring_mpifh; \
9292
fi
93-
@ if ompi_info --parsable | grep bindings:use_mpi:\"yes >/dev/null; then \
93+
@ if ompi_info --parsable | egrep -q bindings:use_mpi:\"\?yes >/dev/null; then \
9494
$(MAKE) hello_usempi ring_usempi; \
9595
fi
96-
@ if ompi_info --parsable | grep bindings:use_mpi_f08:yes >/dev/null; then \
96+
@ if ompi_info --parsable | grep -q bindings:use_mpi_f08:yes >/dev/null; then \
9797
$(MAKE) hello_usempif08 ring_usempif08; \
9898
fi
99-
@ if ompi_info --parsable | grep bindings:java:yes >/dev/null; then \
99+
@ if ompi_info --parsable | grep -q bindings:java:yes >/dev/null; then \
100100
$(MAKE) Hello.class Ring.class; \
101101
fi
102102

0 commit comments

Comments
 (0)