autoconf
[Top][All Lists]
Advanced

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

Re: telling the difference between g95 and f95...


From: Ed Hartnett
Subject: Re: telling the difference between g95 and f95...
Date: Tue, 07 Feb 2006 10:29:29 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

Ralf Wildenhues <address@hidden> writes:

> Hi Ed,
>
> * Ed Hartnett wrote on Mon, Feb 06, 2006 at 04:42:01PM CET:
>> 
>> I have a configure script which needs to know whether it is dealing
>> with the f95 distributed with gcc-4.x, or the g95, which is apparently
>> an independent project, which handles slightly differently.
>
> What are the differences that are important to you?  Can they be
> recognized by a suitable test to be done in `configure'?  Without
> running generated executables?  What if one of the compiler changes
> in one of the interesting features (fixes some bug, or so)?

Of course I realized this while cycling home yesterday.

The difference is how they call functions in a C library - whether
they add one underscore or two, and how they treat function names that
already contain underscores.

This is all in support of the cfortran.h package, which allows one to
wrap C library functions in fortran. 

What I need to do (for the next release of my package) is have some
tests that detect this stuff.

>
>> In both cases ac_cv_fc_compiler_gnu is set to yes.
>> 
>> At the moment I am distinguishing them base on name ("f95" vs. "g95")
>> but this can easily break.
>
> AFAIK the gcc-4.x Fortran compiler is named gfortran.

When I installed gcc 4.0.2 it named it "f95" but I recognize gfortran
as well.

>
>> Does anyone know of a better way?
>
> Depending on above questions, yes: test for features, not names.
> Testing for names and versions is very maintenance-intensive, see
> Libtool; names and versions are a last resort when one
> - cannot test the feature, or
> - there are so many different details or possible results that it
>   would take far too long to test.
>

Well I might fall into the second category.

The requirements are that my package should work with just about any
fortran, as long as the user knows what flag to set. Since they never
do know, they always ask...

But I will try and handle this better in the next release.

Thanks,

Ed

-- 
Ed Hartnett  -- address@hidden





reply via email to

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