| 7a4fcd53 | 11-Jun-2026 |
Jim Jagielski <jimjag@gmail.com> |
coinmp: link sub-libraries explicitly on macOS (fixes arm64 link)
On Apple Silicon the CoinMP build fails linking libOsi.dylib:
Undefined symbols for architecture arm64: "CoinFinite(doubl
coinmp: link sub-libraries explicitly on macOS (fixes arm64 link)
On Apple Silicon the CoinMP build fails linking libOsi.dylib:
Undefined symbols for architecture arm64: "CoinFinite(double)", ... (and many more CoinUtils symbols) ld: symbol(s) not found for architecture arm64
The objects are correctly arm64; the problem is that each CoinMP sub- library (Osi, Clp, Cgl, Cbc, CoinMP) is built as a .dylib that references symbols defined in a sibling library (CoinUtils, ...) without listing that sibling on its link line. On Linux those undefined symbols resolve at load time, but macOS's two-level namespace rejects them at link time.
CoinMP's bundled 2013-era libtool papers over this on Darwin with '-undefined dynamic_lookup', but only for MACOSX_DEPLOYMENT_TARGET=10.x; the version case falls through for 11.0+ (our Apple Silicon baseline), leaving allow_undefined_flag empty. Rather than re-add the dynamic_lookup hack, pass --enable-dependency-linking (macOS only) so configure adds the inter-library dependencies ($COINUTILS_LIBS etc.) to each library's LIBADD and sets -no-undefined -- the correct, namespace-clean fix.
Verified by a full local arm64 build at MACOSX_DEPLOYMENT_TARGET=11.0: libOsi/libOsiClp/.../libCoinMP all link, and otool -L shows libOsi now records libCoinUtils as an explicit dependency.
show more ...
|