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

Issues while building (pio_nc.c) #2001

Open
coderodyhpc opened this issue Feb 10, 2025 · 14 comments
Open

Issues while building (pio_nc.c) #2001

coderodyhpc opened this issue Feb 10, 2025 · 14 comments

Comments

@coderodyhpc
Copy link

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

@jedwards4b
Copy link
Contributor

The latest version of the netcdf library has changed this, however you can enable legacy symbols by building with NETCDF_ENABLE_LEGACY_MACROS. See

https://github.com/Unidata/netcdf-c/blob/main/include/netcdf.h#L118

@jedwards4b
Copy link
Contributor

Please try with branch github.com:jedwards4b/ParallelIO.git
dc7329f..2a5086e fillvalue_fix.wif -> fillvalue_fix.wif
and let me know if it works.

@coderodyhpc
Copy link
Author

I tried recompiling netCDF-c with the flag --enable-unsafe-macros but still got the error while building. Let me try your 2nd suggestion and I will let you know.

@coderodyhpc
Copy link
Author

coderodyhpc commented Feb 10, 2025

@jedwards4b. Sorry, I can see your commit (with 10 modified files) but cannot clone the branch (there is a message indicating 'This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.').
P.S. Github indicates that one of the checks is pending, maybe I just need to wait a few minutes).

@jedwards4b
Copy link
Contributor

It is a fork, the repo is https://github.com/jedwards4b/ParallelIO.git
add the remote with
git remote add jpedev https://github.com/briandobbins/ParallelIO.git

@coderodyhpc
Copy link
Author

I'm unfamiliar with git remote so I might be doing something wrong (not sure). I tried several combinations such as:

$ git clone https://github.com/jedwards4b/ParallelIO
$ cd ParallelIO
$ git remote add jpedev https://github.com/briandobbins/ParallelIO.git
$ git fetch jpedev 
$ git switch -c jpedev
From https://github.com/briandobbins/ParallelIO
 * [new branch]        add_2GiB_local_contig_data_limit -> jpedev/add_2GiB_local_contig_data_limit
...
 * [new tag]           pio1_7_3                         -> pio1_7_3
Switched to a new branch 'jpedev'

At this point, trying cmake and make results in the same error as earlier (the only very minor difference is that the building breaks at 34% versus 30% as in the original build).

@jedwards4b
Copy link
Contributor

After the git fetch command you should just
checkout the branch with
git checkout fillvalue_fix.wif

@coderodyhpc
Copy link
Author

It seems to have gone over that bump but it's now generating the error:

[ 82%] Building Fortran object src/flib/CMakeFiles/piof.dir/pio.F90.o
/home/ubuntu/ParallelIO/src/flib/pio.F90:78:22:

   78 |        PIO_def_var   ,        &
      |                      1
Error: Symbol ‘pio_def_var_zstandard’ referenced at (1) not found in module ‘pio_nf’
/home/ubuntu/ParallelIO/src/flib/pio.F90:88:33:

   88 |        PIO_inq_var_quantize     , &
      |                                 1
Error: Symbol ‘pio_inq_var_filter_ids’ referenced at (1) not found in module ‘pio_nf’
/home/ubuntu/ParallelIO/src/flib/pio.F90:90:33:

   90 |        PIO_inq_var_filter_ids   , &
      |                                 1
Error: Symbol ‘pio_inq_var_filter_info’ referenced at (1) not found in module ‘pio_nf’
/home/ubuntu/ParallelIO/src/flib/pio.F90:91:33:

   91 |        PIO_inq_var_filter_info  , &
      |                                 1
Error: Symbol ‘pio_inq_filter_avail’ referenced at (1) not found in module ‘pio_nf’
/home/ubuntu/ParallelIO/src/flib/pio.F90:92:33:

   92 |        PIO_inq_filter_avail     , &
      |                                 1
Error: Symbol ‘pio_def_var_szip’ referenced at (1) not found in module ‘pio_nf’
make[2]: *** [src/flib/CMakeFiles/piof.dir/build.make:104: src/flib/CMakeFiles/piof.dir/pio.F90.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1350: src/flib/CMakeFiles/piof.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

@jedwards4b
Copy link
Contributor

I'm sorry, this must be why it got lost instead of being merged. I'll have to work on it and get back to you.

@coderodyhpc
Copy link
Author

OK.

@jedwards4b
Copy link
Contributor

I'm unable to reproduce your problem. I do have a newer gnu compiler than you are using, but I'm not sure what the difference might be otherwise.

One possible cause might be the hdf5 version on which netcdf was built. I am using hdf5/1.12.3, if you are using a 1.14 version of hdf5 this may be the problem.

# General
-------
PIO Version:		2.6.2
Configured On:		Tue 11 Feb 2025 06:55:30 AM MST
Host System:		x86_64-Linux-5.14.21-150400.24.18-default
Build Directory: 	/glade/u/home/jedwards/sandboxes/ParallelIO/bldn493
Install Prefix:         /usr/local

# Compiling Options
-----------------
C Compiler:		GNU 12.4.0
CFLAGS:			 -std=gnu99  
CPPFLAGS:		 -DLINUX -DCPRGNU -DTIMING -I/glade/u/home/jedwards/sandboxes/ParallelIO/bldn493 -I/glade/u/home/jedwards/sandboxes/ParallelIO/src/clib -I/glade/u/home/jedwards/sandboxes/ParallelIO/bldn493/src/clib -I/glade/u/home/jedwards/sandboxes/ParallelIO/src/clib -I/glade/u/home/jedwards/sandboxes/ParallelIO/src/clib/../ncint -I/glade/u/apps/derecho/24.12/spack/opt/spack/netcdf/4.9.3/gcc/12.4.0/jt7q/include
LDFLAGS:		 
Shared Library:		no
Static Library:		yes
Extra libraries:	

Fortran Compiler:       GNU 12.4.0
FFLAGS:                  -fallow-argument-mismatch
FCFLAGS:                
More Fortran Flags:	 -DLINUX -DCPRGNU -I/glade/u/home/jedwards/sandboxes/ParallelIO/bldn493 -I/glade/u/home/jedwards/sandboxes/ParallelIO/src/flib -I/glade/u/home/jedwards/sandboxes/ParallelIO/bldn493/src/flib -I/glade/u/apps/derecho/24.12/spack/opt/spack/netcdf/4.9.3/gcc/12.4.0/jt7q/include

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

@coderodyhpc
Copy link
Author

Yes, I'm using HDF5 v1.14.5. The compiler is not so new because the OS is still Ubuntu 22.04 (will migrate to Ubuntu 24.04 in the next few days).
P.S. As a temporal solution, I did which I said I wanted to avoid and installed netCDF-c v4.9.2 (compartmentalized in a different directory). Then, PIO built smoothly.

@jedwards4b
Copy link
Contributor

I will have a pio 2.6.5 soon with a port to netcdf v4.9.3. Are you still using hdf5 v1.14.5 with your netcdf v4.9.2 build? Let me know if you have more issues, but the first thing I would suspect is HDF5.

@coderodyhpc
Copy link
Author

@jedwards4b, hdf5 v1.14.5, netcdf v4.9.2 and PIO v2.6.2 seem to be working well together, no problem thus far.

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

2 participants