Skip to content

Use Cython to compile the Python 3 sources to C/C++ shared libraries and executables.

Notifications You must be signed in to change notification settings

duruyao/cython-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cython Example

Use Cython to compile the Python 3 sources to C/C++ shared libraries and executables.

Prerequisites

  • Python/Conda
  • Cython
  • GCC/G++

Get Started

See setup-3.7.py or setup-3.9.py, and create a set.py to your python source folder. It will act as the Makefile for the build.

python3 setup.py build_ext --cython-c-in-temp -j 6

The build directory looks like the tree structure below.

build/
├── lib.linux-x86_64-3.9
│   ├── fib.cpython-39-x86_64-linux-gnu.so
│   ├── hello.cpython-39-x86_64-linux-gnu.so
│   ├── logic.cpython-39-x86_64-linux-gnu.so
│   └── main
└── temp.linux-x86_64-3.9
    ├── build
    │   └── temp.linux-x86_64-3.9
    │       └── pyrex
    │           ├── fib.o
    │           ├── hello.o
    │           └── logic.o
    └── pyrex
        ├── fib.c
        ├── hello.c
        ├── logic.c
        └── main.c

About

Use Cython to compile the Python 3 sources to C/C++ shared libraries and executables.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages