Skip to content

Commit e3e3eed

Browse files
committed
Build qoco-cuda wheel
1 parent 515a7d2 commit e3e3eed

4 files changed

Lines changed: 19 additions & 13 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
build/
33
.vscode/
44
__pycache__/
5-
qoco_custom*/
5+
qoco_custom*/
6+
src/bindings.cpp

CMakeLists.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,14 @@ FetchContent_MakeAvailable(qoco)
3131

3232
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/bindings.cpp.in
3333
${CMAKE_CURRENT_SOURCE_DIR}/src/bindings.cpp)
34-
pybind11_add_module(qoco_ext src/bindings.cpp)
35-
target_include_directories(qoco_ext INTERFACE ${qoco_SOURCE_DIR}/include)
34+
pybind11_add_module(${QOCO_EXT_MODULE_NAME} src/bindings.cpp)
35+
target_include_directories(${QOCO_EXT_MODULE_NAME} INTERFACE ${qoco_SOURCE_DIR}/include)
36+
install(TARGETS ${QOCO_EXT_MODULE_NAME} DESTINATION . COMPONENT python)
3637

3738
if(${QOCO_ALGEBRA_BACKEND} STREQUAL "builtin")
3839
target_link_libraries(qoco_ext PUBLIC pybind11::module qocostatic)
3940
elseif(${QOCO_ALGEBRA_BACKEND} STREQUAL "cuda")
4041
enable_language(CUDA)
4142
find_package(CUDA)
42-
target_link_libraries(qoco_ext PUBLIC pybind11::module qocostatic cudart)
43-
endif()
44-
45-
install(TARGETS qoco_ext DESTINATION . COMPONENT python)
43+
target_link_libraries(qoco_cuda PUBLIC pybind11::module qocostatic cudart)
44+
endif()

backends/cuda/pyproject.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@ requires = ["scikit-build-core", "pybind11"]
33
build-backend = "scikit_build_core.build"
44

55
[project]
6-
name = "qoco"
7-
version = "0.2.0"
6+
name = "qoco-cuda"
7+
version = "0.1.0"
88
description = "QOCO: Quadratic Objective Conic Optimizer"
9-
readme = "README.md"
109
requires-python = ">=3.8"
1110
authors = [{ name = "Govind M. Chari", email = "govindchari1@gmail.com" }]
12-
dependencies = ["jinja2", "numpy>=1.7", "qdldl", "scipy>=0.13.2", "setuptools"]
11+
dependencies = ["numpy>=1.7", "scipy>=0.13.2", "setuptools", "qoco>=0.2.0"]
1312

1413
[tool.scikit-build]
1514
install.components = ["python"]
16-
wheel.install-dir = "qoco"
15+
cmake.source-dir = "../.."
1716

1817
[tool.scikit-build.cmake.define]
1918
QOCO_ALGEBRA_BACKEND = "cuda"
@@ -22,3 +21,6 @@ QOCO_EXT_MODULE_NAME = "qoco_cuda"
2221
[project.urls]
2322
Homepage = "https://github.com/qoco-org/qoco"
2423
Issues = "https://github.com/qoco-org/qoco/issues"
24+
25+
[tool.setuptools_scm]
26+
root = "../.."

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ description = "QOCO: Quadratic Objective Conic Optimizer"
99
readme = "README.md"
1010
requires-python = ">=3.8"
1111
authors = [{ name = "Govind M. Chari", email = "govindchari1@gmail.com" }]
12-
dependencies = ["jinja2", "numpy>=1.7", "qdldl", "scipy>=0.13.2", "setuptools"]
12+
dependencies = ["numpy>=1.7", "scipy>=0.13.2", "setuptools"]
13+
[project.optional-dependencies]
14+
cuda = [
15+
"qoco-cuda",
16+
]
1317

1418
[tool.scikit-build]
1519
install.components = ["python"]

0 commit comments

Comments
 (0)