Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: Re: [OMPI devel] GNU Make required for OMPI 1.5.5rc1: known/intended?
From: Paul H. Hargrove (PHHargrove_at_[hidden])
Date: 2011-12-20 18:35:34


On 12/20/2011 2:47 PM, Paul H. Hargrove wrote:
[snip]
> So, conclusions:
> 1) On line 16 of generate-asm.pl, "$1" is a typo for "$!", but is NOT
> the true problem.
> 2) Somebody who knows automake is going to have to rework the
> "generated/@OMPI_ASM_FILE@" target in opal/asm/Makefile.am to work
> correctly with a VPATH build and Berkeley Make.
>
> -Paul

I confirmed in the respective documentation that GNU Make applies VPATH
searches to BOTH targets and prerequisites, while Berkeley Make only
mentions prerequisites. So, the "generated/@OMPI_ASM_FILE@" target in
opal/asm/Makefile.am is non-portable.

I think the following is a portable way to deal with this, but cannot
test because autogen.sh results in useless garbage for me:
--- openmpi-1.5.5rc1/opal/asm/Makefile.am.orig 2011-12-20
15:13:10.000000000 -0800
+++ openmpi-1.5.5rc1/opal/asm/Makefile.am 2011-12-20
15:17:22.000000000 -0800
@@ -28,7 +28,11 @@
  #
  ######################################################################
  generated/@OMPI_ASM_FILE@: base/@OPAL_ASSEMBLY_ARCH_at_.asm
- $(PERL) '$(top_srcdir)/opal/asm/generate-asm.pl'
'@OPAL_ASSEMBLY_ARCH@' '@OPAL_ASSEMBLY_FORMAT@'
'$(top_srcdir)/opal/asm/base'
'$(top_builddir)/opal/asm/generated/@OMPI_ASM_FILE@'
+ @ if test ! -f "$(top_srcdir)/opal/asm/$@" ; then \
+ cmd="$(PERL) '$(top_srcdir)/opal/asm/generate-asm.pl'
'@OPAL_ASSEMBLY_ARCH@' '@OPAL_ASSEMBLY_FORMAT@'
'$(top_srcdir)/opal/asm/base'
'$(top_builddir)/opal/asm/generated/@OMPI_ASM_FILE@'"
+ echo "$$cmd" ; \
+ eval $$cmd ; \
+ fi

  atomic-asm.S: generated/@OMPI_ASM_FILE@
         rm -f atomic-asm.S

(with my apologies for the fact that my cut-and-paste expands the TABs
in that patch).

The idea behind the patch is that GNU Make will not execute the rule at
all, which other Make versions will use the 'if test' to short-circuit
the command if the target exists in the source directory.

-Paul

-- 
Paul H. Hargrove                          PHHargrove_at_[hidden]
Future Technologies Group
HPC Research Department                   Tel: +1-510-495-2352
Lawrence Berkeley National Laboratory     Fax: +1-510-486-6900