git clone --recurse-submodules git@github.com:Intlekt/libieml.git
If you plan to work on the parser in addition of the frontend or the api, we suggest you to look at repository ieml-project instead.
docker-compose up --build --force-recreate build_python
docker-compose up --build --force-recreate build_wasm
Requires GCC 8+
if building the tests (requires <filesystem>
)
sudo apt install pkg-config uuid-dev
Java for generating the parser
sudo apt install default-jre
sudo apt install python3-dev
BUILD_TEST
build the test suiteBUILD_PYBIND11
build the python wrapper
mkdir build
cd build
cmake [opts] ..
make
For instance opts = "-DBUILD_TEST"
.
To install the Python wrapper (with 4 cores for compilation) use :
CMAKE_BUILD_PARALLEL_LEVEL=4 python setup.py install
An usage example :
import pyieml
parser = pyieml.Parser("""@component fr"test" (0 ~nom #'wa.') . """)
parser.parse()
print([e.to_json() for e in parser.errors()])
To build wasm, you have to download and install the emscripten toolchain.
At the moment, a package-config file is missing from the emscripten toolchain for uuid. For antlr4 to build, you have to add the following file to the ${EMSDK_ROOT}/upstream/emscripten/cache/sysroot/lib/pkgconfig/ folder.
filename: uuid.pc
Name: uuid
Description: Universally unique id library
Version: 2.37.3
Then run the following build commands:
mkdir build
cd build
emcmake cmake -DBUILD_WASM:bool=True ..
emmake make
Uses images built from repo.
docker-compose up --build --force-recreate test