Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compile in Debian 10 #399

Open
asterismo opened this issue Apr 18, 2023 · 9 comments
Open

Cannot compile in Debian 10 #399

asterismo opened this issue Apr 18, 2023 · 9 comments
Assignees
Milestone

Comments

@asterismo
Copy link

asterismo commented Apr 18, 2023

I'm trying to compile this library in Debian 10, what version should i build? i'm trying to build netcdf-fortran-4.5.3 and i'm getting this error, but i understand Debian 10 is not the latest version of Debian and 4.5.3 i not the latest version of the library.

I'm trying with these commands:

cd ../netcdf-fortran-4.5.3
export NETCDF=/usr/local
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$NETCDF/lib
./configure --prefix=/usr/local
make
sudo make install

The error is:

-DHAVE_ALLOCA=1 -DHAVE_SSIZE_T=1 -DHAVE_PTRDIFF_T=1 -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=8 -DSIZEOF_FLOAT=4 -DSIZEOF_DOUBLE=8 -DSIZEOF_OFF_T=8 -DSIZEOF_SIZE_T=8 -DSIZEOF_PTRDIFF_T=8 -I. -I. -g -O2 -c module_netcdf_nf_interfaces.F90 -o module_netcdf_nf_interfaces.o >/dev/null 2>&1
/bin/bash ../libtool --tag=FC --mode=compile gfortran -I. -g -O2 -c -o module_netcdf_f03.lo module_netcdf_f03.f90
libtool: compile: gfortran -I. -g -O2 -c module_netcdf_f03.f90 -fPIC -o .libs/module_netcdf_f03.o
f951: Fatal Error: Reading module ‘netcdf_nf_interfaces’ at line 1834 column 18: Unexpected EOF
compilation terminated.
make[1]: *** [Makefile:797: module_netcdf_f03.lo] Error 1
make[1]: se sale del directorio '/nfs/home/cluster/instaladores/netcdf-fortran-4.5.3/fortran'
make: *** [Makefile:581: all-recursive] Error 1
cluster@cebollati:~/instaladores/netcdf-fortran-4.5.3$ gfortran --version
GNU Fortran (Debian 8.3.0-6) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@asterismo
Copy link
Author

I also tried to compile netcdf-c-4.9.2 apparently no problem, and when trying to build netcdf-fortran-4.6.0 i get this error:

any ideas? thanks

E_VPRINTF=1 -DHAVE__BOOL=1 -DHAVE_STDBOOL_H=1 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DHAVE_SSIZE_T=1 -DHAVE_PTRDIFF_T=1 -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=8 -DSIZEOF_FLOAT=4 -DSIZEOF_DOUBLE=8 -DSIZEOF_OFF_T=8 -DSIZEOF_SIZE_T=8 -DSIZEOF_PTRDIFF_T=8 -I. -I. -g -O2 -c module_netcdf_nf_data.F90 -fPIC -o .libs/module_netcdf_nf_data.o
module_netcdf_nf_data.F90:167:54:

Integer, Parameter :: NF_NOQUANTIZE = NC_NOQUANTIZE
1
Error: Symbol 'nc_noquantize' at (1) has no IMPLICIT type; did you mean 'nf_noquantize'?
module_netcdf_nf_data.F90:168:67:

Integer, Parameter :: NF_QUANTIZE_BITGROOM = NC_QUANTIZE_BITGROOM
1
Error: Symbol 'nc_quantize_bitgroom' at (1) has no IMPLICIT type; did you mean 'nf_quantize_bitgroom'?
make[1]: *** [Makefile:765: module_netcdf_nf_data.lo] Error 1
make[1]: se sale del directorio '/nfs/home/cluster/instaladores/netcdf-fortran-4.6.0/fortran'
make: *** [Makefile:587: all-recursive] Error 1

@WardF
Copy link
Member

WardF commented Apr 18, 2023

Thanks; I'm taking a look at this now.

@WardF WardF self-assigned this Apr 18, 2023
@WardF WardF added this to the 4.6.1 milestone Apr 18, 2023
@WardF
Copy link
Member

WardF commented Apr 19, 2023

Can you provide the config.log file for netcdf-fortran, and the libnetcdf.settings file generated by your libnetcdf install? I'm having issues recreating this in a local Debian 10 environment.

@hs-safl
Copy link

hs-safl commented May 25, 2023

I think I also have similar problems associated with these statements.
My system environment: CentOS7, Intel compiler version 2021.5.0

The error message says:

module_netcdf_nf_data.F90(167): error #6592: This symbol must be a defined parameter, an enumerator, or an argument of an inquiry function that evaluates to a compile-time constant. [NC_NOQUANTIZE]
Integer, Parameter :: NF_NOQUANTIZE = NC_NOQUANTIZE
-----------------------------------------^
module_netcdf_nf_data.F90(168): error #6592: This symbol must be a defined parameter, an enumerator, or an argument of an inquiry function that evaluates to a compile-time constant. [NC_QUANTIZE_BITGROOM]
Integer, Parameter :: NF_QUANTIZE_BITGROOM = NC_QUANTIZE_BITGROOM
-----------------------------------------------^
module_netcdf_nf_data.F90(167): error #6404: This name does not have a type, and must have an explicit type. [NC_NOQUANTIZE]
Integer, Parameter :: NF_NOQUANTIZE = NC_NOQUANTIZE
-----------------------------------------^
module_netcdf_nf_data.F90(168): error #6404: This name does not have a type, and must have an explicit type. [NC_QUANTIZE_BITGROOM]
Integer, Parameter :: NF_QUANTIZE_BITGROOM = NC_QUANTIZE_BITGROOM
-----------------------------------------------^

I attached bash scripts, error, and output log and config.log, libnetcdf.settings in a zip file.

config.log
netcdf_fortran_log.zip

@WardF
Copy link
Member

WardF commented May 25, 2023

Thank you; I'm wondering if this is specific to the Intel compiler; I don't have access to those, although I've recently learned there are versions I may be able to use. Do you see the same issue if you try using gcc/gfortran?

@WardF WardF modified the milestones: 4.6.1, 4.6.2 May 31, 2023
@mcopik
Copy link

mcopik commented Jul 24, 2023

I'm experiencing the same issue with gfortran 11.3.

module_netcdf_nf_data.F90:167:54:

  167 |  Integer, Parameter :: NF_NOQUANTIZE   = NC_NOQUANTIZE
      |                                                      1
Error: Symbol ‘nc_noquantize’ at (1) has no IMPLICIT type; did you mean ‘nf_noquantize’?
module_netcdf_nf_data.F90:168:67:

  168 |  Integer, Parameter :: NF_QUANTIZE_BITGROOM  = NC_QUANTIZE_BITGROOM
      |                                                                   1
Error: Symbol ‘nc_quantize_bitgroom’ at (1) has no IMPLICIT type; did you mean ‘nf_quantize_bitgroom’?

@WardF
Copy link
Member

WardF commented Jul 24, 2023

I'll take a look at this; thanks for confirming use case with gfortran. I'll stand up a dev environment and see what I'm able to sort out.

@mcopik
Copy link

mcopik commented Jul 24, 2023

@WardF For what's it worth, I installed netcdf-c 4.9.2 with quantization support - at least that's according to the config.log. Not sure about the actual installation, as nc-config claims there's neither --has-quantize nor --has-quanitze flag (the latter comes from a typo in the list displayed by --help).

@lastephey
Copy link

I'm seeing the same thing trying to build in an Ubuntu jammy container with gfortran, netcdf-4.9.2, and netcdf-fortran-4.6.1.

FROM docker.io/ubuntu:jammy

RUN \
    apt-get update        && \
    apt-get upgrade --yes && \
    apt-get install --yes    \
        build-essential      \
        cmake                \
        gfortran             \
        libblas-dev          \
        liblapack-dev        \
        libcurl4-gnutls-dev  \
        libxml2-dev          \
        m4                   \
        pkg-config           \
        python3-dev          \
        python3-pip          \
        wget                 \
        vim              &&  \
    apt-get clean all    &&  \
    rm -rf /var/lib/apt/lists/*

...

#install netcdf c
ENV NCDIR=/opt/netcdf-c
ARG netcdf_c_version=4.9.2
RUN wget https://github.com/Unidata/netcdf-c/archive/refs/tags/v$netcdf_c_version.tar.gz && \
    tar xvzf v$netcdf_c_version.tar.gz                                           && \
    cd netcdf-c-$netcdf_c_version                                                && \
    ./configure --prefix=$NCDIR --disable-hdf5 && \
    make && \
    make install

ENV LD_LIBRARY_PATH=$NCDIR/lib:$LD_LIBRARY_PATH

#install netcdf fortran
ENV NFDIR=/opt/netcdf-fortran
ARG netcdf_fortran_version=4.6.1
RUN wget https://github.com/Unidata/netcdf-fortran/archive/refs/tags/v$netcdf_fortran_version.tar.gz && \
    tar xvzf v$netcdf_fortran_version.tar.gz                                           && \
    cd netcdf-fortran-$netcdf_fortran_version                                                && \
    CPPFLAGS=-I${NCDIR}/include LDFLAGS=-L${NCDIR}/lib ./configure --prefix=$NFDIR --disable-fortran-type-check && \
    make && \
    make install
libtool: compile:  gfortran -DPACKAGE_NAME=\"netCDF-Fortran\" -DPACKAGE_TARNAME=\"netcdf-fortran\" -DPACKAGE_VERSION=\"4.6.1\" "-DPACKAGE_STRING=\"netCDF-Fortran 4.6.1\"" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DPACKAGE=\"netcdf-fortran\" -DVERSION=\"4.6.1\" -DNF_RELAX_COORD_BOUND=1 -DENABLE_CDF5=1 -DNF_HAS_QUANTIZE=1 -DHAVE_F2008=1 -DHAVE_TS29113_SUPPORT=1 -DTEMP_LARGE=\".\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_TIME_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DNCBYTE_T=byte "-DNCSHORT_T=integer*2" -DNF_INT1_T=byte "-DNF_INT2_T=integer*2" "-DNF_INT8_T=integer*8" -DNF_INT1_IS_C_SIGNED_CHAR=1 -DNF_INT2_IS_C_SHORT=1 -DNF_INT_IS_C_INT=1 -DNF_INT8_IS_C_LONG_LONG=1 -DNF_REAL_IS_C_FLOAT=1 -DNF_DOUBLEPRECISION_IS_C_DOUBLE=1 -DHAVE_LIBM=1 -DHAVE_NETCDF_H=1 -DHAVE_NC_DEF_OPAQUE=1 -DHAVE_NCCREATE=1 -DHAVE_NC_SET_LOG_LEVEL=1 -DHAVE_OC_OPEN=1 -DHAVE_NC_DEF_VAR_SZIP=1 -DLOGGING=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_LOCALE_H=1 -DHAVE_STDIO_H=1 -DHAVE_STDARG_H=1 -DHAVE_ERRNO_H=1 -DHAVE_CTYPE_H=1 -DHAVE_FCNTL_H=1 -DHAVE_MALLOC_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_STRINGS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_GETOPT_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_RESOURCE_H=1 -DHAVE_DIRENT_H=1 -DHAVE_SYS_WAIT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_VPRINTF=1 -DHAVE__BOOL=1 -DHAVE_STDBOOL_H=1 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DHAVE_SSIZE_T=1 -DHAVE_PTRDIFF_T=1 -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=8 -DSIZEOF_FLOAT=4 -DSIZEOF_DOUBLE=8 -DSIZEOF_OFF_T=8 -DSIZEOF_SIZE_T=8 -DSIZEOF_PTRDIFF_T=8 -I. -I/opt/netcdf-c/include -I. -g -O2 -fallow-argument-mismatch -c module_netcdf_nf_data.F90  -fPIC -o .libs/module_netcdf_nf_data.o
module_netcdf_nf_data.F90:167:54:

  167 |  Integer, Parameter :: NF_NOQUANTIZE   = NC_NOQUANTIZE
      |                                                      1
Error: Symbol 'nc_noquantize' at (1) has no IMPLICIT type; did you mean 'nf_noquantize'?
module_netcdf_nf_data.F90:168:67:

  168 |  Integer, Parameter :: NF_QUANTIZE_BITGROOM  = NC_QUANTIZE_BITGROOM
      |                                                                   1
Error: Symbol 'nc_quantize_bitgroom' at (1) has no IMPLICIT type; did you mean 'nf_quantize_bitgroom'?
make[1]: *** [Makefile:766: module_netcdf_nf_data.lo] Error 1
make[1]: Leaving directory '/opt/netcdf-fortran-4.6.1/fortran'
make: *** [Makefile:588: all-recursive] Error 1
Error: building at STEP "RUN wget https://github.com/Unidata/netcdf-fortran/archive/refs/tags/v$netcdf_fortran_version.tar.gz &&     tar xvzf v$netcdf_fortran_version.tar.gz                                           &&     cd netcdf-fortran-$netcdf_fortran_version                                                &&     CPPFLAGS=-I${NCDIR}/include LDFLAGS=-L${NCDIR}/lib ./configure --prefix=$NFDIR --disable-fortran-type-check &&     make &&     make install": while running runtime: exit status 2

Just through trial and error I found I could get netcdf-fortran 4.5.3 to build with netcdf-c 4.8.0. Are there any known good combinations of these libraries for Debian?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants