All Projects → personalrobotics → chimera

personalrobotics / chimera

Licence: BSD-3-Clause license
🐍 A CLI tool for generating Boost.Python/pybind11 bindings from C/C++

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects
python
139335 projects - #7 most used programming language
c
50402 projects - #5 most used programming language
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to chimera

awesome-cpp-python-binding-generator
😎 A curated list of awesome automatic Python binding generators for C++ projects
Stars: ✭ 16 (+33.33%)
Mutual labels:  pybind11, boost-python
python-poppler
Python binding to Poppler-cpp pdf library
Stars: ✭ 51 (+325%)
Mutual labels:  pybind11
CastXMLSuperbuild
Build CastXML and its dependencies (LLVM/Clang)
Stars: ✭ 32 (+166.67%)
Mutual labels:  llvm
heyoka
C++ library for ODE integration via Taylor's method and LLVM
Stars: ✭ 151 (+1158.33%)
Mutual labels:  llvm
proton-clang-build
A set of scripts to build optimized LLVM and binutils toolchains. See https://github.com/kdrag0n/proton-clang for prebuilts.
Stars: ✭ 30 (+150%)
Mutual labels:  llvm
lldbg
A lightweight native GUI for LLDB.
Stars: ✭ 83 (+591.67%)
Mutual labels:  llvm
llvm-epp
Efficient Path Profiling using LLVM
Stars: ✭ 16 (+33.33%)
Mutual labels:  llvm
pogonos
Another Clojure(Script) implementation of Mustache templating language
Stars: ✭ 56 (+366.67%)
Mutual labels:  mustache
nimib
nimib 🐳 - nim 👑 driven ⛵ publishing ✍
Stars: ✭ 89 (+641.67%)
Mutual labels:  mustache
aWsm
WebAssembly ahead-of-time compiler and runtime. Focuses on generating fast code, simplicity, and portability.
Stars: ✭ 177 (+1375%)
Mutual labels:  llvm
Compiler-written-in-Haskell
A Turing complete language 😉
Stars: ✭ 31 (+158.33%)
Mutual labels:  llvm
ebpfpub
ebpfpub is a generic function tracing library for Linux that supports tracepoints, kprobes and uprobes.
Stars: ✭ 86 (+616.67%)
Mutual labels:  llvm
m2lang
The LLVM-based Modula-2 compiler
Stars: ✭ 29 (+141.67%)
Mutual labels:  llvm
anvill
anvill forges beautiful LLVM bitcode out of raw machine code
Stars: ✭ 228 (+1800%)
Mutual labels:  llvm
TinyCompiler
c compiler based on flex(lex), bison(yacc) and LLVM, supports LLVM IR and obj code generation. 基于flex,bison以及LLVM,使用c++11实现的类C语法编译器, 支持生成中间代码及可执行文件.
Stars: ✭ 162 (+1250%)
Mutual labels:  llvm
pymlir
Python interface for MLIR - the Multi-Level Intermediate Representation
Stars: ✭ 84 (+600%)
Mutual labels:  llvm
dr checker 4 linux
Port of "DR.CHECKER : A Soundy Vulnerability Detection Tool for Linux Kernel Drivers" to Clang/LLVM 10 and Linux Kernel
Stars: ✭ 34 (+183.33%)
Mutual labels:  llvm
opencilk-project
Monorepo for the OpenCilk compiler, forked from llvm/llvm-project. See the OpenCilk/infrastructure repository for build and installation instructions.
Stars: ✭ 42 (+250%)
Mutual labels:  llvm
gci-leaders
A website showing Google Code-in information 🏆
Stars: ✭ 40 (+233.33%)
Mutual labels:  mustache
LLVM-Metadata-Visualizer
LLVM Metadata Visualizer
Stars: ✭ 20 (+66.67%)
Mutual labels:  llvm

chimera

C/C++ CI Build Status Build Status codecov

chi·me·ra
/kīˈmirə,kəˈmirə/ speaker

informal, noun

  1. a thing that is hoped or wished for but in fact is illusory or impossible to achieve.
  2. a utility to generate Boost.Python bindings for C++ code.

Chimera is a tool for generating Boost.Python/Pybind11 bindings from C/C++ header files. It uses the Clang/LLVM toolchain, making it capable of automatically handling fairly complex source files.

Usage

$ ./chimera -c <yaml_config_file> -o <output_path> my_cpp_header1.h my_cpp_header2.h -- [compiler args]

Installation

On Ubuntu using apt

Chimera provides Ubuntu packages for Xenial (16.04 LTS), Bionic (18.04 LTS), Eoan (19.10), and Focal (20.04).

Xenial and greater

$ sudo add-apt-repository ppa:personalrobotics/ppa
$ sudo apt update
$ sudo apt install chimera

On macOS using Homebrew

# Install the Homebrew package manager
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Add Homebrew tap for Personal Robotics Lab software
$ brew tap personalrobotics/tap
# Install Chimera
$ brew install chimera

Build from Source

Requirements

  • libclang 6.0, 7, 8, 9
  • llvm 6.0, 7, 8, 9 (+ tools)
  • libedit
  • yaml-cpp
  • boost

On Ubuntu from Source

Install Dependencies

$ sudo apt-get install llvm-6.0-dev llvm-6.0-tools libclang-6.0-dev libedit-dev \
$   libyaml-cpp-dev libboost-dev lib32z1-dev

Build Chimera

$ git clone https://github.com/personalrobotics/chimera.git
$ cd chimera
$ mkdir build && cd build
$ cmake -DCMAKE_BUILD_TYPE=Release ..
$ make
$ sudo make install

On macOS from Source

$ brew install boost llvm yaml-cpp
$ brew install eigen  # for examples
$ git clone https://github.com/personalrobotics/chimera.git
$ cd chimera
$ mkdir build && cd build
$ PKG_CONFIG_PATH=$(brew --prefix yaml-cpp)/lib/pkgconfig cmake -DCMAKE_BUILD_TYPE=Release \
    -DLLVM_DIR=$(brew --prefix llvm)/lib/cmake/llvm ..
$ make
$ sudo make install

Example

Let's try running chimera on itself!

$ cd [PATH TO CHIMERA]
$ rm -rf build && mkdir -p build && cd build
$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
$ make
$ chimera -p . -o chimera_py_binding.cpp ../src/chimera.cpp

Configuration

# The C++ namespaces that will be extracted by Chimera
namespaces:
  - dart::dynamics
  - dart::math

# Selected types that should have special handling.
# (Not implemented yet.)
types:
  'class BodyNode':
    convert_to: 'class BodyNodePtr'

# Selected function and class declarations that need custom parameters.
functions:
  'const Eigen::Vector4d & ::dart::dynamics::Shape::getRGBA() const':
    return_value_policy: copy_const_reference
  'bool ::dart::dynamics::Skeleton::isImpulseApplied() const':
    source: 'test.cpp.in'
  'const Eigen::Vector3d & ::dart::dynamics::Shape::getBoundingBoxDim() const':
    content: '/* Instead of implementing this function, insert this comment! */'
  'Eigen::VectorXd & ::dart::optimizer::GradientDescentSolver::getEqConstraintWeights()': null
    # This declaration will be suppressed.

classes:
  '::dart::dynamics::Shape':
    name: Shape
    bases: []
    noncopyable: true

Troubleshooting

Is there a length limit for the keys in the configuration file of Chimera?

Yes. yaml-cpp does not support more than 1024 characters for a single line key. If you want to use a longer key, then you should use multi-line key.

License

Chimera is released under the 3-clause BSD license. See LICENSE for more information.

Authors

Chimera is developed by Michael Koval (@mkoval) and Pras Velagapudi (@psigen), and it has received major contributions from Jeongseok Lee (@jslee02).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].