← Back to team overview

dolfin team mailing list archive

Re: More on pkg-config

 

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"

> >   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?

/Anders


> Garth
> 
> > It would be good if the demo Makefiles were as simple as they can
> > possibly be. 
> > 
> > /Anders
> > 
> > On Fri, Oct 13, 2006 at 03:21:15PM +0200, Garth N. Wells wrote:
> >> Why is the compiler (g++) specified explicitly in the Makefiles for the
> >> demos?
> >>
> >> Garth
> >>
> >>
> >> Anders Logg wrote:
> >>> I have moved all the demo Makefiles from dolfin-config to pkg-config.
> >>> Please check that it works for everyone.
> >>>
> >>> The only thing currently holding us back from removing dolfin-config
> >>> is that it is used by PyDOLFIN. Johan, could you try to remove the
> >>> dependeny in PyDOLFIN? If you need extra flags you can just add them
> >>> to dolfin.pc.in.
> >>>
> >>> If you add the line
> >>>
> >>> foo=bar
> >>>
> >>> in dolfin.pc.in (and regenerate), then dolfin-config --variable=foo
> >>> returns bar.
> >>>
> >>> /Anders
> >>> _______________________________________________
> >>> 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
> > _______________________________________________
> > 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


Follow ups

References