Opened 7 years ago

Closed 7 years ago

#54049 closed defect (fixed)

ncview links against wrong hdf5

Reported by: aaschwanden (Andy Aschwanden) Owned by: seanfarley (Sean Farley)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: ncview

Description (last modified by mf2k (Frank Schima))

This is a follow-up to: #54035

Re libpng.so vs libpng.dylib: My solution was to patch the configure file, replacing libpng.so with libpng.dylib

Today I upgraded one of my systems and got the ncview update, which (again) got me into the hdf5-18 vs hdf5 port hell. I hope the pytables port will be updated soon so it's compatible with hdf5 1.10 (akaik, that's the only port that still needs hdf5-18).

Anyway, while the current portfile appears to invoke the hdf5-18 libs:

# seems that nc-config doesn't provide hdf5-18's lib path?
configure.ldflags-append -L${prefix}/lib/hdf5-18/lib

the compiled binary still links to the wrong hdf5:

$ otool -L  /opt/local/bin/ncview 
/opt/local/bin/ncview:
	/opt/local/lib/libpng16.16.dylib (compatibility version 46.0.0, current version 46.0.0)
	/opt/local/lib/libudunits2.dylib (compatibility version 0.0.0, current version 0.0.0)
	/opt/local/lib/libexpat.1.dylib (compatibility version 8.0.0, current version 8.2.0)
	/opt/local/lib/libnetcdf.11.dylib (compatibility version 11.0.0, current version 11.3.0)
	/opt/local/lib/libhdf5_hl.100.dylib (compatibility version 101.0.0, current version 101.0.0)
	/opt/local/lib/libhdf5.100.dylib (compatibility version 101.0.0, current version 101.1.0)

leading to

$ Ncview 2.1.7 David W. Pierce  29 March 2016
http://meteora.ucsd.edu:80/~pierce/ncview_home_page.html
Copyright (C) 1993 through 2015, David W. Pierce
Ncview comes with ABSOLUTELY NO WARRANTY; for details type `ncview -w'.
This is free software licensed under the Gnu General Public License version 3; type `ncview -c' for redistribution details.

Warning! ***HDF5 library version mismatched error***
The HDF5 header files used to compile this application do not match
the version used by the HDF5 library to which this application is linked.
Data corruption or segmentation faults may occur if the application continues.
This can happen when an application was compiled by one version of HDF5 but
linked with a different version of static or shared HDF5 library.
You should recompile the application or check your shared library related
settings such as 'LD_LIBRARY_PATH'.
You can, at your own risk, disable this warning by setting the environment
variable 'HDF5_DISABLE_VERSION_CHECK' to a value of '1'.
Setting it to 2 or higher will suppress the warning messages totally.
Headers are 1.8.18, library is 1.10.0
	    SUMMARY OF THE HDF5 CONFIGURATION
	    =================================

General Information:
-------------------
                   HDF5 Version: 1.10.0-patch1
                  Configured on: Wed Feb 22 14:21:02 AKST 2017
                  Configured by: macports@bergseeschjien-2.local
                    Host system: x86_64-apple-darwin16.3.0
              Uname information: Darwin bergseeschjien-2.local 16.3.0 Darwin Kernel Version 16.3.0: Thu Nov 17 20:23:58 PST 2016; root:xnu-3789.31.2~1/RELEASE_X86_64 x86_64
                       Byte sex: little-endian
             Installation point: /opt/local

I'm afraid I don't know how to fix this. For now, I'll have to restore my system from a backup.

Change History (5)

comment:1 Changed 7 years ago by mf2k (Frank Schima)

Cc: thiagoveloso removed
Description: modified (diff)
Owner: set to thiagoveloso
Status: newassigned

comment:2 Changed 7 years ago by seanfarley (Sean Farley)

Owner: changed from thiagoveloso to seanfarley
Status: assignedaccepted

Thanks for the report. I'll look into fixing my mess.

comment:3 Changed 7 years ago by seanfarley (Sean Farley)

Is your /opt/local/include/hdf5.h correct? I think I have a fix for this but I'm unable to reproduce.

comment:4 Changed 7 years ago by seanfarley (Sean Farley)

Or perhaps you have some hdf5 in /usr/local?

comment:5 Changed 7 years ago by seanfarley (Sean Farley)

Resolution: fixed
Status: acceptedclosed

In bb36778f8f2e2a426abea85cfa728cf8a88cf00f/macports-ports:

ncview: fix incorrect builds with hdf5 1.10

Closes: #54049

Note: See TracTickets for help on using tickets.