Skip to content

Fix/downstream linking - #87

Merged
olivhoenen merged 3 commits into
iterorganization:developfrom
SimonPinches:fix/downstream-linking
Oct 14, 2026
Merged

olivhoenen merged 3 commits into
iterorganization:developfrom
SimonPinches:fix/downstream-linking

Conversation

@SimonPinches

@SimonPinches SimonPinches commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Fix linking for downstream projects here, rather than in every package that builds on IMAS-Core: they no longer need to strip unsupported linker flags from al-core.pc, or install Boost to use the al-core CMake package.

Changes

  • al-core.pc: emit -Wl,-rpath only on non-Windows platforms. Windows has no runtime search path (DLLs are found through PATH), and MSVC/lld-link rejects -rpath. This completes Drop --defsym in al-core.pc when not accepted #84, which did the same for --defsym (not yet in a release).
  • al-coreConfig.cmake: remove find_dependency(Boost COMPONENTS filesystem). libal is always a shared library that links Boost PRIVATE, so the exported al-core::al target never references Boost and consumers don't need it.

Why

1. GNU-ld-only flags in al-core.pc: Apple's ld64 rejects --defsym, and the Windows linker rejects both --defsym and -rpath. Downstream builds currently strip them by hand:

  • conda-forge imas-fortran feedstock, macOS: build.sh L55-62
  • IMAS-Fortran win-64 conda build (in progress): bld.bat L42-49. Without it, pkg_check_modules(al-core) produces link options the Windows linker rejects.

2. find_dependency(Boost) breaks find_package(al-core):

  • in conda environments: the runtime libboost package ships no Boost CMake config (only libboost-devel does);
  • in Fortran-only projects, even when Boost is installed: Boost's package config fails with a hard error in BoostDetectToolset when no C++ compiler is enabled. Reproduced with the IMAS-Core 5.7.1 module on SDCC via find_package(al-fortran) (IMAS-Fortran's new CMake package config).

CI

The macosx_arm64 wheel failures are pre-existing on develop: Homebrew now ships OpenSSL 4.0, which breaks the -Werror build of UDA. They are fixed separately in #90, with the upstream UDA fix in ukaea/UDA#144.

Windows has no runtime search path (DLLs are found through PATH) and
MSVC's link.exe rejects -Wl,-rpath, which made pkg-config --libs al-core
unusable for linking on Windows.
libal is always a shared library linking Boost privately, so the exported
target doesn't reference it. find_dependency(Boost) made find_package(al-core)
fail where only the Boost runtime is installed, e.g. conda environments
without libboost-devel.
@olivhoenen

olivhoenen commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Fix linking here rather than in all HLIs. I.e. HLIs don't have to strip unnecessary linking arguments.

Could you point to issue/comment that explains the need for such fix, for proper ref?

@SimonPinches

Copy link
Copy Markdown
Contributor Author

Fix linking here rather than in all HLIs. I.e. HLIs don't have to strip unnecessary linking arguments.

Could you point to issue/comment that explains the need for such fix, for proper ref?

Good point. I've expanded the PR description with references to the downstream workarounds this replaces.

@olivhoenen olivhoenen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@olivhoenen
olivhoenen merged commit fd7ef3d into iterorganization:develop Oct 14, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants