[MacPorts] #67077: scotch @7.0.2: can no longer be dlopen'ed
MacPorts
noreply at macports.org
Sun Apr 23 01:48:55 UTC 2023
#67077: scotch @7.0.2: can no longer be dlopen'ed
-------------------------------+---------------------------------
Reporter: FreddieWitherden | Owner: MarcusCalhoun-Lopez
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: scotch |
-------------------------------+---------------------------------
Comment (by catap):
Well.. Scotch is a bit different on macOS :)
Long story short: it is split into the library (`libscotch.dylib`) and two
possible error handlers: `libscotcherr.dylib` which prints errors, and
`libscotcherrexit.dylib` which exits on error. And scotch needs function
`_SCOTCH_errorPrint` which is exported from an error handler.
Unfortunately python's CDLL can't load two library into one namespace. But
you make a wrapper. A dummy `.dylib` which links against `libscotch.dylib`
and desired error handler.
For example:
{{{
√ /tmp % clang -shared -L/opt/local/lib -lscotch -lscotcherr -o
wscotch.dylib
√ /tmp % python3
Python 3.9.16 (main, Dec 7 2022, 02:41:07)
[Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes import *
>>> CDLL('/tmp/wscotch.dylib')
<CDLL '/tmp/wscotch.dylib', handle 213934560 at 0x10a0837f0>
>>>
}}}
--
Ticket URL: <https://trac.macports.org/ticket/67077#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list