add USE_CUDA env in python_build

This commit is contained in:
AndreaRigoni
2026-03-05 15:17:30 +00:00
parent 554eff9b55
commit 79e1abb2ff
2 changed files with 15 additions and 1 deletions

View File

@@ -61,3 +61,10 @@ cmake --preset conan-release
```bash
cmake --build build -j10
```
### Make python package
```bash
micromamba run -n mutom env USE_CUDA=ON poetry install
```

View File

@@ -26,12 +26,19 @@ def build(setup_kwargs):
print(f"Project root: {project_root}")
print(f"Target binary dir: {package_dir}")
# Determine if CUDA should be enabled
use_cuda = os.environ.get("USE_CUDA", "OFF").upper()
if use_cuda in ["ON", "1", "TRUE", "YES"]:
use_cuda = "ON"
else:
use_cuda = "OFF"
# CMake configuration
cmake_args = [
f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={package_dir}",
f"-DPYTHON_EXECUTABLE={sys.executable}",
"-DCMAKE_BUILD_TYPE=Release",
"-DUSE_CUDA=OFF",
f"-DUSE_CUDA={use_cuda}",
"-G", "Unix Makefiles",
]