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

20010501: Linux install problems: can't find Fortran types in C



Anthony,

>Date: Mon, 30 Apr 2001 17:24:34 -0700
>From: Anthony Fontanilla <address@hidden>
>Organization: NASA
>To: Steve Emmerson <address@hidden>
>Subject: Re: 20010430: Linux install problems: Fortran
>Keywords: 200104270253.f3R2qwL07979

The above message contained the following:

> I reran everything and I think I've got the correct file this time. 
> Sorry about the mix-up.
> 
> Anthony
...

> D.The file "configure.log" from step 6 above.
> creating cache ./config.cache
> checking for top-level source-directory
> /usr2/netcdf-3.5.0/src
> checking for m4 preprocessor
> checking for m4... m4
> checking m4 flags... -B10000
> checking C compiler "/usr/bin/egcs"... works
> checking how to make dependencies... false
> checking for /usr/bin/g++... /usr/bin/g++
> checking C++ compiler "/usr/bin/g++"... works
> checking how to run the C preprocessor... /usr/bin/egcs -E
> checking for f77... no
> checking for fort77... fort77
> conftest.f:
> checking for Fortran .F compiler...
> checking if Fortran-77 compiler handles *.F files... yes
> checking "fort77" as Fortran-90 compiler... failed to build executable program
> checking for xlf90... no
> checking for f90... no
> configure: warning: Could not find working Fortran-90 compiler
> configure: warning: The Fortran-90 interface will not be built
> checking for nm utility
> checking for nm... nm
> checking nm flags...
> checking for C-equivalent to Fortran routine "SUB"... conftest.f:
> sub_
> checking for Fortran "byte"... conftest.f:
> yes
> checking for Fortran "integer*2"... conftest.f:
> yes
> checking if Fortran "byte" is C "signed char"... conftestf.f:
> no
> checking if Fortran "byte" is C "short"... conftestf.f:
> no
> checking if Fortran "byte" is C "int"... conftestf.f:
> no
> checking if Fortran "byte" is C "long"... conftestf.f:
> no
> checking if Fortran "integer*2" is C "short"... conftestf.f:
> no
> checking if Fortran "integer*2" is C "int"... conftestf.f:
> no
> checking if Fortran "integer*2" is C "long"... conftestf.f:
> no
> checking if Fortran "integer" is C "int"... conftestf.f:
> no
> checking if Fortran "integer" is C "long"... conftestf.f:
> no
> checking if Fortran "real" is C "float"... conftestf.f:
> no
> checking if Fortran "real" is C "double"... conftestf.f:
> no
> checking if Fortran "doubleprecision" is C "double"... conftestf.f:
> no
> checking if Fortran "doubleprecision" is C "float"... conftestf.f:
> no
...

The last lines above indicate that the configure script couldn't find
any primitive C types that are equivalent to the primitive Fortran
types.  This is a severe problem and indicates why the Fortran interface
couldn't be built.

Oddly, the configure script's log file doesn't indicate any problem:

> E.The file "config.log", which is created in the top-level source 
> directory by the configure script during step 6 above.
> This file contains any messages produced by compilers while
> running configure, to aid debugging if configure makes a mistake.
...
> configure:1933: checking if Fortran "byte" is C "signed char"
> configure:1942: /usr/bin/egcs -c -Df2cFortran -O conftest.c
> configure:1944: fort77 -Wno-globals -c conftestf.f
>     MAIN:
> configure:1946: fort77 -o conftest -Wno-globals  conftestf.o conftest.o
> configure:1948: ./conftest
> configure:1981: checking if Fortran "byte" is C "short"
> configure:1990: /usr/bin/egcs -c -Df2cFortran -O conftest.c
> configure:1992: fort77 -Wno-globals -c conftestf.f
>     MAIN:
> configure:1994: fort77 -o conftest -Wno-globals  conftestf.o conftest.o
> configure:1996: ./conftest
> configure:2029: checking if Fortran "byte" is C "int"
> configure:2038: /usr/bin/egcs -c -Df2cFortran -O conftest.c
> configure:2040: fort77 -Wno-globals -c conftestf.f
>     MAIN:
> configure:2042: fort77 -o conftest -Wno-globals  conftestf.o conftest.o
> configure:2044: ./conftest
> configure:2077: checking if Fortran "byte" is C "long"
> configure:2086: /usr/bin/egcs -c -Df2cFortran -O conftest.c
> configure:2088: fort77 -Wno-globals -c conftestf.f
>     MAIN:
> configure:2090: fort77 -o conftest -Wno-globals  conftestf.o conftest.o
> configure:2092: ./conftest
> configure:2129: checking if Fortran "integer*2" is C "short"
> configure:2138: /usr/bin/egcs -c -Df2cFortran -O conftest.c
> configure:2140: fort77 -Wno-globals -c conftestf.f
>     MAIN:
> configure:2142: fort77 -o conftest -Wno-globals  conftestf.o conftest.o
> configure:2144: ./conftest
> configure:2177: checking if Fortran "integer*2" is C "int"
> configure:2186: /usr/bin/egcs -c -Df2cFortran -O conftest.c
> configure:2188: fort77 -Wno-globals -c conftestf.f
>     MAIN:
> configure:2190: fort77 -o conftest -Wno-globals  conftestf.o conftest.o
> configure:2192: ./conftest
> configure:2225: checking if Fortran "integer*2" is C "long"
> configure:2234: /usr/bin/egcs -c -Df2cFortran -O conftest.c
> configure:2236: fort77 -Wno-globals -c conftestf.f
>     MAIN:
> configure:2238: fort77 -o conftest -Wno-globals  conftestf.o conftest.o
> configure:2240: ./conftest
> configure:2275: checking if Fortran "integer" is C "int"
> configure:2284: /usr/bin/egcs -c -Df2cFortran -O conftest.c
> configure:2286: fort77 -Wno-globals -c conftestf.f
>     MAIN:
> configure:2288: fort77 -o conftest -Wno-globals  conftestf.o conftest.o
> configure:2290: ./conftest
> configure:2275: checking if Fortran "integer" is C "long"
> configure:2284: /usr/bin/egcs -c -Df2cFortran -O conftest.c
> configure:2286: fort77 -Wno-globals -c conftestf.f
>     MAIN:
> configure:2288: fort77 -o conftest -Wno-globals  conftestf.o conftest.o
> configure:2290: ./conftest
> configure:2323: checking if Fortran "real" is C "float"
> configure:2332: /usr/bin/egcs -c -Df2cFortran -O conftest.c
> configure:2334: fort77 -Wno-globals -c conftestf.f
>     MAIN:
> configure:2336: fort77 -o conftest -Wno-globals  conftestf.o conftest.o
> configure:2338: ./conftest
> configure:2323: checking if Fortran "real" is C "double"
> configure:2332: /usr/bin/egcs -c -Df2cFortran -O conftest.c
> configure:2334: fort77 -Wno-globals -c conftestf.f
>     MAIN:
> configure:2336: fort77 -o conftest -Wno-globals  conftestf.o conftest.o
> configure:2338: ./conftest
> configure:2371: checking if Fortran "doubleprecision" is C "double"
> configure:2380: /usr/bin/egcs -c -Df2cFortran -O conftest.c
> configure:2382: fort77 -Wno-globals -c conftestf.f
>     MAIN:
> configure:2384: fort77 -o conftest -Wno-globals  conftestf.o conftest.o
> configure:2386: ./conftest
> configure:2371: checking if Fortran "doubleprecision" is C "float"
> configure:2380: /usr/bin/egcs -c -Df2cFortran -O conftest.c
> configure:2382: fort77 -Wno-globals -c conftestf.f
>     MAIN:
> configure:2384: fort77 -o conftest -Wno-globals  conftestf.o conftest.o
> configure:2386: ./conftest

We'll need to determine the cause of this problem.  Would you please do
the following:

    1.  Create the file "c.c" with the following code:

           void sub_(values)
               signed char values[4];
           {
               exit(values[1] != -2 || values[2] != -3);
           }

    2.  Compile "c.c":

            $ egcs -c -O c.c

    3.  Create the file "f.f" with the following code:

           byte values(4)
           data values /-1, -2, -3, -4/
           call sub(values)
           end

    4.  Compile "f.f" and link it with "c.o":

            fort77 -o a.out -O f.f c.o

    5.  Execute "a.out" and obtain its exit-status:

            $ ./a.out
            $ echo $?

        or

            % ./a.out
            % echo $status

        depending on your shell.

I've tested the above on our Linux system.  It works.

If you encounter any problems, then please notify me and include all
diagnostic output.

Regards,
Steve Emmerson   <http://www.unidata.ucar.edu>