kpeeters / cadabra2

A field-theory motivated approach to computer algebra.
https://cadabra.science/
GNU General Public License v3.0
215 stars 37 forks source link

Issue with cadabra2.cpython-39-darwin.so path when building cadabra2 2.3.8 under MacPorts #238

Open Schamschula opened 2 years ago

Schamschula commented 2 years ago

I'm trying to update the MacPorts Portfile for cadabra2 to version 2.3.8.

The build appears to proceed correctly, but when MacPorts checks links I see

---> Scanning binaries for linking errors Could not open /opt/local/lib/cadabra2.cpython-39-darwin.so: Error opening or reading file (referenced from /opt/local/lib/python3.9/site-packages/cdb/core/_component.cpython-39-darwin.so)

On my machine /opt/local/lib/cadabra2.cpython-39-darwin.so (default MacPorts file hierarchy) is actually located # /opt/local/lib/python3.9/site-packages/cadabra2.cpython-39-darwin.so

How do I fix this path?

kpeeters commented 2 years ago

That cadabra2.cpython-39-darwin.so is in the right place, the problem seems to be that your machine does not look there when resolving the libraries to which _component.cpython-39-darwin.so is linked, and then attempts the default /usr/local/lib/ but of course does not find it there. For some reason this does work on Linux (although doing ldd on that _component... file fails to resolve the cadabra2 dependency).

I have pushed an attempt at a fix; can you pull again and try that? It makes ldd do the right thing on Linux, so hopefully this will also do the trick with MacPorts.

Schamschula commented 2 years ago

That didn't work.

I've put in a workaround to link /opt/local/lib/python3.9/site-packages/cadabra2.cpython-39-darwin.so to /opt/local/lib/cadabra2.cpython-39-darwin.so.