[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Wierd PETSc build behavior...



On Wed, 28 Feb 2001, Adam C Powell IV wrote:

> > but it looks like what you need to do here
> > is reference another makefile variable called MPI_HOME.

> Yup.

> > The way to this is
> > with the syntax $(MPI_HOME) -- note the parens in place of braces.  I believe
> > ${MPI_HOME} references a non-existent /environment/ variable.  (Elsewhere the
> > braces may indeed be correct, since you mention the use of multiple makefiles,
> > but if you need to reference a Makefile variable set in the same file, you
> > should normally use parentheses.)

> I see.  So something has changed recently in unstable such that braces don't always work
> any more?  I usually use parentheses myself, but upstream has braces all over the place-
> I assumed they were interchangable (okay, so I'm a "make" newbie :-).

> So why do braces work everywhere else in the makefile and all of the included files?  Why
> do they fail in exactly the same place on every architecture?  Do I need to do a massive
> global search and replace to switch braces to parentheses everywhere??

> I can't find anything relevant in the make info page either...

The only comment I find in the info docs is

  To substitute a variable's value, write a dollar sign followed by
the name of the variable in parentheses or braces: either `$(foo)' or
`${foo}' is a valid reference to the variable `foo'.

so I may have dreamed up the distinction between the two usages.  I certainly
got that impression /some/how, though...

Upon rereading your makefile snippets, I get the impression this isn't
actually the part of makefile that's being interpreted here.  I see you have
defined

MPI_LIB        = -L${MPI_HOME}/lib -L${MPI_HOME}/build/LINUX/ch_p4/lib -lmpich

but the output of make includes

Using libraries: -L/usr/home/hazelsct/petsc/petsc-2.0.29/lib/libO/linux_ppc -lpetscts -lpetscsnes  -lpetscsles -lpetscdm -lpetscmat -lpetscvec -L/usr/home/hazelsct/petsc/petsc-2.0.29/lib/libO/linux_ppc -lpetsc -L{MPI_HOME}/build/LINUX/ch_p4/lib -lmpe -lpmpich                                               -L/usr/X11R6/lib -lX11             -llapack -blas -L/usr/lib/mpich/lib -L/usr/lib/mpich/build/LINUX/ch_p4/lib -lmpich -ldl -lc -lg2c -lm

... and the correct value of MPI_LIB does appear towards the end of the
library string, well past the point where -L{MPI_HOME} shows up.

So I'm just on crack... pay no attention to anything I say. :)

Steve Langasek
postmodern programmer



Reply to: