JuliaCon 2020 (times are in UTC)

Wrapping a C++ library using CxxWrap.jl
07-26, 14:00–17:30 (UTC), Green Track

This workshop will show how to use CxxWrap.jl to wrap a C++ library, based on tutorial material that can be followed along during the workshop. We will show everything you need to know about writing and compiling the required C++ wrapping code.

Setup beforehand is required, see https://github.com/barche/cxxwrap-juliacon2020#docker-dev-container

Join via Zoom: link in email from Eventbrite. Backup Youtube link: https://youtu.be/VoXmXtqLhdo


The prerequisites for following this workshop are a working C++17 compiler and a Julia installation, details are given at the workshop github repository

The workshop is built up around exercises that can be followed along on your own machine. We start off with some generic tutorials about compiling a very simple shared library and using that directly from Julia using ccall, and then build up more complex cases using CxxWrap to tackle proper C++ constructs such as classes and templates. Exercises are as follows:

  1. Shared libraries: build and use libfoo from the BinaryBuilder tests, using CMake. This will gently introduce everyone to the manual compilation of a shared library, which is required for package development with CxxWrap.
  2. Setting up CxxWrap for development: Compile CxxWrap itself using your system compiler and set it up using Overrides.toml. This is needed on most platforms, since the distributed CxxWrap binaries are cross-compiled and usually incompatible with the installed compiler.
  3. Make a CxxWrap wrapper package for libfoo
  4. Wrapping the Eigen C++ matrix library
  5. Smart pointers
  6. Using and extending the STL support
  7. Distributing your package using BinaryBuilder: this will focus on the attention points when using BinaryBuilder, for example it is necessary to download Julia itself to compile a CxxWrap package.

Bart Janssens is a military associate professor at the mechanics department of the Royal Military Academy, with a passion for computer graphics, high performance computing and fluid mechanics. For performance reasons, he used C++ until being introduced to Julia. His current work focuses on making scientific C++ libraries such as Trilinos interoperate with Julia, with the ultimate objective of developing CFD code for Julia.

This speaker also appears in: