From 3f7980d9168920b45f326e070a4aa5a050ecca63 Mon Sep 17 00:00:00 2001 From: Simon Pinches Date: Wed, 7 Oct 2026 12:36:40 +0200 Subject: [PATCH 1/2] Emit -rpath in al-core.pc only on non-Windows platforms 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. --- CMakeLists.txt | 7 +++++++ pkgconfig/al-core.pc.in | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index de5b69ca..9acad117 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -287,6 +287,13 @@ if(APPLE OR WIN32) else() set(AL_PC_VERSION_SYMBOL_FLAG " -Wl,--defsym,AL_VER_${PROJECT_VERSION}=0") endif() +# Windows has no runtime search path: DLLs are found through PATH, and MSVC's +# link.exe rejects -rpath +if(WIN32) + set(AL_PC_RPATH_FLAG "") +else() + set(AL_PC_RPATH_FLAG " -Wl,-rpath,\${libdir}") +endif() configure_file(pkgconfig/al-core.pc.in al-core.pc @ONLY) include(GNUInstallDirs) install( diff --git a/pkgconfig/al-core.pc.in b/pkgconfig/al-core.pc.in index 5a90d4a7..4a1990fb 100644 --- a/pkgconfig/al-core.pc.in +++ b/pkgconfig/al-core.pc.in @@ -8,4 +8,4 @@ Version: @PROJECT_VERSION@ Description: IMAS Access Layer core libraries for C. URL: https://imas.iter.org Cflags: -I${includedir} -Libs: -L${libdir} -lal@AL_PC_VERSION_SYMBOL_FLAG@ -Wl,-rpath,${libdir} +Libs: -L${libdir} -lal@AL_PC_VERSION_SYMBOL_FLAG@@AL_PC_RPATH_FLAG@ From b6bf9a3d30cfe9314486f0a86d78ec80313d22cb Mon Sep 17 00:00:00 2001 From: Simon Pinches Date: Wed, 7 Oct 2026 12:37:59 +0200 Subject: [PATCH 2/2] Don't require Boost for consumers of the al-core CMake package 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. --- cmake/al-coreConfig.cmake.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/al-coreConfig.cmake.in b/cmake/al-coreConfig.cmake.in index 4d8b30ed..3789cbe1 100644 --- a/cmake/al-coreConfig.cmake.in +++ b/cmake/al-coreConfig.cmake.in @@ -1,7 +1,9 @@ @PACKAGE_INIT@ -include(CMakeFindDependencyMacro) -find_dependency(Boost COMPONENTS filesystem) +# No find_dependency() calls: libal is always a shared library and links its +# dependencies (Boost, HDF5, ...) privately, so consumers don't need them. +# Requiring them would fail where only their runtime libraries are installed +# (e.g. conda environments without libboost-devel). include("${CMAKE_CURRENT_LIST_DIR}/al-coreTargets.cmake")