diff --git a/packages/hxtorch/package.py b/packages/hxtorch/package.py index 43d44ba7815c97b1b1c7f72d00595b19b7bc86d7..833194e156b828a477e8d174f940c589ce7d2599 100644 --- a/packages/hxtorch/package.py +++ b/packages/hxtorch/package.py @@ -62,7 +62,7 @@ class Hxtorch(WafPackage): query = self.spec[dep.name] try: if dep.name in ['pthreadpool', 'fxdiv']: - print('skipping {} for headers'.format(dep.name)) + print('skipping {} in SPACK_INCLUDE_DIRS/CPATH/C{,_PLUS}_INCLUDE_PATH\n'.format(dep.name)) for d in query.headers.directories: if os.path.exists(d): env.remove_path('SPACK_INCLUDE_DIRS', d) @@ -75,25 +75,22 @@ class Hxtorch(WafPackage): library = [] for dep in self.spec.traverse(deptype=('link', 'run')): query = self.spec[dep.name] + # we probably should skip/remove the entries for the same + # dependencies as above; however, ".libs" relies on the package + # name being the same as the library name (e.g. approx. + # libPACKAGE.so) so we are just moving googletest to the front + if dep.name == 'googletest': + for d in [self.spec['googletest'].prefix.lib64, self.spec['googletest'].prefix.lib]: + if os.path.exists(d): + print('moving to front of SPACK_{LINK,RPATH}_DIRS\n', d) + env.remove_path('SPACK_LINK_DIRS', d) + env.prepend_path('SPACK_LINK_DIRS', d) + env.remove_path('SPACK_RPATH_DIRS', d) + env.prepend_path('SPACK_RPATH_DIRS', d) try: - if dep.name in ['pthreadpool', 'fxdiv']: - print('skipping {} for libs'.format(dep.name)) - for d in query.libs.directories: - if os.path.exists(d): - env.remove_path('SPACK_LINK_DIRS', d) - env.remove_path('SPACK_RPATH_DIRS', d) - continue - if dep.name == 'googletest': - for d in [self.spec['googletest'].prefix.lib64, self.spec['googletest'].prefix.lib]: - if os.path.exists(d): - print('manually inserting at front ', d) - env.remove_path('SPACK_LINK_DIRS', d) - env.prepend_path('SPACK_LINK_DIRS', d) - env.remove_path('SPACK_RPATH_DIRS', d) - env.prepend_path('SPACK_RPATH_DIRS', d) - continue - library.extend(query.libs.directories) print('libs (', dep.name, '):', query.libs.directories, "\n") + # extend at front + library = query.libs.directories + library except: pass