Hi Brian,

Am 6/3/2010 11:50 AM, schrieb Brian J. Murrell:
> On Thu, 2010-06-03 at 11:42 -0700, Christian Rössel wrote: 
>> Hi Brian,
> 
> Hey Christian,
> 
> Thanx for taking the time.
> 
>> I use a separate Makefile for MPI targets.
> 
> This is what I did last time around.  In fact I created a "mpi" subdir
> for my MPI sources.  I'm looking to avoid doing that again for this
> particular use case.
> 
>> The Makefile.am starts with
>>
>> CC   = $(MPICC)
>> CXX  = $(MPICXX)
>> F77  = $(MPIF77)
>> FC   = $(MPIFC)
>> LIBS += $(MPILIBS)
>>
>> where the MPI* variables are set by calls to AX_MPI
> 
> AX_MPI.  Nice.  I will have to look into that one.
> 
>> For me, this approach works just fine. However, you need to put the MPI
>> Makefile.am into a separate directory as, afaik, there can be only one
>> Makefile.am per directory.
> 
> Indeed, this is my understanding also.
> 
>> But you need not to move your sources, though.
> 
> Hrm.  Interesting.  We did move the MPI sources into the separate subdir
> with the new Makefile.  How did you avoid moving the sources too?  Did
> you just prefix all of the filenames, etc. in your subdir/Makefile.am
> with "../"?  i.e.
> 
> foo_CFLAGS = $(PTHREAD_CFLAGS)
> foo_SOURCES = ../parser.c ../cfg.c ../foo.c ../parser.h ../platform.h
> foo_LDFLAGS := $(PTHREAD_CFLAGS)
> foo_LDADD := $(LIBREADLINE) libbar.a $(PTHREAD_LIBS)
> foo_DEPENDENCIES := libbar.a

yes. As we use non-recursive make (besides the MPI subdir) and have
several source directories we need to prefix all files anyway.

Cheers,
Christian

Reply via email to