Giter VIP home page Giter VIP logo

cpp_cython_bazel_example's Introduction

cpp_cython_bazel_example

A simple example project for cpp + cython. The bazel files in this project are adopted from Ray project and gRPC project.

Project Structure

.
├── BUILD.bazel
├── README.md
├── WORKSPACE
├── bazel
│   ├── BUILD
│   ├── BUILD.nlohmann_json
│   ├── BUILD.spdlog
│   ├── cy
│   │   ├── BUILD
│   │   ├── cython.BUILD
│   │   └── cython_library.bzl
│   ├── deps_build_all.bzl
│   ├── deps_setup.bzl
│   ├── project.bzl
│   ├── py
│   │   ├── BUILD
│   │   ├── BUILD.tpl
│   │   ├── python_configure.bzl
│   │   └── variety.tpl
│   └── python_deps.bzl
├── cpp
│   ├── include
│   │   └── my_package
│   │       └── my_header.h
│   └── src
│       └── my_lib.cpp
└── python
    └── my_package
        ├── __init__.py
        ├── __pycache__
        │   └── __init__.cpython-311.pyc
        ├── _my_package.pxd
        ├── _my_package.pyx
        └── _my_package.so

Python python/my_package depends on cpp. The bazel directory are the build tools, you don't need to care about.

Usage

  • Write your own .h and .cpp in cpp directory.
  • Rename the package directory python/my_package to python/<your package name>.
  • Write your own .pxd and .pyx in python/<your package name> directory, you can reference the cpp files.
  • Run bazel build //:build to build all, the so files will be copied into your python package directory.

Advanced

  • Add your cpp dependency in bazel/deps_setup.bzl.

cpp_cython_bazel_example's People

Contributors

codingl2k1 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.