[Openmp-commits] [openmp] bde51d9 - [libomp][AIX] Ensure only libomp.a is published on AIX (#109016)

via Openmp-commits openmp-commits at lists.llvm.org
Wed Sep 18 13:12:43 PDT 2024


Author: Xing Xue
Date: 2024-09-18T16:12:39-04:00
New Revision: bde51d9b0d473447ea12fb14924f14ea167eec85

URL: https://github.com/llvm/llvm-project/commit/bde51d9b0d473447ea12fb14924f14ea167eec85
DIFF: https://github.com/llvm/llvm-project/commit/bde51d9b0d473447ea12fb14924f14ea167eec85.diff

LOG: [libomp][AIX] Ensure only libomp.a is published on AIX (#109016)

For `libomp` on AIX, we build shared object `libomp.so` first and then
archive it into `libomp.a`. Due to a CMake for AIX problem, the install
step also tries to publish `libomp.so`. While we use a script to build
`libomp.a` out-of-tree for Clang and avoided the problem, this chokes
the in-tree build for Flang. The issue will be reported to CMake but
before a fixed CMake is available, this patch ensures only `libomp.a` is
published.

Added: 
    

Modified: 
    openmp/runtime/src/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
index f106694841ce8d..2dd54b5116d920 100644
--- a/openmp/runtime/src/CMakeLists.txt
+++ b/openmp/runtime/src/CMakeLists.txt
@@ -426,7 +426,11 @@ if(WIN32)
   endforeach()
 else()
 
-  install(TARGETS omp ${export_to_llvmexports} ${LIBOMP_INSTALL_KIND} DESTINATION "${OPENMP_INSTALL_LIBDIR}")
+  if(${CMAKE_SYSTEM_NAME} MATCHES "AIX")
+    install(FILES ${LIBOMP_LIBRARY_DIR}/libomp.a DESTINATION "${OPENMP_INSTALL_LIBDIR}" COMPONENT runtime)
+  else()
+    install(TARGETS omp ${export_to_llvmexports} ${LIBOMP_INSTALL_KIND} DESTINATION "${OPENMP_INSTALL_LIBDIR}")
+  endif()
 
   if(${LIBOMP_INSTALL_ALIASES})
     # Create aliases (symlinks) of the library for backwards compatibility


        


More information about the Openmp-commits mailing list