add USE_CUDA env in python_build
This commit is contained in:
@@ -61,3 +61,10 @@ cmake --preset conan-release
|
|||||||
```bash
|
```bash
|
||||||
cmake --build build -j10
|
cmake --build build -j10
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Make python package
|
||||||
|
|
||||||
|
```bash
|
||||||
|
micromamba run -n mutom env USE_CUDA=ON poetry install
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -26,12 +26,19 @@ def build(setup_kwargs):
|
|||||||
print(f"Project root: {project_root}")
|
print(f"Project root: {project_root}")
|
||||||
print(f"Target binary dir: {package_dir}")
|
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 configuration
|
||||||
cmake_args = [
|
cmake_args = [
|
||||||
f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={package_dir}",
|
f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={package_dir}",
|
||||||
f"-DPYTHON_EXECUTABLE={sys.executable}",
|
f"-DPYTHON_EXECUTABLE={sys.executable}",
|
||||||
"-DCMAKE_BUILD_TYPE=Release",
|
"-DCMAKE_BUILD_TYPE=Release",
|
||||||
"-DUSE_CUDA=OFF",
|
f"-DUSE_CUDA={use_cuda}",
|
||||||
"-G", "Unix Makefiles",
|
"-G", "Unix Makefiles",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user