[Top][All Lists]

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

Can I select a different compiler ??

From: Dr. David Kirkby
Subject: Can I select a different compiler ??
Date: Tue, 15 Apr 2003 20:17:20 +0100

        I'm using autoconf/automake on a set of programs (call them foo and
foobar) that are likely to use two different C compilers. foo is
likely to be compiled with gcc or cc (as determined by the configure
script) and will of course be set by the configure script to the
variable CC.

The other compiler, needed to compile foobar, is a bit more
specialised and might typically be be called mpicc,  hcc, mpcc, mpcc_r
or whatever. This compiler is used for compiling code to run on a
network of distributed computers. This compiler is set to the variable
MPICC and the linker flags are set to MPILIBS. These are both set
using an M4 macro called from the configure script. 

I want to compile+link foo with the $CC compiler and $LIBS, but foobar
with the $MPICC compiler and $MPILIB + $LIBS libraries. I've sorted
out how to do the libraries (see below), but I'm not sure how to
enforce foobar to be compiled/linked using $MPICC rather than the
normal $CC.

# This is part of the 
# foo needs no special treatment, as the default $CC compiler is fine. 
bin_PROGRAMS = foo foobar
foo_SOURCES = foo1.c foo2.c
foo_LDADD = @LIBS@

# foobar needs to be compiled with the $MPICC compiler and linked with
# the linker is easy to sort out, but how about the compiler ???????
foobar_SOURCES = foobar1.c foobar2.c
foobar_LDADD = @LIBS@ @MPILIB@

Dr. David Kirkby,
Senior Research Fellow,
Department of Medical Physics,
University College London,
11-20 Capper St, London, WC1E 6JA.
Tel: 020 7679 6408 Fax: 020 7679 6269
Internal telephone: ext 46408
e-mail address@hidden

reply via email to

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