py-torch: fix python_platlib reference (#28565)

This commit is contained in:
Adam J. Stewart 2022-02-01 02:44:08 -06:00 committed by GitHub
parent 728ac61bd8
commit a4a23ff713
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -206,12 +206,18 @@ class PyTorch(PythonPackage, CudaPackage):
@property @property
def libs(self): def libs(self):
root = join_path(python_platlib, 'torch', 'lib') # TODO: why doesn't `python_platlib` work here?
root = join_path(
self.prefix, self.spec['python'].package.platlib, 'torch', 'lib'
)
return find_libraries('libtorch', root) return find_libraries('libtorch', root)
@property @property
def headers(self): def headers(self):
root = join_path(python_platlib, 'torch', 'include') # TODO: why doesn't `python_platlib` work here?
root = join_path(
self.prefix, self.spec['python'].package.platlib, 'torch', 'include'
)
headers = find_all_headers(root) headers = find_all_headers(root)
headers.directories = [root] headers.directories = [root]
return headers return headers