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

20040405: netCDF 5.1 build on Linux using NAG Fortran-95



Sandy,

> To: <address@hidden>
> From: Sandy Sillman <address@hidden>
> Subject: netCDF5.1 installation failure report - Linux/NAG fortran
> Organization: University of Michigan
> Keywords: 200404012156.i31LuuCT013274 netCDF 3.5.1

The above message contained the following:

> Perhaps  you can help me with this or offer suggestions.
> 
> This is netcdf-3.5.1 on Linux with NAG fortran.
> 
> Here is information:
> 
> ==========
> SUMMARY:  WHERE IT FAILS
> 
> In make test: /usr/local/bin/f95 -fpp test_get.F
>    
> It lists WARNINGS for virtually every variable in the program as "Unused
> symbol".  Then, in test.get.o, everything is "undefined reference".
> Finally, it exits.
> 
> With the option CPPFLAGS "-DNDEBUG ", the same thing happens with test.put.F
> instead of test.get.F.
> 
> ==========
> 
> uname -a
> Linux ravenclaw.engin.umich.edu 2.4.20-24.9 #1 Mon Dec 1 11:43:36 EST 2003
> i686 athlon i386 GNU/Linux
> 
> ==============
> 
> VERSION:  3.5.1
> 
> =============== 
> 
> SETTINGS:  
> 
> These settings are adapted from the reported successful run with NAG fortran
> on  Mac OX, reported at
> http://www.unidata.ucar.edu/packages/netcdf/other-builds.html#macosx-nagf95
> 
> 
> setenv FC /usr/local/bin/f95
> setenv FFLAGS "-O -dusty -w"
> setenv F90 /usr/local/bin/f95
> setenv FPP "/usr/local/bin/f95 -fpp"
> setenv F90FLAGS "-O -w=unused -mismatch_all"
> setenv CPPFLAGS "-DNAGf90Fortran"
...

From the looks of your "test.log" file:

> Making `test' in directory 
> /home/sillman/cmaq03/lib/netCDF/netcdf-3.5.1/src/nf_test
> 
> make[2]: Entering directory 
> `/home/sillman/cmaq03/lib/netCDF/netcdf-3.5.1/src/nf_test'
> + /usr/local/bin/f95 -fpp test_get.F
> + grep -v '^#'
> Warning: test_get.F, line 97: Unused symbol EXTERNAL_MAX
>          detected at END@<end-of-statement>
> Warning: test_get.F, line 97: Unused symbol EXTERNAL_MIN
>          detected at END@<end-of-statement>
...
> [f95 continuing despite warning messages]
> Obsolescent: test_get.F, line 9: Fixed source form
> /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../crt1.o(.text+0x18): In 
> function `_start':
> ../sysdeps/i386/elf/start.S:77: undefined reference to `main'
> test_get.o(.text+0x2d): In function `test_nf_get_var1_text_':
> : undefined reference to `nf_open_'

the cause of your problems could be the proprocessing of .F files by 
the Fortran preprocessor.

From other email that we've received from NAG Fortran users, I believe
that NAG f95 is able to correctly preprocess *.F files; consequently,
the FPP setting above should be unnecessary.  See, for example,

    http://www.unidata.ucar.edu/cgi-bin/msgout?/glimpse/netcdf/4472

Please try the following:

    1.  Go to the top-level source directory.

    2.  Perform steps 3 and 4 described at

            
http://my.unidata.ucar.edu/content/software/netcdf/INSTALL.html#ReportingProblems

    3.  Set the following environment variables to the indicated values

            setenv CC /usr/bin/gcc
            setenv CPPFLAGS "-DNDEBUG -DNAGf90Fortran"
            setenv CFLAGS -O
            setenv FC /usr/local/bin/f95
            setenv FFLAGS "-O -dusty -w"
            setenv F90 /usr/local/bin/f95
            setenv F90FLAGS "-O -w=unused -mismatch_all"
            unsetenv FPP

        Note that the FPP environment variable is unset.

        What does the "-dusty" flag do?

    4.  Perform steps 6 through 9 described at

            
http://my.unidata.ucar.edu/content/software/netcdf/INSTALL.html#ReportingProblems

Please let me know if this helps.

Regards,
Steve Emmerson