autoconf-archive-maintainers
[Top][All Lists]
Advanced

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

Autoconf MPI macros


From: Olaf Lenz
Subject: Autoconf MPI macros
Date: Tue, 24 May 2011 11:02:24 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110414 SUSE/3.1.10 Thunderbird/3.1.10

Hi all!

We are using the GNU autotools and MPI in a number of our projects, and
we found that the AX_MPI macro from the autoconf macro archive has a few
shortcomings.

The problem is that AX_MPI starts to do anything only after the standard
C compiler has been found via AC_PROG_CC. If you want to compile the
whole package using MPI and simply replace CC with the MPI compiler,
this can lead to serious trouble. Assume the following case (seen on an
IBM AIX machine):
* gcc is installed
* the MPI compiler is xlc (the IBM compiler)

If I use AX_MPI in configure.ac, the following will happen in configure:
* AC_PROG_CC will recognize "gcc" as standard C compiler
* it will furthermore determine the options that gcc uses to generate
dependencies
* then, AX_MPI will recognize the MPI compiler "xlc"
* CC will be set to "xlc"

When I compile, this means that the compiler tries to generate
dependencies using the compiler xlc with the options of gcc. In this
particular case, the option (-MD if I'm not mistaken) caused xlc to
output profiling information into the .c-file and thus effectively
destroyed the C-code.

I believe that the correct way to avoid this problem is a set of new
macros AX_PROG_{FC,CCCXX}_MPI that are used in configure.ac instead of
AC_PROG_{CC,FC,CXX}. I have attached the macro AX_PROG_CC_MPI, and a git
clone of the autoconf macro archive containing the macro can be found at

  https://github.com/olenz/autoconf-archive

Internally, the MPI macro uses the standard macro AC_PROG_CC to find the
compiler, and directly sets CC to a working MPI version.

I propose to include these macros into the autoconf macro archive, and
to extend the docs of AX_MPI to point to these macros.

Greetings
  Olaf

-- 
Dr. rer. nat. Olaf Lenz
Institut für Computerphysik, Pfaffenwaldring 27, D-70569 Stuttgart
Phone: +49-711-685-63607

Attachment: ax_prog_cc_mpi.m4
Description: Text document

Attachment: olenz.vcf
Description: Vcard


reply via email to

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