py-torch: fix bug in libs/headers attributes (#24624)

This commit is contained in:
Adam J. Stewart 2021-07-06 01:53:05 -05:00 committed by GitHub
parent 1e3c012fea
commit 9055deea16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -223,12 +223,14 @@ class PyTorch(PythonPackage, CudaPackage):
@property
def libs(self):
root = join_path(site_packages_dir, 'torch', 'lib')
root = join_path(self.prefix, self.spec['python'].package.site_packages_dir,
'torch', 'lib')
return find_libraries('libtorch', root)
@property
def headers(self):
root = join_path(site_packages_dir, 'torch', 'include')
root = join_path(self.prefix, self.spec['python'].package.site_packages_dir,
'torch', 'include')
headers = find_all_headers(root)
headers.directories = [root]
return headers