Opened 4 months ago

Closed 4 months ago

Last modified 4 months ago

#69207 closed defect (fixed)

hdf5 package installs but h5fc fails with ld: library not found for -lsz

Reported by: Michael-P-Allen (Mike Allen) Owned by: eborisch (Eric A. Borisch)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: hdf5

Description

Installing with sudo port install hdf5 succeeds (log file attached for reference). However the Fortran wrapper script h5fc provided by the package fails:

h5fc hello.f90 
ld: library not found for -lsz
collect2: error: ld returned 1 exit status

A workaround is to include -L/opt/local/lib/libaec/lib on the h5fc command line, but the wrapper script should handle this. The command line actually invoked by h5fc is

h5fc -show
/opt/local/bin/gfortran-mp-13 -pipe -Os -m64 -I/opt/local/include -L/opt/local/lib /opt/local/lib/libhdf5hl_fortran.a /opt/local/lib/libhdf5_hl.a /opt/local/lib/libhdf5_fortran.a /opt/local/lib/libhdf5.a -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -lsz -lz -ldl -lm

and the sz library located in opt/local/lib/libaec/lib is not found. This is not the case for h5cc and h5c++ wrapper scripts, for which the path to the library is given explicitly, as shown by

h5cc -show
/usr/bin/clang -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -L/opt/local/lib /opt/local/lib/libhdf5_hl.a /opt/local/lib/libhdf5.a -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk /opt/local/lib/libaec/lib/libsz.dylib /opt/local/lib/libz.dylib -ldl -lm

There appears to be something in the post-destroot section of the Portfile which sets up /opt/local/lib/libaec/lib/libsz.dylib for h5c++ and h5cc, but nothing similar for h5fc. However I'm not a Portfile expert.

MacOS Sonoma 14.3, Xcode 15.2, CLT 15.1.0.0.1.1700200546, Intel Mac Mini.

Attachments (1)

port_install_hdf5.log (55.9 KB) - added by Michael-P-Allen (Mike Allen) 4 months ago.
Log file from port install -d hdf5

Download all attachments as: .zip

Change History (5)

Changed 4 months ago by Michael-P-Allen (Mike Allen)

Attachment: port_install_hdf5.log added

Log file from port install -d hdf5

comment:1 Changed 4 months ago by jmroot (Joshua Root)

Owner: set to eborisch
Port: hdf5 added
Status: newassigned

comment:2 in reply to:  description Changed 4 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to Michael-P-Allen:

ld: library not found for -lsz

This is a problem we've had with other ports: #67508. Maybe we didn't fix it everywhere…

comment:3 Changed 4 months ago by Eric A. Borisch <eborisch@…>

Resolution: fixed
Status: assignedclosed

comment:4 in reply to:  3 Changed 4 months ago by barracuda156

Replying to Eric A. Borisch <eborisch@…>:

In 146b3baedea236a1ac761d92f44c7df98f4a3eae/macports-ports (master):

hdf5: Update link-line in h5fc (https://github.com/macports/macports-ports/pull/22483)

Closes: #69207

Looks like it has broken destroot: #69254

Note: See TracTickets for help on using tickets.