← Back to team overview

dolfin team mailing list archive

Re: More on pkg-config

 

ok, fixed. See if it works.

/Anders


On Fri, Oct 13, 2006 at 10:16:27PM +0200, Anders Logg wrote:
> On Fri, Oct 13, 2006 at 09:38:46PM +0200, Garth N. Wells wrote:
> > Anders Logg wrote:
> > > On Fri, Oct 13, 2006 at 09:05:47PM +0200, Garth N. Wells wrote:
> > >> Anders Logg wrote:
> > >>> No particular reason. There are two other options:
> > >>>
> > >>>   1. Don't specify CXX explicitly in the Makefile so it defaults
> > >>>      to the standard compiler
> > >>>
> > >> We should be able to choose the compiler. There are a bunch of reasons
> > >> why one might want something other than the default compiler.
> > > 
> > > Yes, but then one may just add a line "CXX = my_special_compiler"
> > >
> > 
> > The flags returned by "pkg-config dolfin --cflags" are generally
> > compiler-dependent, so it's necessary to know the compiler which the
> > flags are for.
> 
> ok, so then we would need to add a flag to dolfin.pc that outputs the
> compiler used to compile DOLFIN. It seems this is necessary.
> Otherwise, the compilation of the demos may fail even if someone has
> previously compiled the library (after specifying a certain compiler).
> 
> I'll add --variable=compiler to dolfin.pc.
> 
> /Anders
> 
> > >>>   2. Add a flag --variable=compiler to dolfin.pc and use the compiler
> > >>>      that was used to compile DOLFIN
> > >>>
> > >> Seems ok to me.
> > > 
> > > Doesn't it look a little strange?
> > > 
> > >>> Any suggestions?
> > >>>
> > >>> What about the linker? Do we need libtool? Or can we just use CXX for
> > >>> that as well?
> > >>>
> > >> Looks like libtool is no longer required because the location of the
> > >> libraries has been added to LD_LIBRARY_PATH, so I guess we can get rid
> > >> of it.
> > > 
> > > Good.
> > > 
> > > I would suggest we just remove CXX and LINKER from the Makefile.
> > > 
> > > Here's how the simplest Makefile would look:
> > > 
> > >   CFLAGS  = `pkg-config dolfin --cflags`
> > >   LIBS    = `pkg-config dolfin --libs`
> > > 
> > >   DEST    = dolfin-poisson
> > >   OBJECTS = main.o
> > > 
> > >   all: $(DEST)
> > > 
> > >   clean:
> > >           -rm -f *.o core *.core $(OBJECTS) $(DEST)
> > > 
> > >   $(DEST): $(OBJECTS)
> > >             $(CXX) -o $@ $(OBJECTS) $(CFLAGS) $(LIBS)
> > > 
> > >   .cpp.o:
> > >           $(CXX) $(CFLAGS) -c $<
> > > 
> > > Could this be simplified further or this the simplest possible
> > > Makefile?
> > > 
> > 
> > As Makefiles go, this looks to me about as simple as they get.
> > 
> > Garth
> > 
> > 
> > > /Anders
> > > 
> > > 
> > >> Garth
> > >>
> > 
> > _______________________________________________
> > DOLFIN-dev mailing list
> > DOLFIN-dev@xxxxxxxxxx
> > http://www.fenics.org/mailman/listinfo/dolfin-dev
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev


References