Skip to content

Issues while building (pio_nc.c) #2001

@coderodyhpc

Description

@coderodyhpc

Hello,
I'm trying to compile v2.6.2 but building generates the error:

/home/ubuntu/pio2/src/clib/pio_nc.c: In function ‘PIOc_def_var_fill’:
/home/ubuntu/pio2/src/clib/pio_nc.c:2433:56: error: ‘_FillValue’ undeclared (first use in this function); did you mean ‘NC_FillValue’?
 2433 |                     ierr = nc_put_att(file->fh, varid, _FillValue, xtype, 1, fill_valuep);
      |                                                        ^~~~~~~~~~
      |                                                        NC_FillValue
/home/ubuntu/pio2/src/clib/pio_nc.c:2433:56: note: each undeclared identifier is reported only once for each function it appears in
/home/ubuntu/pio2/src/clib/pio_nc.c: In function ‘PIOc_inq_var_fill’:
/home/ubuntu/pio2/src/clib/pio_nc.c:2577:52: error: ‘_FillValue’ undeclared (first use in this function); did you mean ‘NC_FillValue’?
 2577 |                 ierr = nc_get_att(file->fh, varid, _FillValue, fill_valuep);
      |                                                    ^~~~~~~~~~
      |                                                    NC_FillValue
make[2]: *** [src/clib/CMakeFiles/pioc.dir/build.make:216: src/clib/CMakeFiles/pioc.dir/pio_nc.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1259: src/clib/CMakeFiles/pioc.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

I saw #1994 and though that maybe using the branch version might fix the issue, but the error still appears. My only potential explanation (or fix) would be the netCDF version, but I would definitely prefer to not have more than one netCDFs in the system.
Thanks.
P.S.

CC=mpicc FC=mpif90 cmake -DPIO_ENABLE_TIMING=OFF -DNetCDF_C_PATH=/opt/atrium/netcdf -DNetCDF_Fortran_PATH=/opt/atrium/netcdf -DPnetCDF_PATH=/opt/atrium/netcdf /home/ubuntu/pio2

-- # PIO Configuration Summary
==============================

# General
-------
PIO Version:            2.6.2
Configured On:          Mon Feb 10 15:02:41 UTC 2025
Host System:            aarch64-Linux-6.8.0-1021-aws
Build Directory:        /home/ubuntu/pio2
Install Prefix:         /usr/local

# Compiling Options
-----------------
C Compiler:             GNU 11.4.0
CFLAGS:                  -std=gnu99
CPPFLAGS:                -DLINUX -DCPRGNU -I/home/ubuntu/pio2 -I/home/ubuntu/pio2/src/clib -I/home/ubuntu/pio2/src/clib -I/home/ubuntu/pio2/src/clib -I/home/ubuntu/pio2/src/clib/../ncint -I/opt/atrium/netcdf/include -I/opt/atrium/netcdf/include
LDFLAGS:
Shared Library:         no
Static Library:         yes
Extra libraries:

Fortran Compiler:       GNU 11.4.0
FFLAGS:                  -fallow-argument-mismatch
FCFLAGS:
More Fortran Flags:      -DLINUX -DCPRGNU -I/home/ubuntu/pio2 -I/home/ubuntu/pio2/src/flib -I/home/ubuntu/pio2/src/flib -I/opt/atrium/netcdf/include -I/opt/atrium/netcdf/include

# Features
--------
PnetCDF Support:        yes
SZIP Write Support:     no
Parallel Filters:       yes
NetCDF/HDF5 Support:    no
NetCDF/HDF5 Par I/O:    yes
NetCDF Integration:     no
PIO Logging:            no
MPIEXEC:                mpiexec
Fortran:                yes

-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/pio2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions