Skip to content

Commit 99103be

Browse files
kkwliPriyanshu3820
authored andcommitted
[OpenMP][AIX] Not to create symbolic links to libomp.so in install step (NFC) (llvm#168585)
Commit bb563b1 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.
1 parent d4fc744 commit 99103be

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

openmp/runtime/src/CMakeLists.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -471,13 +471,19 @@ else()
471471
if(${LIBOMP_INSTALL_ALIASES})
472472
# Create aliases (symlinks) of the library for backwards compatibility
473473
extend_path(outdir "${CMAKE_INSTALL_PREFIX}" "${OPENMP_INSTALL_LIBDIR}")
474+
if(AIX)
475+
# On AIX, libomp.a is the name for both static and shared objects.
476+
set(LIBRARY_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
477+
else()
478+
set(LIBRARY_SUFFIX ${LIBOMP_LIBRARY_SUFFIX})
479+
endif()
474480
set(LIBOMP_ALIASES "libgomp;libiomp5")
475481
foreach(alias IN LISTS LIBOMP_ALIASES)
476-
install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink \"${LIBOMP_LIB_FILE}\"
477-
\"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY
482+
install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink \"${LIBOMP_LIB_NAME}${LIBRARY_SUFFIX}\"
483+
\"${alias}${LIBRARY_SUFFIX}\" WORKING_DIRECTORY
478484
\"\$ENV{DESTDIR}${outdir}\")")
479485
endforeach()
480-
if(LIBOMP_ENABLE_SHARED)
486+
if(LIBOMP_ENABLE_SHARED AND NOT AIX)
481487
install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink \"${LIBOMP_LIB_FILE}\"
482488
\"${VERSIONED_LIBGOMP_NAME}\" WORKING_DIRECTORY
483489
\"\$ENV{DESTDIR}${outdir}\")")

0 commit comments

Comments
 (0)