From c7508dc21625b80b0fc6a4b835f0a6fdd38480d3 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 19 Apr 2023 16:12:45 -0500 Subject: [PATCH] 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 * [@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 Co-authored-by: wdconinc --- var/spack/repos/builtin/packages/py-torch/package.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/var/spack/repos/builtin/packages/py-torch/package.py b/var/spack/repos/builtin/packages/py-torch/package.py index c0e3d01254..63f9218dc7 100644 --- a/var/spack/repos/builtin/packages/py-torch/package.py +++ b/var/spack/repos/builtin/packages/py-torch/package.py @@ -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