[Top][All Lists]

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

Re: Using two compilers

From: Ralf Wildenhues
Subject: Re: Using two compilers
Date: Mon, 7 Jun 2004 19:27:16 +0200
User-agent: Mutt/

* Juha Jäykkä wrote on Mon, Jun 07, 2004 at 11:10:53AM CEST:
> Hello! I found the following piece of conversation on how to compile parts
> of a program with a non-standard CC. It is from the automake list
> archives.
> I have exactly the same situation: a set of source files must be compiled
> with ordinary CC but some of them with mpicc (or AIX's mpxlc). Is the
> reply below (at over a year old) still how things work today? At least
> there does not seem to be a "AC_PROG_CC_FOR_BUILD" any more and having two
> different's seems horrible switching between two configures
> all the time - not a major hassle when actually using the program, but
> during development it sounds horrible.
> To me it seems, the easiest way to accomplish this would be to be able to
> define something like "program_CC = @MPICC@" and then just use AC_PROG_CC
> and friends to find out the compiler, libraries etc and use AC_SUBST to
> replace @MPICC@ from Makefile. Would this require tweaking automake itself
> (which I cannot do) or can this be done with a m4 script?

Having mostly the same problem as you, here's what we do:

In one package, we resorted to just using two configure scripts.
This was necessary due to the fact that a prominent MPI implementation
mpicc script broke gcc3 depmode [1], so a single configure script would
just not work for "both" compilers.  Of course, you could work around
this problem by using --disable-dependency-tracking.

In another package (not widely circulated) we just set CC = @MPICC@
within the directory which contains the objects built with mpicc,
and fixed all MPI implementations on all hosts this package runs on.

Generally, more and more complex problems could arise, though,
so IMVHO you are on the safe side with the first option.
Oh, BTW; you do know about ACX_MPI[2]?


[1] MPICH up to, I believe.  They incorporated my patch,
however, for the next release.  Automake was fixed to detect the
failure soon after I reported it.

[2] see .

reply via email to

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