Skip to content

Commit c62e61a

Browse files
authored
[libomp][AIX] Use SO version "1" for AIX libomp (#111384)
For `libomp` on AIX, we build shared object `libomp.so` first and then archive it into libomp.a. This patch changes to use SO version `1` and name the shared object `libomp.so.1` so that it is consistent with the naming of other shared objects in AIX libraries, e.g., `libc++.so.1` in `libc++.a`. With this change, the change made in commit bde51d9 to ensure only `libomp.a` is published on AIX is no longer necessary and is removed.
1 parent 782a2d4 commit c62e61a

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

openmp/runtime/src/CMakeLists.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,15 @@ if(OPENMP_MSVC_NAME_SCHEME)
212212
LINK_FLAGS "${LIBOMP_CONFIGURED_LDFLAGS}"
213213
LINKER_LANGUAGE ${LIBOMP_LINKER_LANGUAGE}
214214
)
215+
elseif(${CMAKE_SYSTEM_NAME} MATCHES "AIX")
216+
set(LIBOMP_SHARED_OUTPUT_NAME "omp" CACHE STRING "Output name for the shared libomp runtime library.")
217+
set_target_properties(omp PROPERTIES
218+
OUTPUT_NAME "${LIBOMP_SHARED_OUTPUT_NAME}"
219+
LINK_FLAGS "${LIBOMP_CONFIGURED_LDFLAGS}"
220+
LINKER_LANGUAGE ${LIBOMP_LINKER_LANGUAGE}
221+
VERSION "1.0"
222+
SOVERSION "1"
223+
)
215224
else()
216225
set_target_properties(omp PROPERTIES
217226
PREFIX "" SUFFIX "" OUTPUT_NAME "${LIBOMP_LIB_FILE}"
@@ -426,11 +435,7 @@ if(WIN32)
426435
endforeach()
427436
else()
428437

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()
438+
install(TARGETS omp ${export_to_llvmexports} ${LIBOMP_INSTALL_KIND} DESTINATION "${OPENMP_INSTALL_LIBDIR}")
434439

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

0 commit comments

Comments
 (0)