autoconf
[Top][All Lists]
Advanced

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

Re: How to test compiler and create messaged based on version of gcc?


From: Dr. David Kirkby
Subject: Re: How to test compiler and create messaged based on version of gcc?
Date: Thu, 06 Aug 2009 01:52:37 +0100
User-agent: Thunderbird 2.0.0.19 (X11/20090218)

Philip Herron wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

Its a shame you haven't had success on building with other compilers
you say about gcc 4.0.0 being too buggy, you mean the compiler or your
program comes out buggy? If thats the case your definitely going to
need to look at your sources in my opinion gcc is a very nice compiler
making very safe code. And other compilers may not be so nice.

I'm told by the main Sage developer, that gcc 4.0.0 does not work. There was only tonight a report of someone failing to build Sage and when asked the compiler version, was told it was 4.0.0

I've built Sage with gcc 4.2.4 and with gcc 4.4.0 myself ok.

To my knowledge, nobody has seriously tried building Sage with a compiler other than gcc. But there are bound to be some GNU-isms that prevent the Sun compiler from building Sage. However, I intend working on that, so it will build with the Sun compiler.

At the minute, the Sage configure script will not even allow one to try, as it exits. I bypassed that, but there are several bits in Sage which blow up if the compiler is not gcc.

For a configure.ac you could write something like:

AC_PREREQ(2.59)
AC_INIT(<name>, <version>,  <bug-report>)
AC_CONFIG_SRCDIR([...])
AC_CONFIG_HEADER([...])
#if you want to use more macros
AC_CONFIG_MACRO_DIR([m4])

# Checks for programs.
AC_PROG_CC_C99
AC_PROG_CXX
AC_PROG_RANLIB

AC_PROG_INSTALL
AC_PROG_LIBTOOL
AM_PROG_CC_C_O

AC_CONFIG_FILES([Makefile
                                 src/Makefile])
AC_OUTPUT

That would be a basic outline of a configure.ac but not that usefull.
I put in AC_PROG_CC_C99 as it useful and i only found it recently and
auto puts -std=gnu99 on your gcc line anyways.

I've noticed std=gnu99 when the compiler is not gcc. The Sun compiler then complains. It could be a badly written configure script, but I've seen this warning from the Sun compiler.

you could add in the check:

if test x$CC = xgcc ; then

Thank you, that looks like what I want.

#this is very likely to fail and is a bad way to do it :S
    #VERSION=`gcc --version | grep gcc | awk {'print $4'}`
    #so using that macro should do the trick chuck that macro
    #into the m4 dir mentioned at the top and do
VERSION=AX_GCC_VERSION #Not too sure if you can do less than or gt on that but you could
give it ago :)
elif
    AC_MSG_ERROR(not gcc)
fi

But if your seriously want to do this i would make sure you can
compile your code with gcc 4 at least before considering trying with
sun-studio it took me a good while to get used to using them.

Anyways good luck sage is pretty powerful :)

I've never really used it, but have put a lot of work in porting it to Solaris. Although it does build on Solaris, it is far from trivual and there are still some remaining issues. Two of the three issues should be fixed within less than a month, as new versions of ECL and Maxima will be released, which means ECL will build on Solaris and that Maxima will not break on ECL (the latest ECL in CVS detects an error in Maxima. But that has now been fixed and a new release of Maxima will be out very soon.)


Dave






reply via email to

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