Skip to content

Commit bde51d9

Browse files
authored
[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.
1 parent 9ddb1cd commit bde51d9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

openmp/runtime/src/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,11 @@ if(WIN32)
426426
endforeach()
427427
else()
428428

429-
install(TARGETS omp ${export_to_llvmexports} ${LIBOMP_INSTALL_KIND} DESTINATION "${OPENMP_INSTALL_LIBDIR}")
429+
if(${CMAKE_SYSTEM_NAME} MATCHES "AIX")
430+
install(FILES ${LIBOMP_LIBRARY_DIR}/libomp.a DESTINATION "${OPENMP_INSTALL_LIBDIR}" COMPONENT runtime)
431+
else()
432+
install(TARGETS omp ${export_to_llvmexports} ${LIBOMP_INSTALL_KIND} DESTINATION "${OPENMP_INSTALL_LIBDIR}")
433+
endif()
430434

431435
if(${LIBOMP_INSTALL_ALIASES})
432436
# Create aliases (symlinks) of the library for backwards compatibility

0 commit comments

Comments
 (0)