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

Undefined symbol: H5T_NATIVE_SHORT_g #18

Open
adam-nielsen opened this issue Oct 12, 2018 · 2 comments
Open

Undefined symbol: H5T_NATIVE_SHORT_g #18

adam-nielsen opened this issue Oct 12, 2018 · 2 comments

Comments

@adam-nielsen
Copy link
Contributor

If you have compiled the netcdf4 and hdf5 libraries statically (in my case, because I want to deploy to AWS Lambda), then the module is built but it cannot be loaded due to missing symbols:

Error: node_modules/netcdf4/build/Release/netcdf4.node: undefined symbol: H5T_NATIVE_SHORT_g
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:718:18)
    at Module.load (internal/modules/cjs/loader.js:599:32)

It turns out this is due to a missing library dependency in binding.gyp, and the solution is to specify the dependent library:

{
  "targets": [
    {
      "libraries": [
        "-lnetcdf",
        "-lhdf5"       # Must specify
      ],
...

I haven't been able to test this with shared libraries (as my environment is only building static ones) but if it doesn't break the shared library build, could this change be included for the benefit of those using static libraries?

@parro-it
Copy link
Owner

I don't think the change could be harmful, especially because hdf5 lib is already a dependency of netcdf, so this change does not add further pre-reqs.
Would you mind doing a PR?

@adam-nielsen
Copy link
Contributor Author

Sorry for the delay with this, PR created.

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

Successfully merging a pull request may close this issue.

2 participants