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

[netCDF #QRV-112021]: NetCDF's configure "fails to bail out" when no correspondence between fortran and C type sizes are found



> Hello,
> 
> I am trying to install NetCDF here on a core i7 and stumbled on an
> error that should be detected by configure so I guess you could take it
> as a bug, if you feel fit. Anyway, I felt like reporting it as an effort
> to help develop netcdf.
> 
> In general, the bug is that the configure script fails to detect
> when no type correspondence is possible between C and Fortran. I suppose
> this part of the script should end up on error:
> 
> 1.. checking for Fortran "byte"... yes
> 2.. checking for Fortran "integer*2"... yes
> 3.. checking if Fortran "byte" is C "signed char"... no
> 4.. checking if Fortran "byte" is C "short"... no
> 5.. checking if Fortran "byte" is C "int"... no
> 6.. checking if Fortran "byte" is C "long"... no
> 7.. checking if Fortran "integer*2" is C "short"... no
> 8.. checking if Fortran "integer*2" is C "int"... no
> 9.. checking if Fortran "integer*2" is C "long"... no
> 10.. checking if Fortran "integer" is C "int"... no
> 11.. checking if Fortran "integer" is C "long"... no
> 12.. checking if Fortran "real" is C "float"... no
> 13.. checking if Fortran "real" is C "double"... no
> 14.. checking if Fortran "doubleprecision" is C "double"... no
> 15.. checking if Fortran "doubleprecision" is C "float"... no
> 16.. checking for Fortran-equivalent to netCDF "byte"... byte
> 17.. checking for Fortran-equivalent to netCDF "short"... integer*2
> 
> What actually does not happen. The configure script goes to its end,
> and when compiling, we get the error:
> 
> 1.. In file included from fort-genvar.c:14:
> 2.. ncfortran.h:26:42: error: NF_INT_IS_C_... not defined: No such
> file or directory
> 
> If we look at configure script and config.h, and ncfortran.h (and
> everywhere else), we can just notice that there is no defined
> NF_INT_IS_C_[INT|LONG], thus the error occurring. It should either have
> generated an error during configure or this #error should say
> ‘unable to determine if fortran int is c int or long.
> 
> How did I produce this error, was just by compiling something that
> won’t run on my own machine. In the case, tried intel fortran on
> a core i7 using instructions for intel AVX.
> 
> 1.. F77=ifort FC=ifort CFLAGS="-O3 -march=native -fPIC -m64" CXXFLAGS="-O3 
> -march=native -fPIC -m64" FCFLAGS="-xSSE4.2,AVX -ip -O3 -parallel -openmp 
> -fPIC -m64" FFLAGS="-xSSE4.2,AVX -ip -O3 -parallel -openmp -fPIC -m64" 
> ./configure --prefix=/home2/marcos/avenger/netcdf/netcdf-411-ifort
> 
> To fix that, all I had to do is drop the ‘,AVX’ from
> the configure line, of course. I reproduced the same error on both
> netcdf 4.1.1 and 4.1.2 beta1.
> 
> I hope this information could be useful for you,
> 
> Fabricio Murta
> 
> 

Howdy Fabricio!

This is one of the known problems with the current fortran API, which is due to 
be replaced next year with new (but fully backward compatible) Fortran APIs.

In the meantime, you may find the configure option  
--disable-fortran-type-check of configure, which turns off these checks and 
requires that you provide the values.

Thanks,

Ed

Ticket Details
===================
Ticket ID: QRV-112021
Department: Support netCDF
Priority: Emergency
Status: Closed