Project

General

Profile

Bug #4576

Setting DYLD_LIBRARY_PATH on a MAC

Added by Rob Kutschke about 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Category:
Infrastructure
Target version:
Start date:
08/23/2013
Due date:
% Done:

100%

Estimated time:
Spent time:
Occurs In:
Scope:
Internal
Experiment:
Mu2e
SSI Package:
-
Duration:

Description

I downloaded the Mac binaries for art mu2e:e4:prof and dependent packages.

I first tried to build the Mu2e code and eventually realized that we do not do closed builds but the Mac requires them. So that is on hold until we refactor our linkage loops and update our link lists.

The next thing to try was toyExperiment, which is a part of art-workbook. I had to fiddle a few more things than I anticipated, mostly because I never fully understood all of the cetbuildtools CMakeLists.txt files - just enough to get by. So I needed to learn a little more. But it eventually built. I am building using cetbuildtools v3_06_02, since that was the most recent version available in the Mac download.

The final piece of the puzzle was that I had to do the following by hand:

export LD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}

What is the correct long term solution for this? What is the correct hack in the mean time?

Do we need to rebuild art so that it looks for DYLD_LIBRARY_PATH? Is it ever safe to assume that DYLD_LIBRARY_PATH has reached a stable value and we can simply copy it into LD_LIBRARY_PATH at that time?

My first thought is to hack setup_for_development to sense the OS and to do the copy after everything else is done - but I am 100% sure that that is a robust solution.

Rob

Associated revisions

Revision 89a87f6d (diff)
Added by Christopher Green about 6 years ago

Fix for problem identified in issue #4576

History

#1 Updated by Christopher Green about 6 years ago

  • Tracker changed from Bug to Support
  • Status changed from New to Feedback
  • Assignee set to Christopher Green
  • Experiment Mu2e added
  • Experiment deleted (-)
  • SSI Package cetbuildtools added
  • SSI Package deleted ()

Hi Rob,

It appears that, while the OS X linker requires a closed link by default, this can be changed. Try adding:

-Wl,-undefined,dynamic_lookup
to the library link line. We will add this to cetbuildtools for an upcoming release, but that obviously does not affect you right now.

As for your other problem, nothing on an OS X system should be requiring LD_LIBRARY_PATH to my knowledge, so what leads you to believe it needs to be set?

#2 Updated by Christopher Green about 6 years ago

Note edit to previous comment to remove extraneous - from linker option.

cetbuildtool updated to use this option when NO_UNDEFINED is not set on OS X with commit:4bdaf5f.

#3 Updated by Rob Kutschke about 6 years ago

Replying to the question about LD_LIBRARY_PATH:

I downloaded and unwound the tar files for the binaries for art v1_08_4 -qmu2e:e4:prof plus dependent products:

Here is the setup:

source ~kutschke/Mu2e/Software/art/artexternals/setup
setup art v1_08_04 -qmu2e:e4:pro

Here is the small test fcl file:

process_name : test

source : {
  module_type : EmptyEvent
}

Here is the error:

art -c test.fcl -n 1
Expected environment variable FHICL_FILE_PATH is missing or empty: using "." 
%MSG-i MF_INIT_OK:  24-Aug-2013 12:10:53 CDT JobSetup 
Messagelogger initialization complete.
%MSG
terminate called after throwing an instance of 'cet::exception'
  what():  ---- getenv BEGIN
  Can't find an environment variable named "LD_LIBRARY_PATH" 
---- getenv END

Abort trap: 6

export LD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}

#4 Updated by Rob Kutschke about 6 years ago

Ooops - hit submit, not preview.

At this stage, LD_LIBRARY_PATH is empty and DYLD_LIBRARY_PATH is properly defined:

The fix is:

export LD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}

art -c test.fcl -n 1
Expected environment variable FHICL_FILE_PATH is missing or empty: using "." 
%MSG-i MF_INIT_OK:  24-Aug-2013 12:14:41 CDT JobSetup 
Messagelogger initialization complete.
%MSG
Begin processing the 1st record. run: 1 subRun: 0 event: 1 at 24-Aug-2013 12:14:41 CDT

TrigReport ---------- Event  Summary ------------
TrigReport Events total = 1 passed = 1 failed = 0

TimeReport ---------- Time  Summary ---[sec]----
TimeReport CPU = 0.000005 Real = 0.000007

Art has completed and will exit with status 0.

#5 Updated by Christopher Green about 6 years ago

  • Category set to Infrastructure
  • Target version set to 1.08.07
  • % Done changed from 0 to 100
  • SSI Package - added
  • SSI Package deleted (cetbuildtools)

The dependency on LD_LIBRARY_PATH was identified in art::LibraryManager. This was fixed with 89a87f6.

#6 Updated by Christopher Green about 6 years ago

  • Tracker changed from Support to Bug
  • Status changed from Feedback to Resolved

#7 Updated by Lynn Garren over 5 years ago

  • Status changed from Resolved to Closed


Also available in: Atom PDF