Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug[next]: Use same python in CMake as used for execution #1567

Merged
8 changes: 7 additions & 1 deletion src/gt4py/next/otf/compilation/build_systems/cmake_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,15 @@ def visit_FindDependency(self, dep: FindDependency) -> str:
# Instead, design this to be extensible (refer to ADR-0016).
match dep.name:
case "nanobind":
import sys

import nanobind

py = "find_package(Python COMPONENTS Interpreter Development REQUIRED)"
py = f"""
set(Python_EXECUTABLE {sys.executable})

find_package(Python COMPONENTS Interpreter Development REQUIRED)
"""
nb = f"find_package(nanobind CONFIG REQUIRED PATHS {nanobind.cmake_dir()} NO_DEFAULT_PATHS)"
return py + "\n" + nb
case "gridtools_cpu" | "gridtools_gpu":
Expand Down