[MacPorts] #69207: hdf5 package installs but h5fc fails with ld: library not found for -lsz

MacPorts noreply at macports.org
Sat Jan 27 12:08:02 UTC 2024


#69207: hdf5 package installs but h5fc fails with ld: library not found for -lsz
-----------------------------+--------------------
 Reporter:  Michael-P-Allen  |      Owner:  (none)
     Type:  defect           |     Status:  new
 Priority:  Normal           |  Milestone:
Component:  ports            |    Version:
 Keywords:                   |       Port:
-----------------------------+--------------------
 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.

-- 
Ticket URL: <https://trac.macports.org/ticket/69207>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list