Detect inability to link to netcdf-c library at configure time #124
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #123.
We have been getting some reports of netcdf-fortran build problems with static libraries.
Everyone is using static because pnetcdf now build static-only by default, so anyone including pnetcdf runs into the problem that they cannot build shared libraries if pnetcdf is static-only. The best answer is to rebuild pnetcdf with --enable-shared, but instead, people build netcdf-c and netcdf-fortran with --disable-shared.
Static only builds work fine in netcdf-fortran, but when not all necessary library locations are specified in LDFLAGS, the build fails in a confusing way. Instead of detecting the problem during the configure step, it is ignored by configure and the user sees the problem as a linking error.
The answer is to fail out in configure if the netcdf-c library cannot be linked due to missing arguments in LDFLAGS. This allows the user to sort out their flags and try again.
This PR accomplishes that change.