Skip to content

Commit

Permalink
[PATCH] set SONAME to libpapi.so.$(PAPIVER).$(PAPIREV)
Browse files Browse the repository at this point in the history
The version check in PAPI_library_init() requires matching
PAPI_VER_CURRENT, therefore libpapi.so.5 from papi-5.6.x and papi-5.7.x
are not interchangeable, but require applications to be recompiled.

Change the SONAME to contain the two version components that define
PAPI_VER_CURRENT, thereafter upgrading the shared library to a new
version does no longer break existing applications (which will pick up
the new SONAME upon recompilation).

Introduce a new variable PAPISOVER and use it in all places where
the SONAME is being used.

drop unused symlinks with three version components:
$(PAPIVER).$(PAPIREV).$(PAPIAGE)

Signed-off-by: Heike Jagode <[email protected]>
  • Loading branch information
Andreas Beckmann authored and jagode committed May 6, 2019
1 parent 7aff7fc commit 5434010
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
1 change: 1 addition & 0 deletions src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ PMAPI = @PMAPI@
PMINIT = @PMINIT@
SETPATH = @SETPATH@
SHLIB = @SHLIB@
PAPISOVER = @PAPISOVER@
VLIB = @VLIB@
SHLIBDEPS = @SHLIBDEPS@
SHOW_CONF = @SHOW_CONF@
Expand Down
16 changes: 7 additions & 9 deletions src/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ $(LIBRARY): $(OBJECTS)
rm -f $(LIBRARY)
$(AR) $(ARG64) rv $(LIBRARY) $(OBJECTS)

shared: libpapi.so libpapi.so.$(PAPIVER)
shared: libpapi.so libpapi.so.$(PAPISOVER)

libpapi.so libpapi.so.$(PAPIVER): $(SHLIB)
libpapi.so libpapi.so.$(PAPISOVER): $(SHLIB)
ln -sf $(SHLIB) $@

$(SHLIB): $(HEADERS) $(SOURCES) $(SHLIBOBJS)
rm -f $(SHLIB) libpapi.so libpapi.so.$(PAPIVER);
rm -f $(SHLIB) libpapi.so libpapi.so.$(PAPISOVER)
$(CC_SHR) $(LIBCFLAGS) $(OPTFLAGS) $(SOURCES) $(SHLIBOBJS) -o $@ $(SHLIBDEPS) $(LDFLAGS)
@set -ex; if test "$(POST_BUILD)" != "" ; then \
-$(POST_BUILD) ; \
Expand Down Expand Up @@ -258,7 +258,7 @@ ifneq (${COMPONENTS},)
endif

clean: comp_tests_clean native_clean
rm -rf $(LIBRARY) $(SHLIB) libpapi.so libpapi.so.$(PAPIVER) $(OBJECTS) core rii_files genpapifdef *~ so_locations papi_fwrappers_.c papi_fwrappers__.c upper_PAPI_FWRAPPERS.c
rm -rf $(LIBRARY) $(SHLIB) libpapi.so libpapi.so.$(PAPISOVER) $(OBJECTS) core rii_files genpapifdef *~ so_locations papi_fwrappers_.c papi_fwrappers__.c upper_PAPI_FWRAPPERS.c
$(MAKE) -C ../doc clean
$(MAKE) -C ctests clean
$(MAKE) -C ftests clean
Expand Down Expand Up @@ -317,8 +317,7 @@ install-lib: native_install
cp -p $(SHLIB) $(DESTDIR)$(LIBDIR)/libpapi.so.$(PAPIVER).$(PAPIREV).$(PAPIAGE).$(PAPIINC); \
chmod go+r $(DESTDIR)$(LIBDIR)/libpapi.so.$(PAPIVER).$(PAPIREV).$(PAPIAGE).$(PAPIINC) ; \
cd $(DESTDIR)$(LIBDIR); \
ln -sf libpapi.so.$(PAPIVER).$(PAPIREV).$(PAPIAGE).$(PAPIINC) libpapi.so.$(PAPIVER).$(PAPIREV).$(PAPIAGE); \
ln -sf libpapi.so.$(PAPIVER).$(PAPIREV).$(PAPIAGE).$(PAPIINC) libpapi.so.$(PAPIVER); \
ln -sf libpapi.so.$(PAPIVER).$(PAPIREV).$(PAPIAGE).$(PAPIINC) libpapi.so.$(PAPISOVER); \
ln -sf libpapi.so.$(PAPIVER).$(PAPIREV).$(PAPIAGE).$(PAPIINC) libpapi.so; \
fi

Expand Down Expand Up @@ -352,9 +351,8 @@ install-pkgconf:
-mkdir -p $(DESTDIR)$(LIBPC)
-chmod go+rx $(DESTDIR)$(LIBPC)
cp papi.pc $(DESTDIR)$(LIBPC)/papi-$(PAPIVER).$(PAPIREV).$(PAPIAGE).$(PAPIINC).pc
cd $(DESTDIR)$(LIBPC); ln -sf papi-$(PAPIVER).$(PAPIREV).$(PAPIAGE).$(PAPIINC).pc papi-$(PAPIVER).$(PAPIREV).$(PAPIAGE).pc;
cd $(DESTDIR)$(LIBPC); ln -sf papi-$(PAPIVER).$(PAPIREV).$(PAPIAGE).$(PAPIINC).pc papi-$(PAPIVER).pc;
cd $(DESTDIR)$(LIBPC); ln -sf papi-$(PAPIVER).$(PAPIREV).$(PAPIAGE).$(PAPIINC).pc papi.pc;
ln -sf papi-$(PAPIVER).$(PAPIREV).$(PAPIAGE).$(PAPIINC).pc $(DESTDIR)$(LIBPC)/papi-$(PAPISOVER).pc
ln -sf papi-$(PAPIVER).$(PAPIREV).$(PAPIAGE).$(PAPIINC).pc $(DESTDIR)$(LIBPC)/papi.pc

#
# Dummy targets for configurations that do not also include a Rules file with targets
Expand Down
4 changes: 2 additions & 2 deletions src/Rules.perfmon2
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ endif
-install -d $(DESTDIR)$(LIBDIR)
ifneq (,$(findstring shared,$(LIBS)))
cp -p $(SHLIB) $(DESTDIR)$(LIBDIR)/libpapi.so.$(PAPIVER).$(PAPIREV).$(PAPIAGE).$(PAPIINC)
cd $(DESTDIR)$(LIBDIR); ln -sf libpapi.so.$(PAPIVER).$(PAPIREV).$(PAPIAGE).$(PAPIINC) libpapi.so.$(PAPIVER)
cd $(DESTDIR)$(LIBDIR); ln -sf libpapi.so.$(PAPIVER).$(PAPIREV).$(PAPIAGE).$(PAPIINC) libpapi.so
ln -sf libpapi.so.$(PAPIVER).$(PAPIREV).$(PAPIAGE).$(PAPIINC) $(DESTDIR)$(LIBDIR)/libpapi.so.$(PAPISOVER)
ln -sf libpapi.so.$(PAPIVER).$(PAPIREV).$(PAPIAGE).$(PAPIINC) $(DESTDIR)$(LIBDIR)/libpapi.so
endif
-install -d $(DESTDIR)$(DATADIR)
cp -f ./papi_events.csv $(DESTDIR)$(DATADIR)
Expand Down
5 changes: 4 additions & 1 deletion src/configure
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,7 @@ CPUCOMPONENT_NAME
OPTFLAGS
PAPICFLAGS
VLIB
PAPISOVER
SHLIB
LIBRARY
FILENAME
Expand Down Expand Up @@ -6190,7 +6191,8 @@ CTEST_TARGETS="all"
FTEST_TARGETS="all"
LIBRARY=libpapi.a
SHLIB='libpapi.so.5.7.1.0'
VLIB='libpapi.so.$(PAPIVER)'
PAPISOVER='$(PAPIVER).$(PAPIREV)'
VLIB='libpapi.so.$(PAPISOVER)'
OMPCFLGS=-fopenmp
CC_R='$(CC) -pthread'
CC_SHR='$(CC) -fPIC -DPIC -shared -Wl,-soname -Wl,$(VLIB) -Xlinker "-rpath" -Xlinker "$(LIBDIR)"'
Expand Down Expand Up @@ -6786,6 +6788,7 @@ $as_echo "$PAPI_EVENTS_CSV" >&6; }
if test "$cross_compiling" = "yes" ; then
Expand Down
4 changes: 3 additions & 1 deletion src/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,8 @@ CTEST_TARGETS="all"
FTEST_TARGETS="all"
LIBRARY=libpapi.a
SHLIB='libpapi.so.AC_PACKAGE_VERSION'
VLIB='libpapi.so.$(PAPIVER)'
PAPISOVER='$(PAPIVER).$(PAPIREV)'
VLIB='libpapi.so.$(PAPISOVER)'
OMPCFLGS=-fopenmp
CC_R='$(CC) -pthread'
CC_SHR='$(CC) -fPIC -DPIC -shared -Wl,-soname -Wl,$(VLIB) -Xlinker "-rpath" -Xlinker "$(LIBDIR)"'
Expand Down Expand Up @@ -1769,6 +1770,7 @@ AC_SUBST(CPU)
AC_SUBST(FILENAME)
AC_SUBST(LIBRARY)
AC_SUBST(SHLIB)
AC_SUBST(PAPISOVER)
AC_SUBST(VLIB)
AC_SUBST(PAPICFLAGS)
AC_SUBST(OPTFLAGS)
Expand Down

0 comments on commit 5434010

Please sign in to comment.