On 12/20/2011 1:51 PM, Jeff Squyres wrote:
On Dec 16, 2011, at 7:39 PM, Paul H. Hargrove wrote:
I've noticed that on, for instance, FreeBSD I must compile openmpi-1.5.5rc1 with "gmake"
rather than "make".
I didn't see "GNU Make" listed as a build dependency in the README, and so I
wonder if this was known.
The failure mode seen with Berkeley Make in place of GNU Make is somewhat
non-intuitive:
Making all in asm
CC asm.lo
/usr/bin/perl '/home/phargrov/OMPI//openmpi-1.5.5rc1/opal/asm/generate-asm.pl'
'AMD64' 'default-.text-.globl-:--.L-@-1-0-1-1-0'
'/home/phargrov/OMPI//openmpi-1.5.5rc1/opal/asm/base'
'../../opal/asm/generated/atomic-amd64-linux-nongas.s'
Use of uninitialized value $1 in concatenation (.) or string at
/home/phargrov/OMPI//openmpi-1.5.5rc1/opal/asm/generate-asm.pl line 16.
Could not open ../../opal/asm/generated/atomic-amd64-linux-nongas.s:
*** Error code 2
And I don't have any clue what the relation may be between that error and the
version of make.
No, this is not desirable. Gah. :-(
Can you look in opal/asm/base/Maekfile and see what the values of
OPAL_ASSEMBLY_ARCH and OPAL_ASSEMBLY_FORMAT are? Specifically: are they
non-empty on these two cases?
I ask because the only place generate-asm.pl is invoked is via a Makefile rule:
$(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@'
$1 should correspond to @OPAL_ASSEMBLY_ARCH@, and it should never be empty.
Since you confirm that the GNU Make requirement was NOT intended, I
looks a bit deeper.
The impatient can skip to the end for my conclusions.
I assume you wanted opal/asm/Makefile, there is no "base" under opal/asm.
What I find is
OPAL_ASSEMBLY_ARCH = AMD64
OPAL_ASSEMBLY_FORMAT = default-.text-.globl-:--.L-@-1-0-1-1-0
Which I imagine is correct because this is generated by configure long
before I choose "make" vs "gmake".
Additionally, the output when running "make" looks proper with respect
to those values:
$ make
Making all in config
Making all in contrib
Making all in opal
Making all in include
make all-am
Making all in libltdl
make all-am
Making all in asm
/usr/bin/perl
'/home/phargrov/OMPI/openmpi-1.5.5rc1//openmpi-1.5.5rc1/opal/asm/generate-asm.pl'
'AMD64' 'default-.text-.globl-:--.L-@-1-0-1-1-0'
'/home/phargrov/OMPI/openmpi-1.5.5rc1//openmpi-1.5.5rc1/opal/asm/base'
'../../opal/asm/generated/atomic-amd64-linux-nongas.s'
Use of uninitialized value $1 in concatenation (.) or string at
/home/phargrov/OMPI/openmpi-1.5.5rc1//openmpi-1.5.5rc1/opal/asm/generate-asm.pl
line 16.
Could not open ../../opal/asm/generated/atomic-amd64-linux-nongas.s:
*** Error code 2
Stop in /usr/home/phargrov/OMPI/openmpi-1.5.5rc1/BLD/opal/asm.
*** Error code 1
Stop in /usr/home/phargrov/OMPI/openmpi-1.5.5rc1/BLD/opal.
*** Error code 1
Stop in /usr/home/phargrov/OMPI/openmpi-1.5.5rc1/BLD.
However, this shows ANOTHER issue because that "make" above was run in a
COMPLETED build tree in which "gmake" does NOT attempt to rebuild any files!
Looking now at the perl code:
$ cat -n generate-asm.pl | head -20
1 #!/usr/bin/perl -w
2
3
4 my $asmarch = shift;
5 my $asmformat = shift;
6 my $basedir = shift;
7 my $output = shift;
8
9 if ( ! $asmarch) {
10 print "usage: generate-asm.pl [ASMARCH] [ASMFORMAT]
[BASEDIR] [OUTPUT NAME]\n";
11 exit(1);
12 }
13
14 open(INPUT, "$basedir/$asmarch.asm") ||
15 die "Could not open $basedir/$asmarch.asm: $!\n";
16 open(OUTPUT, ">$output") || die "Could not open $output: $1\n";
17
18 $CONFIG = "default";
19 $TEXT = "";
20 $GLOBAL = "";
Jeff seems to be think shell rather than perl in thinking $1" is the
first arg, but nevermind that.
Since "$1" should be the result of a prior pattern match, I cannot see
how line 16 could be correct.
I am pretty certain that line 16 should have "$!" rather than "$1".
With that 1-line change to the perl script in place the "real" error is:
$ make
Making all in config
Making all in contrib
Making all in opal
Making all in include
make all-am
Making all in libltdl
make all-am
Making all in asm
/usr/bin/perl
'/home/phargrov/OMPI/openmpi-1.5.5rc1//openmpi-1.5.5rc1/opal/asm/generate-asm.pl'
'AMD64' 'default-.text-.globl-:--.L-@-1-0-1-1-0'
'/home/phargrov/OMPI/openmpi-1.5.5rc1//openmpi-1.5.5rc1/opal/asm/base'
'../../opal/asm/generated/atomic-amd64-linux-nongas.s'
Could not open ../../opal/asm/generated/atomic-amd64-linux-nongas.s:
No such file or directory
*** Error code 2
Stop in /usr/home/phargrov/OMPI/openmpi-1.5.5rc1/BLD/opal/asm.
*** Error code 1
Stop in /usr/home/phargrov/OMPI/openmpi-1.5.5rc1/BLD/opal.
*** Error code 1
Stop in /usr/home/phargrov/OMPI/openmpi-1.5.5rc1/BLD.
That seems correct, since there is no 'opal/asm/generated' directory
under the $(top_builddir) in this VPATH build.
This now points back the the "other" observation: that "make" tries to
rebuild something "gmake" does not.
It appears to me now that w/ "gmake" in a VPATH build the rule to
generate target "generated/@OMPI_ASM_FILE@" doesn't run because GNU Make
apparently sees the existing "$(srcdir)/generated/@OMPI_ASM_FILE@" which
Berkeley Make apparently does not.
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
--
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