Giter VIP home page Giter VIP logo

swig-example's Introduction

SWIG Example

This is an example of how to use CMake with the SWIG interface generator. It is meant for those interested to use as a guide to setting up a project built by CMake with interfaces in other languages generated by SWIG.

Getting Started

Docker

If you have docker installed, the following should get you started with a sample environment

$ docker build -t swig-example .
$ docker run --name swig-example -it swig-example
$ # Now in container
# python swig/python/test.py

Local Build

To build locally, the following should be installed:

  • cmake
  • swig
  • python Headers (python-dev for debian-based systems)

It can then be built and run with

$ # Build libraries
$ mkdir build && cd build
$ cmake ..
$ make -j4
$ # Note that this currently installs in /usr/lib, which isn't ideal
$ make install
$ make install-python
$ # Go back to root dir to run
$ cd ..
$ python swig/python/test.sh

Languages

This example currently generates interfaces for the following languages:

  • Python

I will add languages as I need to use them. Anyone that wishes to add another language, feel free to open a pull request and let me know if there are any issues with using the installation procedure described below with your language.

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.