Here's how to get and run the compiler.
Set It Up
- Get Java if you don't already have it. On macOS with Homebrew, for example, you can use
brew cask install adoptopenjdk.
- Install Scala and sbt. On macOS, use
brew install scala sbt.
Now you can compile the compiler by typing
sbt test to run the tests.
sbt assembly to generate a fat jar for command-line use and distribution.
If you're working on the compiler, you probably want to use the sbt console instead (it's faster for repeated builds).
sbt alone to get the console, where you can type commands like
Adding the prefix
~ (such as
sbt go into watch mode, i.e., it will re-run the command every time a dependency changes. Use
~assembly to continuously update
~test to continuously test the changes.
If you want to execute a sequence of
sbt commands without starting
sbt console, you can type
sbt "; cmd1; cm2 ...". For example,
sbt "; test; assembly" will run
sbt test followed by
sbt assembly to package up a fat jar for command-line use.
fuse shell script here invokes the built jar to run the compiler.
To compile a simple test, for example, run:
$ ./fuse src/test/resources/should-compile/matadd.sea
The compiler produces HLS C source code on its standard output.