[Openmp-commits] [openmp] [OpenMP][AIX] Not to create symbolic links to libomp.so in install step (PR #168585)
Kelvin Li via Openmp-commits
openmp-commits at lists.llvm.org
Tue Nov 18 10:40:17 PST 2025
https://github.com/kkwli created https://github.com/llvm/llvm-project/pull/168585
https://github.com/llvm/llvm-project/commit/bb563b196f0e70b2790cdfe2619fbd34f273b508 handles the links in the build directory but misses the case in the install step. This patch is to link only the libomp.a on AIX.
>From 28fda49d08bdbce8c147c3a28266e6cee481f07f Mon Sep 17 00:00:00 2001
From: Kelvin Li <kli at ca.ibm.com>
Date: Tue, 18 Nov 2025 12:59:40 -0500
Subject: [PATCH] [OpenMP][AIX] Not to create symbolic links to libomp.so in
install step
---
openmp/runtime/src/CMakeLists.txt | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
index 5dd7f4b33612d..3202bdcd13524 100644
--- a/openmp/runtime/src/CMakeLists.txt
+++ b/openmp/runtime/src/CMakeLists.txt
@@ -471,13 +471,19 @@ else()
if(${LIBOMP_INSTALL_ALIASES})
# Create aliases (symlinks) of the library for backwards compatibility
extend_path(outdir "${CMAKE_INSTALL_PREFIX}" "${OPENMP_INSTALL_LIBDIR}")
+ if(AIX)
+ # On AIX, libomp.a is the name for both static and shared objects.
+ set(LIBRARY_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
+ else()
+ set(LIBRARY_SUFFIX ${LIBOMP_LIBRARY_SUFFIX})
+ endif()
set(LIBOMP_ALIASES "libgomp;libiomp5")
foreach(alias IN LISTS LIBOMP_ALIASES)
- install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink \"${LIBOMP_LIB_FILE}\"
- \"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY
+ install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink \"${LIBOMP_LIB_NAME}${LIBRARY_SUFFIX}\"
+ \"${alias}${LIBRARY_SUFFIX}\" WORKING_DIRECTORY
\"\$ENV{DESTDIR}${outdir}\")")
endforeach()
- if(LIBOMP_ENABLE_SHARED)
+ if(LIBOMP_ENABLE_SHARED AND NOT AIX)
install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink \"${LIBOMP_LIB_FILE}\"
\"${VERSIONED_LIBGOMP_NAME}\" WORKING_DIRECTORY
\"\$ENV{DESTDIR}${outdir}\")")
More information about the Openmp-commits
mailing list