The addition on Monday of the Java cases to examples/Makefile has shown
that the default "make" in Solaris-10 will stop on the first failed grep
command in the "all" rule:
$ make
mpicc -g -o hello_c hello_c.c
mpicc -g -o ring_c ring_c.c
mpicc -g -o connectivity_c connectivity_c.c
mpic++ -g -o hello_cxx hello_cxx.cc
mpic++ -g -o ring_cxx ring_cxx.cc
mpif90 -g hello_f77.f -o hello_f77
mpif90 -g ring_f77.f -o ring_f77
mpif90 -g hello_f90.f90 -o hello_f90
mpif90 -g ring_f90.f90 -o ring_f90
*** Error code 1
The following command caused the error:
if test "`ompi_info --parsable | grep bindings:java:yes`" != ""; then \
make Hello.class; \
fi
make: Fatal error: Command failed for target `all'
The addition of java did NOT break anything, but exposed a pre-existing
problem which was not evident in my prior testing because all language
bindings were being build prior to adding java.
The attached patch resolves the problem in my (admittedly minimal)
testing with the smallest possible change.
However an entirely different avoids both "test" and "true" and simply
looks like:
@ if ompi_info --parsable | grep bindings:cxx:yes >/dev/null; then
I have *also* tested that approach, and it works fine too.
I *did* warn that the introduction of the java bindings would bring
collateral damage.
I just didn't anticipate encountering it personally.
-Paul
--
Paul H. Hargrove phhargr...@lbl.gov
Future Technologies Group
HPC Research Department Tel: +1-510-495-2352
Lawrence Berkeley National Laboratory Fax: +1-510-486-6900
Index: Makefile
===================================================================
--- Makefile (revision 25980)
+++ Makefile (working copy)
@@ -49,19 +49,19 @@
# if Open MPI was build with the relevant language bindings.
all: hello_c ring_c connectivity_c
- @ if test "`ompi_info --parsable | grep bindings:cxx:yes`" != ""; then \
+ @ if test "`ompi_info --parsable | grep bindings:cxx:yes || true`" != ""; then \
$(MAKE) hello_cxx ring_cxx; \
fi
- @ if test "`ompi_info --parsable | grep bindings:f77:yes`" != ""; then \
+ @ if test "`ompi_info --parsable | grep bindings:f77:yes || true`" != ""; then \
$(MAKE) hello_f77 ring_f77; \
fi
- @ if test "`ompi_info --parsable | grep bindings:f90:yes`" != ""; then \
+ @ if test "`ompi_info --parsable | grep bindings:f90:yes || true`" != ""; then \
$(MAKE) hello_f90 ring_f90; \
fi
- @ if test "`ompi_info --parsable | grep bindings:java:yes`" != ""; then \
+ @ if test "`ompi_info --parsable | grep bindings:java:yes || true``" != ""; then \
$(MAKE) Hello.class; \
fi
- @ if test "`ompi_info --parsable | grep bindings:java:yes`" != ""; then \
+ @ if test "`ompi_info --parsable | grep bindings:java:yes || true`" != ""; then \
$(MAKE) Ring.class; \
fi