The first thing you will need to do is get set up with a C++ compiler, such as gpp
. This should be straightforward for Linux and macOS users. Windows users can use the MinGW port of gpp
or Visual Studio's compiler, but note that you may run into .pyd
portability issues if you go the VS route.
Next, you will need Python 3.6+ -- all of my testing was done on Python 3.8, but so long as your version supports type annotations you should be good to go.
Assuming you have pip
available (if not, you should), you can then download this repository and run pip install -r requirements.txt
to install Cython
and its requirements as well as tabulate
, which is used for formatting the benchmark data.
All of the source code is in /Code
, and the presentation files are in /Presentation
.
build_all.sh
and build_all.bat
will automatically compile all of the source code in the repository for you using cythonize
, which should be in your environment variables after installing Cython
. If not, it is located in [python install location]/Scripts/
. The scripts also tell cythonize
to spit out HTML annotations of the code for studying purposes.
After the code is built, the benchmark can be run via python benchmark.py
Here is a collection of resources that will greatly improve your life while learning Cython