This is app template for install libc
- OS: Ubuntu v21.04 or later
- Runtime environment: Python version 3.9.x
- Package manager: APT (Ubuntu)
sudo apt-get install build-essential
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt --trusted-host pypi.python.org
- Make env folder
- Add secrets key to env/dev.env
- Secrets key can find at app/core/config.py
- Auto autoflake,isort then black all .py file in git status
./scripts/format.sh
- Add new C file to app/libc/source/
// square.c
#include <stdio.h>
int square(int i) {
return i * i;
}
- Add Lib info to app/libc/lib.json
[
{
"name":"square libc",
"_file":"square",
"description":"This is test libc with square function"
}
]
- Install libc(or build .so file from .c file), run command:
./scripts/install_libc.sh
- List all libc is installed
python manage.py libc list
#######################################################
name: square libc
_file: square
install: from libc import square
description: This is test libc with square function
#######################################################
- Use libc with install
from libc import square as square_lib
square_lib.square(10) #100