# fix warnings related to libraries pulled through dependent package

XMLWordPrintable

## Details

• Type: Story
• Status: Done
• Resolution: Done
• Fix Version/s: None
• Component/s:
• Labels:
None
• Story Points:
0.5
• Sprint:
DB_S14_08
• Team:
Data Access and Database

## Description

This came up during migrating qserv to the new logging system, and it can be reproduced by taking log4cxx, see DM-983, essentially:

 eups distrib install -c log4cxx 0.10.0.lsst1 -r http://lsst-web.ncsa.illinois.edu/~becla/distrib -r http://sw.lsstcorp.org/eupspkg

cloning log package (contrib/log.git), building it and installing in your stack, and finally taking the branch u/jbecla/DM-207 of qserv and building it.

The warnings looks like:

 /usr/bin/ld: warning: libutils.so, needed by /usr/local/home/becla/qservDev/Linux64/log/1.0.0/lib/liblog.so, not found (try using -rpath or -rpath-link) /usr/bin/ld: warning: libpex_exceptions.so, needed by /usr/local/home/becla/qservDev/Linux64/log/1.0.0/lib/liblog.so, not found (try using -rpath or -rpath-link) /usr/bin/ld: warning: libbase.so, needed by /usr/local/home/becla/qservDev/Linux64/log/1.0.0/lib/liblog.so, not found (try using -rpath or -rpath-link)

and they show up when I build qserv package, and are triggered by the liblog. I suspect sconsUtils deal with that sort of issues, but since we have our own scons system for qserv it is not handled. Fabrice, can you try to find a reasonable solution for that? Thanks!

## Activity

Hide
Kian-Tat Lim added a comment -

Yes, -rpath-link is OK; -rpath is not (as it can prevent EUPS mix-and-match).

Show
Kian-Tat Lim added a comment - Yes, -rpath-link is OK; -rpath is not (as it can prevent EUPS mix-and-match).
Hide
Andy Salnikov added a comment -

OK, Fabrice, I think we need to fix your fix I had a quick look on what sconsUtils does, there are basically two thngs as K-T says:

1. copy LD_LIBRARY_PATH into the environment (basically what my original proposal does). sconsUtils actually copies few more envvars, you can check state.py for the full list.

  #  # If we're linking to libraries that themselves linked to  # shareable libraries we need to do something special.  #  if (re.search(r"^(Linux|Linux64)$", env["eupsFlavor"]) and os.environ.has_key("LD_LIBRARY_PATH")):  env.Append(LINKFLAGS = ["-Wl,-rpath-link"])  env.Append(LINKFLAGS = ["-Wl,%s" % os.environ["LD_LIBRARY_PATH"]]) I'm not sure if this is actually required, it should work without that if you pass LD_LIBRARY_PATH envvar. I think we can use one of these two things, but using them both should not do any harm. Show Andy Salnikov added a comment - OK, Fabrice, I think we need to fix your fix I had a quick look on what sconsUtils does, there are basically two thngs as K-T says: 1. copy LD_LIBRARY_PATH into the environment (basically what my original proposal does). sconsUtils actually copies few more envvars, you can check state.py for the full list. 2. explicitly sets -rpath-link for the linker (again in state.py): # # If we're linking to libraries that themselves linked to # shareable libraries we need to do something special. # if (re.search(r"^(Linux|Linux64)$", env["eupsFlavor"]) and os.environ.has_key("LD_LIBRARY_PATH")): env.Append(LINKFLAGS = ["-Wl,-rpath-link"]) env.Append(LINKFLAGS = ["-Wl,%s" % os.environ["LD_LIBRARY_PATH"]]) I'm not sure if this is actually required, it should work without that if you pass LD_LIBRARY_PATH envvar. I think we can use one of these two things, but using them both should not do any harm.
Hide
Andy Salnikov added a comment -

Hi Fabrice,

the patch that you made to DM-207 branch will be removed (I hope) before merge with master. Could you please make new branch for a fix that does not use "RPATH"? Or feel free to reassign this to me if you are busy with anything else.

I'm also going to switch this issue back to In Progress.

Cheers,
Andy

Show
Andy Salnikov added a comment - Hi Fabrice, the patch that you made to DM-207 branch will be removed (I hope) before merge with master. Could you please make new branch for a fix that does not use "RPATH"? Or feel free to reassign this to me if you are busy with anything else. I'm also going to switch this issue back to In Progress. Cheers, Andy
Hide
Andy Salnikov added a comment -

I have updated site_scons/state.py with code based on the idea from sconsUtils. Please review.

Show
Andy Salnikov added a comment - I have updated site_scons/state.py with code based on the idea from sconsUtils. Please review.
Hide
Jacek Becla added a comment -

looks fine, and it works, thanks!

Show
Jacek Becla added a comment - looks fine, and it works, thanks!

## People

• Assignee:
Andy Salnikov
Reporter:
Fritz Mueller
Reviewers:
Jacek Becla
Watchers:
Andy Salnikov, Fabrice Jammes, Jacek Becla, Kian-Tat Lim