[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[netCDF #JRL-687884]: Netcdf-fortran error while compiling. "configure: error: cannot compute sizeof (off_t)"
- Subject: [netCDF #JRL-687884]: Netcdf-fortran error while compiling. "configure: error: cannot compute sizeof (off_t)"
- Date: Wed, 28 Feb 2024 12:11:39 -0700
Hello,
Thank you for reaching out, and for providing the config.log files. From the
contents of the netCDF-Fortran config file, I suspect that the linker is not
able to locate libnetcdf at runtime, when trying to compile the tests it uses
to determine other aspects of the environment. You may be able to fix this by
specifying the LD_LIBRARY_PATH when configuring netCDF-Fortran, thusly:
$ LD_LIBRARY_PATH='/home/raj/gcc/netcdf-c-4.7.4/codes/lib'
CPPFLAGS='-I/home/raj/gcc/netcdf-c-4.7.4/codes/include'
LDFLAGS='-L/home/raj/gcc/netcdf-c-4.7.4/codes/lib' ./configure
--prefix=/home/raj/gcc/netcdf-c-4.7.4/codes
If this works, you may need to set this as a persistent environmental variable,
in order to avoid 'missing library' errors any time you run a program which is
linked against libnetcdf.
I hope this helps!
-Ward
> Hello Team,
>
> Greeting of the day.
>
> I really don't know how to solve this error I unable to find in google as
> well, I was trying to compile netcdf, netcdf-cxx & netcdf-fortran with gcc
> compiler "GCC-11".
>
> I am able to successfully compiled netcdf-c-4.7.4 & netcdf-cxx4-4.2.1 but I
> am unable to compile netcdf-fortran-4.5.3 .
>
> Below I am sharing the steps how I have compiled netcdf-c-4.7.4 and when I am
> starting the compilation of "netcdf-fortran I am getting strange error".
>
> I have attached the both logs of netcdf-c-4.7.4 dependencies of
> "netcdf-fortran-4.5.3"
>
> Step 1- NETCDF-C-4.7.4
>
> $ CPPFLAGS='-I/home/raj/gcc/hdf5-1.12.0/codes/include
> -I/home/raj/gcc/zlib-1.3.1/codes/include'
> LDFLAGS='-L/home/raj/gcc/hdf5-1.12.0/codes/lib
> -L/home/raj/gcc/zlib-1.3.1/codes/lib' ./configure
> --prefix=/home/raj/gcc/netcdf-c-4.7.4/codes
>
> $ make -j2
> $ make install
>
> ## NETCDF-C-4.7.4 was compiled successfully without any error.
>
> Step 2 - netcdf-fortran-4.5.3
>
> $ CPPFLAGS='-I/home/raj/gcc/netcdf-c-4.7.4/codes/include'
> LDFLAGS='-L/home/raj/gcc/netcdf-c-4.7.4/codes/lib' ./configure
> --prefix=/home/raj/gcc/netcdf-c-4.7.4/codes
>
> ## while running configure I am getting below error:-
>
> checking for longlong... no
> checking whether char is unsigned... no
> checking size of short... 0
> checking size of int... 0
> checking size of long... 0
> checking size of float... 0
> checking size of double... 0
> checking size of off_t... configure: error: in
> `/home/raj/gcc/netcdf-fortran-4.5.3':
> configure: error: cannot compute sizeof (off_t)
> See `config.log' for more details
> [raj@utility06 netcdf-fortran-4.5.3]$
>
>
>
>
>
> Thanks & Regards,
> Raj Kumar Sharma
> address@hidden<mailto:address@hidden>
> Mobile no. 8794236178
> [cid:image001.gif@01DA69A0.B2AFF210]
>
>
>
Ticket Details
===================
Ticket ID: JRL-687884
Department: Support netCDF
Priority: Normal
Status: Closed
===================
NOTE: All email exchanges with NSF Unidata User Support are recorded in the
Unidata inquiry tracking system and then made publicly available through the
web. If you do not want to have your interactions made available in this way,
you must let us know in each email you send to us.