py-torch: define property cmake_prefix_paths (#37012)

* py-torch: define property cmake_prefix_paths

`py-torch` installs `libtorch` and a cmake config in a non-standard location. This points downstream code to the relevant locations. From there it should pick up the correctly library and include paths for C++ projects.

* py-torch: python_platlib suggestion

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* [@spackbot] updating style on behalf of wdconinc

* py-torch: back to self.spec["python"].package.platlib

* [@spackbot] updating style on behalf of wdconinc

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
Co-authored-by: wdconinc <wdconinc@users.noreply.github.com>
This commit is contained in:
Wouter Deconinck 2023-04-19 16:12:45 -05:00 committed by GitHub
parent 6ca41cfbcb
commit c7508dc216
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -606,3 +606,10 @@ def build_amd(self):
def install_test(self):
with working_dir("test"):
python("run_test.py")
@property
def cmake_prefix_paths(self):
cmake_prefix_paths = [
join_path(self.prefix, self.spec["python"].package.platlib, "torch", "share", "cmake")
]
return cmake_prefix_paths