libtool
[Top][All Lists]
Advanced

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

Re: How to use compiler wrappers


From: Ralf Wildenhues
Subject: Re: How to use compiler wrappers
Date: Mon, 23 Mar 2009 07:36:28 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

Hello John,

* John R. Cary wrote on Sun, Mar 22, 2009 at 04:50:20PM CET:
> I am in a situation where due to flakey compilers (pgi)
> I had to write a compiler wrapper such that if code
> does not compile, I reduce the optimization level, then
> try again.
>
> My way of dealing with this is to create a compiler
> wrapper as a wrapper.sh.in file with
>
> address@hidden@
>
> and so forth so that at configure time it knows the real
> compilers.

It's probably preferable if you use the wrapper at configure time
already, but name it strictly after the compiler, but with a suffix.
For example, name it pgf90-wrapper.  The libtool configure macros will
look for the compiler name, unfortunately.

Alternatively, ...

> make CC=wrapper.sh

> /bin/sh ../libtool   --mode=compile  
> /project/projectdirs/facets/cary/facetsall-franklin/physics/nubeam/par/txutils/f90
>  
> -I../../include -I  ../random -I  ../old_xplasma -I  ../xplasma2 -I   
> ../ezcdf -I  ../pspline -I  ../rfxqlo -I  ../plasma_state_kernel -I   
> ../plasma_state -I  ../xstraln -O -c -o nbi_types.lo  
> ../../nubeam/nbi_types.f90
> libtool: compile: unable to infer tagged configuration
> libtool: compile: specify a tag with `--tag'
> make[2]: *** [nbi_types.lo] Error 1
>
> From documentation I can find, I see that I need to add the
> flag
>
> AM_LIBTOOLFLAGS = --tag=FC
>
> Will this cause problems when the directory has C or C++ code as well?

... you can use this, or simply use a more recent Automake (1.9 or
newer; 1.10.2 is current) that always adds a --tag argument by itself.

BTW, setting the tag but using different compilers at configure and at
make time can cause libtool to choose the one from configure time when
it creates shared libraries.  This may or may not be what you want.

Hope that helps.

Cheers,
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]