Build/Run

Usage

aura build/run [main subprogram] [-no-pie] [-debug] [-static/-static-rt] [-assertions] [-optimize-(1/2/3/size/debug)]

The build and run command implicitly invokes compile before linking the executable Ada partition image (build). If the command is run, partition is immediately executed.

[main subprogram]

Optionally specifies the main Ada subprogram library unit for the partition. If specified, the binder causes this unit to be executed immediately following the elaboration of all required library units.

This should be the actual Ada name of the unit (case insensitive), not the name of the file.

If a main subprogram is not specified, the created partition will execute by elaborating all root library units of the AURA project, according to the Ada partition execution rules.

If specified, the name of the executable generated will be that of the main subprogram, otherwise, it will be “aura_out”.

Note

build/run implicitly invokes compile

Options

-no-pie

By default, the AURA CLI builds executable parition images as Position-Independent Executables (PIE). This option overrides this behavior.

Note

This option implies -no-pic for the implicit invocation of compile.

-static

By default, the AURA CLI links executable partition images with all available dynamic libraries. This includes the Ada runtime, and (for example) pthreads and libgcc.

This option causes the final executable image to be fully statically linked.

Note

When using this option, any required libraries must be located within the path(s) specified by the LIBRARY_PATH environment variable, or otherwise can be placed in the aura-build subdirectory. of the AURA project. Note that aura-build is deleted if the clean command is invoked.

Note

If -no-pie is not specified, the resulting executable will still be a Position Independent executable, but will not be linked to any shared libraries.

For a fully static image, -no-pie must also be given.

-static-rt

This option causes only the Ada runtime to be statically linked, but all other library dependencies to be dynamically linked.

-debug, -assertions -optimize-(1/2/3/size/debug)

These options are passed to the compile invocation. See compile

Tips

It is an interesting fact that the Ada language, unlike nearly all common languages, does not require a “main” program. Due to Ada’s modular structure and elaboration concept, the true “main” program is actually implicit - it is the elaboration of all library units. This implicit main subprogram is typically generated by the compiler. In the case of gcc/GNAT, this is the purpose of the “binder” program.

This feature of Ada means that applications can be designed as natively parallel/multi-threaded, with individual units (typically packages), or even library-level task objects in effect running themselves.