dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #03454
Re: More on pkg-config
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.
>>> 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
>>
Follow ups
References