-
Notifications
You must be signed in to change notification settings - Fork 148
Closed
Labels
Description
tbb 4.1.4.192 does not install correctly on RedHat Enterprise 5.9, it picks the wrong tbb
library.
There are two options for tbb 4.1.4.192 gcc4.4 or gcc4.1 tbb libraries.
I made these modification to the tbb.py easyblock to correct this problem.
def get_library_directory():
"""Determine tbb library directory to use"""
myCommand = "gcc --version"
f = subprocess.Popen(myCommand,shell=True,stdin=subprocess.PIPE,stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout
for line in f:
s = re.search('\d\.\d\.\d',line)
if s:
gcc_version = s.group()
s2 = re.search('^4\.[4-9]',gcc_version)
if s2:
return "gcc4.4"
else:
return "gcc4.1"
def install_step(self):
"""Custom install step, to add extra symlinks"""
silent_cfg_names_map = None
if LooseVersion(self.version) < LooseVersion('4.2'):
silent_cfg_names_map = {
'activation_name': ACTIVATION_NAME_2012,
'license_file_name': LICENSE_FILE_NAME_2012,
}
super(EB_tbb, self).install_step(silent_cfg_names_map=silent_cfg_names_map)
# save libdir
os.chdir(self.installdir)
if LooseVersion(self.version) < LooseVersion('4.1.0.0'):
libglob = 'tbb/lib/intel64/cc*libc*_kernel*'
libs = glob.glob(libglob)
if len(libs):
libdir = libs[-1] # take the last one, should be ordered by cc get_version.
# we're only interested in the last bit
libdir = libdir.split('/')[-1]
else:
self.log.error("No libs found using %s in %s" % (libglob, self.installdir))
else:
# libglob = 'tbb/lib/intel64/gcc*'
libdir = get_library_directory()
self.libdir = libdir
self.libpath = "%s/tbb/libs/intel64/%s/" % (self.installdir, libdir)
self.log.debug("self.libpath: %s" % self.libpath)
# applications go looking into tbb/lib so we move what's in there to libs
# and symlink the right lib from /tbb/libs/intel64/... to lib
install_libpath = os.path.join(self.installdir, 'tbb', 'lib')
shutil.move(install_libpath, os.path.join(self.installdir, 'tbb', 'libs'))
os.symlink(self.libpath, install_libpath)
Thanks,
Cormac.