This example shows how to build and run Python matplotlib
from C/C++ source code. The instructions are focused on Linux but it can be ported to other platforms easily.
Install MetaCall:
git clone https://github.com/metacall/core.git
mkdir core/build && cd core/build
cmake -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_DETOURS=Off -DOPTION_BUILD_SCRIPTS=Off -DOPTION_BUILD_TESTS=Off ..
cmake --build . --target install
Install matplotlib
dependency:
pip3 install --user matplotlib
Build example source code:
gcc -std=c11 main.c -lmetacall
Run executable previously built:
export LOADER_SCRIPT_PATH="`pwd`"
./a.out
Building and running with Docker:
docker build -t metacall/embedding-matplotlib-example .
docker run --rm -v $(pwd)/output:/output -it metacall/embedding-matplotlib-example ./a.out
For seeing the plot, open the output
folder.