openEMS icon indicating copy to clipboard operation
openEMS copied to clipboard

Don't treat hdf5 libraries as if they were directories

Open ryandesign opened this issue 1 year ago • 2 comments

This causes nonsensical arguments to be added to the build, e.g.

-L/opt/local/lib/libhdf5.dylib
-L/opt/local/lib/libsz.dylib
-L/opt/local/lib/libz.dylib
-Wl,-rpath,/opt/local/lib/libhdf5.dylib
-Wl,-rpath,/opt/local/lib/libsz.dylib
-Wl,-rpath,/opt/local/lib/libz.dylib

which causes warnings to be printed:

ld: warning: path '/opt/local/lib/libhdf5.dylib' following -L not a directory
ld: warning: path '/opt/local/lib/libsz.dylib' following -L not a directory
ld: warning: path '/opt/local/lib/libz.dylib' following -L not a directory

This was reported to MacPorts by @barracuda156 here: https://trac.macports.org/ticket/70467

The correct thing to do is to tell the build to use the hdf5 libraries as libraries. That's already happening later in the file:

https://github.com/thliebig/openEMS/blob/1ccf0942477e9178b27f5e00dddd4d62bff78d29/CMakeLists.txt#L206-L215

So the wrong link_directories line just needs to be removed.

The bug was introduced in 23518278e8687cabd83b543afa22b58eaf049d6d.

ryandesign avatar Jul 30 '24 17:07 ryandesign

Hi. I'm pretty sure that I did not make this change you mentioned just for fun but because it caused problems before. Did you verify that this change does still work as intended on Windows and Linux? Otherwise I would recommend to make this change only for mac?

thliebig avatar Aug 04 '24 08:08 thliebig

@thliebig From my side I can only check on macOS (which has been done and was the reason for the ticket). I do not have a working Linux setup for testing.

Maybe you could add CI to the repo?

barracuda156 avatar Aug 04 '24 09:08 barracuda156