NCAR / ParallelIO

A high-level Parallel I/O Library for structured grid applications
Apache License 2.0
134 stars 52 forks source link

Bug fix examples/c/piorcw.c #1965

Closed t-brown closed 1 year ago

t-brown commented 1 year ago

Compilation fails due to errors in examples/c/piorcw.c.

[ 95%] Building C object examples/c/CMakeFiles/piorcw.dir/piorcw.c.o
/home/ec2-user/ParallelIO-pio2_6_0/examples/c/piorcw.c(112): error: "ndims" has already been declared in the current scope
      int ndims, nvars, natts, unlimdim;
          ^

/home/ec2-user/ParallelIO-pio2_6_0/examples/c/piorcw.c(125): error: identifier "i" is undefined
      for(i=0; i<ndims; i++){
          ^

/home/ec2-user/ParallelIO-pio2_6_0/examples/c/piorcw.c(134): error: identifier "myvarname" is undefined
      if(myvarname != NULL)
         ^

/home/ec2-user/ParallelIO-pio2_6_0/examples/c/piorcw.c(224): error: incomplete type is not allowed
      struct arguments arguments;
                       ^

compilation aborted for /home/ec2-user/ParallelIO-pio2_6_0/examples/c/piorcw.c (code 2)
make[2]: *** [examples/c/CMakeFiles/piorcw.dir/piorcw.c.o] Error 2
make[1]: *** [examples/c/CMakeFiles/piorcw.dir/all] Error 2
make: *** [all] Error 2

Note there is still a warning when compiling piorcw:

/home/ec2-user/ParallelIO/examples/c/piorcw.c(126): warning #167: argument of type "int" is incompatible with parameter of type "MPI_Offset={long long} *"
          ierr = PIOc_inq_dim(ncid, i, dim[i].name, dim[i].value);

This PR fixes issue #1964

jedwards4b commented 1 year ago

I've run into this issue with the spack build before - it seems that sometimes it wants parallelio@=develop instead of parallelio@develop.

jedwards4b commented 1 year ago

Addressed in other PRs