This is the readme file of the ILK-Compiler tool.
A Lua interpreter and luarocks are required.
Please install them from your package manager (or from sources).
NOTE: getting luarocks using apt-get install may result in inconsistencies
between Lua and Luarocks, on Ubuntu.
For example:
sudo apt-get install lua5.2 liblua5.2-dev
wget http://luarocks.github.io/luarocks/releases/luarocks-2.4.4.tar.gz
tar zxvf luarocks-2.4.4.tar.gz
cd luarocks-2.4.4/
./configure --lua-version=5.2
make build
sudo make install
cd ..
Then, install Lua dependencies using luarocks:
cd etc/
luarocks install --local --only-deps ilkcompiler-<version>.rockspec
First issue this command in your shell:
eval `luarocks path`
Then you can run the actual compiler; no arguments or the --help switch
will show some usage information:
./ilk-compiler.lua --help
The output directory will contain the code generated by the compiler, in the
language selected with the --backend switch. Currently, three backends (i.e.
target languages) are supported:
- C++/Eigen (
--backend=eigen) - Python/Numpy (
--backend=numpy) - Julia (
--backend=julia)
You will need the Eigen3 C++ library installed in your system, including
the corresponding pkg-config configuration file (which is usually
/usr/local/share/pkgconfig/eigen3.pc). This file will be installed if you
follow the standard make procedure for Eigen.
You also need our Eigen backend library, which is shipped within this repository. It is a minimal collection of support functions referenced by the generated code. Please build and install it in your system, using the standard CMake procedure:
cd backend/eigen
mkdir build
cd build
cmake ..
make
sudo make install
Afterwards, you can build the generated code also with cmake; in the output
directory where the code was generated:
mkdir build
cd build/
cmake ..
make
Type make edit_cache to change some options, like enabling the building of the
tests.
Please add to your PYTHONPATH the location of our Python backend package,
which is backend/ilknumpy -- the full path of backend/ must appear in
PYTHONPATH, as ilknumpy is the actual package.
Please set the JULIA_LOAD_PATH environment variable with the path of our Julia
backend module (under backend/julia) and the path with the generated code. For
example:
export JULIA_LOAD_PATH=.../ilk-compiler/backend/julia/:/tmp/ilkgen/julia:
Do not forget the trailing :.