Links

Building and running

Having written the code for your simulation, you need to be able to build it into an executable format to be deployed onto the Hadean platform, and be able to start your simulation running. When building a Simulate simulation, you use the same executable for running on your locally installed WSL and on remote cloud based clusters. There's no need to recompile with specific flags or configuration - the exact same executable will work both locally and remotely.

Building

Simulate simulations build using CMake running clang. When you invoke CMake you should be targeting Linux, if building on Windows then you can install the Hadean Simulate SDK Build Tools which provides a copy of CMake and clang capable of cross compiling to linux. The Hadean Simulate SDK includes a CMake toolchain file that you can use in order to ensure the Aether libraries are discovered by CMake properly, this is available in your Build Tools installation directory at <path to build tools>/lib/cmake/aether-toolchain.cmake.
When building you must install the simulation executable to build/simulation and the Connect executable to build/muxer/muxer in order for the Aether CLI to find them to deploy.
To build a simulation, run the commands listed bellow in your simulation directory. You can run each command separately, as shown below, which will be equal for any terminal.
$ cmake -B build -G Ninja
$ ninja -C ./build
Or you can run both commands at the same time considering that it differs depending on the terminal in use:
cmd & bash
$ cmake -B build -G Ninja & ninja -C ./build
powershell
$ cmake -B build -G Ninja; ninja -C ./build
The build process is always from cross-compilation.

It is possible to get the following error during the build.

powershell
ninja: Entering directory `build'
ninja: error: 'C:/Program', needed by 'simulation', missing and no known rule to make it
The issue is caused by the command cmake -B build -G Ninja because it's not using the cmake version bundled in Simulate BuildTools.
There are two ways to solve the problem:
1 - We can change the order of our environment variables, in order to use the CMake that comes with our Simulate BuildTools, instead of another one that may already be installed in the system.
2 - We can indicate the path to our Simulate BuildTool's CMake in the command directly.
powershell
$ 'C:\Program Files\Hadean\Aether Engine SDK\BuildTools\bin\Cmake.exe' -B build -G Ninja
By default the build tools is installed in 'C:\Program Files\Hadean\Aether Engine SDK\BuildTools' as such the path of the Cmake executable bundled with Aether's Buildtools may vary if the user chose a custom installation directory.

Running

Once you have a simulation ready to run, you can run it with the Aether Engine SDK CLI. When running, you can choose to run your simulation either on the local WSL or on a cloud cluster.

Running locally

When developing, you will likely want to use the local WSL to quickly run and tests changes to your simulation code. To do this, use aether run.
Bear in mind that the aether run doesn't rebuild the simulation for you, and you'll need to build your project, as shown above, so that aether run picks up your new changes.
When running a simulation locally, the simulation will be started on the WSL and the logs streamed back to the console. The local WSL will also host a Muxer that you can connect clients to through localhost (127.0.0.1) or WSL container IP.
In order to stop a simulation when it has been started, press CTRL+c. You will be asked if you wish to let the simulation continue running, and stop streaming the logs back to the console. If you do, reply y to the prompt, any other response will stop the simulation. If you find you want to start simulations but do not wish to have the logs streamed back, consider using the --detached flag.
If you have detached from a simulation and so are no longer streaming logs, but it is still running, you can later stop it by running aether stop.
When running, before starting the simulation, the WSL container IP will be printed out. Press to start the simulation.
The local VM runs on Hyper-V. If you get a message saying Unable to connect to the remote machine, is it currently running?, it is likely that the local VM is not running. To turn it on, search for the Hyper-V manager in the Windows start menu, then right click on the VM called 'aether-engine-sdk', and click 'Start'. The VM will be running after you first install the SDK, however it does not start running automatically if you restart your machine.
You can always stop the VM in the Hyper-V manager if you are not using it, and restart it when you are ready to use it again.

Including Dynamically Linked Libraries

It is sometimes necessary to make compiled libraries available on your cluster or local VM in order to dynamically link your code. In order to support this the aether run command supports the ability to pass in a list of semi-colon separated folder locations whose content will be made available to the simulation.
aether run --library-folders <your_folder_name1;your_folder_name2>
The variable LD_LIBRARY_PATH is updated to include the location of the folders after they have been copied to the simulation machines which should allow the libraries to be automatically located. You can inspect with variable from within your simulation to discover the provided files, remember that LD_LIBRARY_PATH may contain multiple directories.

Running on a cloud cluster

Running on a cloud cluster works in the same way as running locally, with the addition of a --cluster flag that lets you specify which cluster you would like to run on. In order to run on a cloud cluster, you will need to have provisioned the servers and set up the Hadean Platform on them, for details on how to do this see Managing clusters. Once you have set up a cloud cluster to run on, you can get the cluster key, which is used to identify the cluster. This is available at http://portal.hadean.com, underneath the name of each cluster. Copy this and provide it as the value of the --cluster flag: aether run --cluster <cluster key>.
Since the 2.2.0 release of the Aether Engine SDK, you can use the cluster name directly rather than the cluster key to identify the cluster you wish to run on.
When running on a cluster, before starting the simulation, the list of all muxers available on that cluster will be printed out. Press <ENTER> to start the simulation.