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

NetCFD and ExodusII incompatibility #4050

Open
pbehne opened this issue Jan 16, 2025 · 2 comments
Open

NetCFD and ExodusII incompatibility #4050

pbehne opened this issue Jan 16, 2025 · 2 comments

Comments

@pbehne
Copy link

pbehne commented Jan 16, 2025

When building version 5a56603 of libMesh, I get the following error:

../../../../../contrib/exodusii/v8.11/exodus/src/ex_utils.c:1773:19: error: expected identifier or '(' const int NC_SZIP_NN = 32; /* Selects nearest neighbor coding method for szip. */ ^ ../../../../../contrib/netcdf/netcdf-c/include/netcdf.h:332:20: note: expanded from macro 'NC_SZIP_NN' #define NC_SZIP_NN 32 /**< SZIP NN option mask. */ ^ 1 error generated. make[2]: *** [Makefile:11115: src/libdbg_la-ex_utils.lo] Error 1 make[2]: Leaving directory '/Users/behnpa/projects/libmesh/build/contrib/exodusii/v8.11/exodus' make[1]: *** [Makefile:1056: all-recursive] Error 1 make[1]: Leaving directory '/Users/behnpa/projects/libmesh/build/contrib' make: *** [Makefile:34349: all-recursive] Error 1

I configured using
../configure --with-methods="opt devel dbg" --prefix=/Users/behnpa/projects/libmesh/installed --enable-silent-rules --enable-unique-id --disable-warnings --enable-openmp --disable-maintainer-mode --enable-paranoid-warnings --enable-werror --enable-everything --disable-strict-lgpl --enable-hdf5 --enable-hdf5-required --enable-netcdf=v492

@jwpeterson
Copy link
Member

This definitely looks like an issue to me; I'm not sure why we have not encountered it previously.

There is a variable being defined on line 1773 of ex_utils.c:

        const int NC_SZIP_NN = 32;      /* Selects nearest neighbor coding method for szip. */

which has the exact same name as a netcdf define set on Line 332 in netcdf.h:

#define NC_SZIP_NN 32 /**< SZIP NN option mask. */

So, a very simple thing to try would be to just comment out that line of ex_utils.c and see if the error goes away.

Another possible fix would be to configure with --enable-netcdf=v462, since the netcdf.h header file in that version does not seem to have the conflicting define.

@roystgnr it looks like contrib/exodus/v8.11 is just a normal directory and not a submodule... are we patching that locally or do you think it would be better to go find whatever the next 8.xx release version of Exodus is and try updating to that? The latter definitely sounds like more work, but I don't like the idea of forking v8.11 either...

@roystgnr
Copy link
Member

When I looked into it, it looked like it only was triggering in cases where NetCDF is configured to define NC_HAS_SZIP_WRITE as 1, which I guessed was probably something autodetected that most people don't have on their systems, but that was just a brief glance/guess. I asked @pbehne to file this issue so I wouldn't forget the problem completely by the time I found time to look at it again.

I love the idea of bringing in Exodus as a git submodule, but I'm not sure how to make it work. The first catch is that we use our own Makefile.am etc, not their cmake build system, and our files would require a little bit of tweaking to make them work from outside their directories. That's not a show-stopper; I think doing it with Exodus would be easier than doing it with poly2tri was. The second catch, though, is that ExodusII doesn't have a git repository, it has a subdirectory of a git repository. Is there a way to pick out a subdirectory of a repository as a submodule? I vaguely recall being able to do something like that with Subversion but being disappointed when I tried to figure out how to accomplish the same thing with git.

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

3 participants