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

NetCDF-C doesn't compile under Visual Studio 2015 when using hdf5 1.8.16 #186

Closed
WardF opened this issue Jan 5, 2016 · 4 comments
Closed

Comments

@WardF
Copy link
Member

WardF commented Jan 5, 2016

Visual Studio 2015 fails to build netcdf. Part of this is because VS2015 now uses snprintf, which was previously defined. Not the source of this bug, but some background is provided:

There is also a weird linking error that I haven't investigated yet.

Addressing this on branch VS14.

@WardF
Copy link
Member Author

WardF commented Jan 6, 2016

Here's what I've sorted out so far:

  • Using hdf5 1.8.16, something in their cmake configuration is "slippery"; cmake detects the hdf5 library when configuring netcdf to be built with visual studio, but it is not added to the dependency list. I'm trying to sort this out.
  • Trying to build hdf5 1.8.15 with Visual Studio 2015 fails with some odd errors that I'm not going to debug.
  • Using hdf5 1.8.15 built with Visual Studio 2013 works just fine; cmake detects and uses them as expected when configuring and building netcdf.

@WardF WardF changed the title NetCDF-C doesn't compile under Visual Studio 2015 NetCDF-C doesn't compile under Visual Studio 2015 when using hdf5 1.8.16 Jan 7, 2016
@WardF
Copy link
Member Author

WardF commented Jan 7, 2016

In Windows, using Visual Studio 2013 or 2015, and configuring netcdf with cmake, the following behavior is observed when invoking FIND_PACKAGE(HDF5 COMPONENTS C HL NO_MODULE REQUIRED):

  • HDF5 1.8.15: The import libraries for hdf5.dll and hdf5_hl.dll are captured in HDF5_LIBRARIES.
  • HDF5 1.8.16: The import libraries are _not_ captured in HDF5_LIBRARIES, nor in any of the other HDF5_ definition that I can identify.

This happens even when H5_BUILT_AS_DYNAMIC_LIB is defined.

@WardF WardF modified the milestones: 4.4.1, 4.4.0 Jan 7, 2016
WardF added a commit that referenced this issue Jan 7, 2016
…aries. Required as part of hdf5 1.8.16, and is documented in #186
@WardF
Copy link
Member Author

WardF commented Jan 7, 2016

Fixed in branch VS14. Here's the issue:

FIND_PACKAGE must now specify 'static' or 'shared', e.g.:

FIND_PACKAGE(HDF5 COMPONENTS C HL NO_MODULE REQUIRED)

becomes

FIND_PACKAGE(HDF5 COMPONENTS C HL NO_MODULE REQUIRED shared)

Fix is pending travis tests. When passed I will merge and close out this issue.

@WardF
Copy link
Member Author

WardF commented Jan 8, 2016

Issue was a little more complicated but is now fixed. I've also refactored the netCDF CMakeLists.txt file so that it is a little more readable.

@WardF WardF closed this as completed Jan 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant