-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use standard locations if the LD_LIBRARY_PATH or ROOTSYS are empty #1378
base: master
Are you sure you want to change the base?
Changes from 3 commits
26153be
e320ac5
5d8caf0
b79da51
826dce3
875c1fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,13 +25,24 @@ def compileAClick(dictionary, g4=True): | |
""" | ||
from ROOT import gInterpreter, gSystem | ||
import os.path | ||
dd4hep = os.environ['DD4hepINSTALL'] | ||
inc = ' -I' + os.environ['ROOTSYS'] + '/include -I' + dd4hep + '/include ' | ||
lib = ' -L' + dd4hep + '/lib -lDDCore -lDDG4 -lDDSegmentation ' | ||
if os.getenv("DD4hepINSTALL") is not None: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. getenv has an optional default https://docs.python.org/3/library/os.html#os.getenv |
||
dd4hep = os.environ['DD4hepINSTALL'] | ||
else: | ||
dd4hep = "/usr" | ||
if os.getenv("ROOTSYS") is not None: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. getenv has an optional default https://docs.python.org/3/library/os.html#os.getenv |
||
rootsys = os.environ['ROOTSYS'] | ||
else: | ||
rootsys = "/usr" | ||
|
||
inc = ' -I' + rootsys + '/include -I' + dd4hep + '/include ' | ||
lib = ' -L' + dd4hep + '/lib64 ' + ' -L' + dd4hep + '/lib -lDDCore -lDDG4 -lDDSegmentation ' | ||
if g4: | ||
geant4 = os.environ['G4INSTALL'] | ||
if os.getenv("G4INSTALL") is not None: | ||
geant4 = os.environ['G4INSTALL'] | ||
else: | ||
geant4 = "/usr" | ||
inc = inc + ' -I' + geant4 + '/include/Geant4 -Wno-shadow -g -O0 ' | ||
lib = lib + ' -L' + geant4 + '/lib -L' + geant4 + '/lib64 -lG4event -lG4tracking -lG4particles ' | ||
lib = lib + ' -L' + geant4 + '/lib64 -L' + geant4 + '/lib -lG4event -lG4tracking -lG4particles ' | ||
|
||
gSystem.AddIncludePath(inc) | ||
gSystem.AddLinkedLibs(lib) | ||
|
@@ -50,7 +61,14 @@ def loaddd4hep(): | |
import os | ||
import sys | ||
# Add ROOT to the python path in case it is not yet there.... | ||
sys.path.append(os.environ['ROOTSYS'] + os.sep + 'lib') | ||
if os.getenv("ROOTSYS") is not None: | ||
rootsys = os.environ['ROOTSYS'] | ||
else: | ||
rootsys = "/usr" | ||
sys.path.append(rootsys + os.sep + 'lib') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use os.path.join |
||
sys.path.append(rootsys + os.sep + 'lib64') | ||
sys.path.append(rootsys + os.sep + 'lib' + os.sep + 'root') | ||
sys.path.append(rootsys + os.sep + 'lib64' + os.sep + 'root') | ||
from ROOT import gSystem | ||
|
||
import platform | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -156,9 +156,10 @@ namespace Gaudi { | |
const char sep = ':'; | ||
#endif | ||
char* search_path = ::getenv( envVar ); | ||
if ( search_path ) { | ||
if ( true ) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why? Add a comment. |
||
logger().debug( std::string( "searching factories in " ) + envVar ); | ||
std::string path( search_path ); | ||
std::string path; | ||
if ( search_path ) path = std::string(search_path); else path="/usr/lib64:/usr/lib:/usr/local/lib"; | ||
andriish marked this conversation as resolved.
Show resolved
Hide resolved
|
||
std::string::size_type pos = 0; | ||
std::string::size_type newpos = 0; | ||
while ( pos != std::string::npos ) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getenv has an optional default https://docs.python.org/3/library/os.html#os.getenv