Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,22 @@ AC_SUBST(EXTRA_VERSION)
AC_SUBST(SCM_VERSION)
AC_SUBST(SOVERSION)

UCX_LT_RELEASE=
ucx_soname_suffix_summary="<disabled>"
AC_ARG_WITH([soname-suffix],
AS_HELP_STRING([--with-soname-suffix=SUFFIX],
[Append SUFFIX to UCX core shared library SONAMEs. Disabled by default. [default=NO]]),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ MINOR

the option is named --with-soname-suffix but -release actually appends the suffix to the library filename (and hence SONAME), not only to the SONAME. pls clarify the help text or rename (e.g. --with-library-suffix) so users aren't surprised by the renamed .so file.

[], [with_soname_suffix=no])
AS_IF([test "x$with_soname_suffix" != xno],
[AS_IF([test "x$with_soname_suffix" = xyes],
[AC_MSG_ERROR([--with-soname-suffix requires an explicit suffix value])])
AS_IF([printf '%s\n' "$with_soname_suffix" | grep -Eq '^@<:@A-Za-z0-9@:>@@<:@A-Za-z0-9_.-@:>@*$'],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] [important] Dotted suffixes break module loading

The option accepts dots, but libtool -release 1.22 produces names like libucs-1.22.so.0; UCX's module loader derives module_ext from the first dot in the loaded libucs basename, so it would look for module files ending in .22.so.0 instead of .so.0. That means accepted values such as --with-soname-suffix=1.22 can prevent optional UCT/UCM modules from loading. Either reject dots here or fix the loader to derive the real shared-library extension, and add a small configure/runtime check for a dotted suffix.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ MINOR

the regex printf | grep -Eq works but is heavier than needed; a case statement (as used elsewhere in autoconf) would avoid spawning subprocesses and be more portable. minor.

[],
[AC_MSG_ERROR([--with-soname-suffix must contain only letters, digits, dots, underscores, and dashes])])
UCX_LT_RELEASE="-release $with_soname_suffix"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 BLOCKER

libtool's -release changes the installed library filename (e.g. libucp-SUFFIX.so.0), not just the SONAME. With this set, ucx.pc (which emits -lucp) and cmake/ucx-targets.cmake.in (which hardcodes libucp.so/libucs.so/libuct.so) will fail to locate the libs for downstream consumers. Either also template these files with the suffix, or use a mechanism that only alters the SONAME (e.g., -Wl,-soname=...) if the intent really is SONAME-only as the option name suggests.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ INFO

only the four core libs (ucm/ucp/ucs/uct) get $(UCX_LT_RELEASE); the per-transport module libs (e.g. src/uct/ib/Makefile.am, src/ucm/cuda/Makefile.am, …) still use plain -version-info $(SOVERSION). is the asymmetry intentional? if two UCX trees with different suffixes are installed in the same prefix, the modules will collide.

ucx_soname_suffix_summary="$with_soname_suffix"])
AC_SUBST([UCX_LT_RELEASE])

AC_PROG_CC
AC_PROG_CXX
AC_OPENMP
Expand Down Expand Up @@ -434,6 +450,7 @@ AC_MSG_NOTICE([ Multi-thread: ${mt_enable}])
AC_MSG_NOTICE([ MPI tests: ${mpi_enable}])
AC_MSG_NOTICE([ VFS support: ${vfs_enable}])
AC_MSG_NOTICE([ Devel headers: ${enable_devel_headers}])
AC_MSG_NOTICE([ SONAME suffix: ${ucx_soname_suffix_summary}])
AC_MSG_NOTICE([io_demo CUDA support: ${with_iodemo_cuda}])
AC_MSG_NOTICE([ Bindings: <$(echo ${build_bindings}|tr ':' ' ') >])
AC_MSG_NOTICE([ UCS modules: <$(echo ${ucs_modules}|tr ':' ' ') >])
Expand Down
2 changes: 1 addition & 1 deletion src/ucm/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SUBDIRS = . cuda rocm ze
lib_LTLIBRARIES = libucm.la
libucm_ladir = $(includedir)/ucm
libucm_la_LDFLAGS = $(UCM_MODULE_LDFLAGS) \
-ldl -version-info $(SOVERSION)
-ldl -version-info $(SOVERSION) $(UCX_LT_RELEASE)
libucm_la_CPPFLAGS = $(BASE_CPPFLAGS) -DUCM_MALLOC_PREFIX=ucm_dl
libucm_la_CFLAGS = $(BASE_CFLAGS) $(CFLAGS_NO_DEPRECATED) \
$(LT_CFLAGS)
Expand Down
2 changes: 1 addition & 1 deletion src/ucp/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ lib_LTLIBRARIES = libucp.la
libucp_la_CFLAGS = $(BASE_CFLAGS) $(LT_CFLAGS)
libucp_la_LIBS =
libucp_la_CPPFLAGS = $(BASE_CPPFLAGS)
libucp_la_LDFLAGS = -ldl -version-info $(SOVERSION)
libucp_la_LDFLAGS = -ldl -version-info $(SOVERSION) $(UCX_LT_RELEASE)
libucp_la_LIBADD = ../ucs/libucs.la ../uct/libuct.la
libucp_ladir = $(includedir)/ucp

Expand Down
2 changes: 1 addition & 1 deletion src/ucs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ libucs_la_CPPFLAGS = $(BASE_CPPFLAGS) $(BFD_CPPFLAGS) \
-DUCX_MODULE_DIR=\"$(moduledir)\" \
-DUCX_CONFIG_DIR=\"$(ucx_config_dir)\"
libucs_la_CFLAGS = $(BASE_CFLAGS) $(LT_CFLAGS)
libucs_la_LDFLAGS = -ldl $(BFD_LDFLAGS) -version-info $(SOVERSION)
libucs_la_LDFLAGS = -ldl $(BFD_LDFLAGS) -version-info $(SOVERSION) $(UCX_LT_RELEASE)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] [important] libucs_signal is left unsuffixed

The new suffix is applied to libucm/libucs/libuct/libucp, but libucs_signal is also an installed versioned UCX shared library. If the goal is avoiding collisions with already-loaded UCX DSOs, leaving this SONAME as libucs_signal.so.0 keeps one UCX entry point outside the suffix scheme. Add $(UCX_LT_RELEASE) here as well, or explicitly document that this option is limited to the four core libraries.

libucs_ladir = $(includedir)/ucs
libucs_la_LIBADD = $(LIBM) $(top_builddir)/src/ucm/libucm.la $(BFD_LIBS)

Expand Down
2 changes: 1 addition & 1 deletion src/uct/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ lib_LTLIBRARIES = libuct.la
libuct_la_CFLAGS = $(BASE_CFLAGS) $(LT_CFLAGS)
libuct_la_CPPFLAGS = $(BASE_CPPFLAGS)
libuct_la_LIBADD = $(top_builddir)/src/ucs/libucs.la
libuct_la_LDFLAGS = -ldl -version-info $(SOVERSION)
libuct_la_LDFLAGS = -ldl -version-info $(SOVERSION) $(UCX_LT_RELEASE)
libuct_ladir = $(includedir)/uct

nobase_dist_libuct_la_HEADERS = \
Expand Down
Loading