Make statically linked executable with version 1.8.14

While building an executable based on the netcdf library (built upon HDF version 1.8.14) I encountered the issue originating from not supplying -ldl option to the linker to resolve all the symbols needed by the underlying HDF library. This was a surprise to me as to the best of my recollection, I don’t recall having to supply this option to linkers in the previous versions. In fact when i build netcdf applications on my mac (with HDF version 1.8.11) I don’t supply -ldl to resolve symbols.

So I tried to compile a static version of HDF in hopes that I won’t have to link to dl, but that didn’t help either. My question is then - is it not possible to make a completely static executable? Furthermore, why does the linking work without -ldl on my mac with version 1.8.11, but fails on ubuntu with version 1.8.14? The netcdf version is different between these machines - on my mac it is 4.30 and on ubuntu it is 4.32, does this make a difference?

Thank you,
— Deepak

Deepak,

Dynamically loaded filters feature was added in 1.8.12. It needs the dl library
and the dlopen function. Configure searches for dlopen and sets a configure
variable in h5pubconf.h.

I will enter an issue into our bug database concerning a way to disable dl
support.

Allen

···

On Monday, November 17, 2014 10:05:03 AM Deepak Chandan wrote:

While building an executable based on the netcdf library (built upon HDF
version 1.8.14) I encountered the issue originating from not supplying -ldl
option to the linker to resolve all the symbols needed by the underlying
HDF library. This was a surprise to me as to the best of my recollection, I
don’t recall having to supply this option to linkers in the previous
versions. In fact when i build netcdf applications on my mac (with HDF
version 1.8.11) I don’t supply -ldl to resolve symbols.

So I tried to compile a static version of HDF in hopes that I won’t have to
link to dl, but that didn’t help either. My question is then - is it not
possible to make a completely static executable? Furthermore, why does the
linking work without -ldl on my mac with version 1.8.11, but fails on
ubuntu with version 1.8.14? The netcdf version is different between these
machines - on my mac it is 4.30 and on ubuntu it is 4.32, does this make a
difference?

Thank you,
— Deepak
_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5