[Top][All Lists]

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

Re: How can I check if C++ and Fortran compiler works ?

From: Dr. David Kirkby
Subject: Re: How can I check if C++ and Fortran compiler works ?
Date: Mon, 22 Feb 2010 12:04:20 +0000
User-agent: Thunderbird (X11/20090323)

Ralf Wildenhues wrote:
* Dr. David Kirkby wrote on Sun, Feb 21, 2010 at 11:53:05PM CET:
There is no actual test that the C++ compiler works. How can I add

You could simply test whether it can link a trivial program.  Call
the macro below after AC_PROG_CXX.

I intend to submit this macro, suitably rewritten and factored, as
Autoconf addition, since it's come up twice within two days now.


# Check whether the C++ compiler works.
AC_CACHE_CHECK([whether the C++ compiler works],
                AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],

Thank you. I'll add that macro and something to to ensure the C++ compiler is at least semi sensible. I'm really not sure what was causing the error message "complex.h: present but cannot be compiled" but there is at least some suspicion the person who got this error did not have a working C++ compiler, so it seems sensible to check that.

Could you do likewise for Fortran?

I've done this, which makes the assumption that if the compiler will not accept freeform source code, then it won't be suitable, but it is a bit of a hack.

   AC_MSG_NOTICE([Your Fortran compiler accepts free-format source code])
   AC_MSG_NOTICE([which older F77 compilers do not. This does not 100%])
   AC_MSG_NOTICE([guarantee your compiler is suitable for building SAGE])
   AC_MSG_NOTICE([but it probably is.])
   AC_MSG_NOTICE([Your Fortran compiler does not accept free-format source 
   AC_MSG_NOTICE([which means the compiler is either seriously broken, or])
   AC_MSG_NOTICE([is too old to build Sage.])


reply via email to

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