This repository contains auxiliary material for the MLL workshop.
The following software products are required:
- A Java Development Kit (JDK) such as OpenJDK. Preferably install through a package manager like
apt
on UNIX-like systems. - A Java IDE such as Eclipse.
- A Docker installation.
- A shell such as Bash (comes preinstalled on UNIX-like systems) or Git Bash on Windows.
Install the software packages above. Then perform the following steps. Please let us know if you cannot confirm the bullet points marked with Please Confirm.
- Clone (ideally; else download) this repository to your computer.
- Open a shell and change the working directory to the root of this repository.
In most shells this is done using the
cd
(change directory) command. - Execute
docker-compose up -d
. The first run might require some time as Docker is downloading the required images. Subsequent runs will be much faster. - Open the directory
shared/mll
in Eclipse as a project. - Run the code once to automatically generate
.class
files.- Please Confirm I: There should be no errors. You should see (approximately) the following output:
Saved plot: out/plots/example.png Rendered dot file: out/dot/example.png Hello from LLVM! Optimized LLVM code: out/llvm/helloworld-O3.ll Hello from LLVM!
- Please Confirm II: When the file tree in Eclipse is refreshed (click on
the root, then press F5), you should find the files as mentioned
in the output above (i.e., a plot in the
out\plots
directory, a graph in theout\dot
directory and an (optimized) LLVM program in thellvm
directory with the namehelloworld-O3.ll
.
- Open the website
localhost:8888
in your browser. If required, provide the passwordml
. - Run the notebook
mll.ipynb
located in themll
directory. You can also alter some values, e.g., change the graph or the function.- Please Confirm III: There should be no errors. You should see a function
plot and a graph below the respective cells. There should be an (optimized)
LLVM program in the directory
mll\out\llvm
with the namehelloworld-O3.ll
.
- Please Confirm III: There should be no errors. You should see a function
plot and a graph below the respective cells. There should be an (optimized)
LLVM program in the directory
At this point you should be able to edit code locally in Eclipse and remotely through a Jupyter Notebook in your browser.
Run docker-compose down
to stop the docker container when finished with
working on this project.
- Code from the package
mll
will be available in a Jupyter Notebook once it is compiled to .class files and stored in theshared/mll/bin
directory. The package needs to be imported usingimport mll.*
in any Jupyter Notebook. - Any changes to these
.class
files requires a kernel restart.