You can build Alusus on Linux or macOS. For Linux any distro can be used as long as it includes version 7 or higher of GCC. For macOS we tested building on macOS 10.13 with Xcode 9.3. It might be possible to build on older versions, but we haven't tested that.

External Dependencies

You'll need GCC (version 7 or above) CMake, Python3, and Pip to be able to build the binaries from the source code. LLVM also has its own dependencies like zlib and valgrind for example that you might need to install manually. You'll also need libssl-dev to be able to use https in the Standard Runtime Library.
To install the build tools in Ubuntu use the following command:
$ sudo apt-get install gcc g++ cmake python3 python3-pip zlib1g-dev libssl-dev
For other distros you'll need to check their documentation on how to install these tools. Notice that the build script assumes that the Python executable is named `python3` in the system, which is the case on Ubuntu systems. If you are on other distros you might need to create some sym links or update the `build.sh` script.
You don't need to manually install LLVM as this will be done automatically by the build script.
If you also want to generate install packages you'll need to install fpm.

Starting the Build

After installing the dependencies all you need to do is to launch build.sh, which will do the following:
  • Download and build LLVM, if not already built.
  • Download and build libcurl, if not already built.
  • Download and build libzip, if not already built.
  • Build Alusus.
  • Generate install package(s) if requested.
Running the build script for the first time will take a long time to build all the dependencies (especially LLVM), but subsequent builds will not need to rebuild dependencies and therefore will be much faster. Launching the build script can be done as follows:
$ cd <path-to-Alusus>
$ ./Tools/build.sh --bloc . --iloc .
build.sh receives the following arguments:
  • --bloc <path>: The path where the Builds folder will be placed.
  • --iloc <path>: The path where Bin, Lib, and Include will be placed after the build is complete.
  • --btype <build type>: The type of the build. Value p, which is the default, indicates a debug build, while r indicates a release build. Passing p results in a release build followed by a package generation.
When you pass p as btype the script will generate deb and rpm packages if you are building on Linux, while building on macOS will result in a pkg file.

Executing Automated Tests


Executing the automated tests is simple. All you need to do is to run the following command inside the Alusus' build folder (Builds/Debug in the example above) after the build is complete:
$ make test

Using Alusus


After the build is complete you'll have the executable under Bin and the libraries will go under Lib. You'll be able to run the examples as follows:
$ export PATH=<path-to-Alusus>/Bin:$PATH
$ cd <path-to-Alusus>/Examples
$ alusus hello_world.alusus
The Core's executalbe's name when building in debug mode will be alusus.dbg. If the build is in release mode the name will be alusus, i.e. without the dbg extension.

If the Core is built in debug mode logging can be enabled using the --log command line argument, which accepts a number representing the details level of the log as in the following example:

$ alusus helloworld.alusus --log 16
The details level is determined through binary flags representing each different details level with the least significant bit representing the lowest level. A value of 1 for each level means details for that level will be logged to the screen. The following table explains the different levels:
Lexer, low level = 1
Lexer, mid level = 2
Lexer, high level = 4
Parser, low level = 8
Parser, mid level = 16
Parser, high level = 32
The flags can be combined to display more than one level at the same time. For example, a value of 7 means logging all levels for the lexer.