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

fix pack redundancy files and support any linux #21

Merged
merged 1 commit into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
build/**
*.whl
.vscode/**
dist/**
dist/**
build_cpp/**
src/cuda_mock.egg-info/**
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = ["scikit-build-core >=0.4.3", "nanobind >=1.3.2"]
build-backend = "scikit_build_core.build"
requires = ["setuptools>=42", "wheel", "scikit-build", "cmake>=3.17", "ninja"]
build-backend = "setuptools.build_meta"

[project]
name = "cuda-mock"
Expand Down
13 changes: 13 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from setuptools import setup
import os

build_cpp_dir = 'build_cpp'
build_py_dir = 'build'

os.system(f"cmake -S . -B {build_cpp_dir}")
os.system(f"cmake --build {build_cpp_dir}")

os.system(f"mkdir -p {build_py_dir}/lib/cuda_mock")
os.system(f"cp {build_cpp_dir}/lib/cuda_mock/*.so {build_py_dir}/lib/cuda_mock")

setup()
7 changes: 6 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@ nanobind_add_module(cuda_mock_impl STABLE_ABI cuda_mock_impl.cpp)

target_link_libraries(cuda_mock_impl PRIVATE cuda_mock)

include_directories(PRIVATE ${CMAKE_SOURCE_DIR}/include)
include_directories(PRIVATE ${CMAKE_SOURCE_DIR}/include)

set_target_properties(cuda_mock_impl
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/cuda_mock
)
Loading