Building GHDL from Sources¶
Download
GHDL can be downloaded as a zip-file
(latest ‘master’ branch) or cloned with git clone from GitHub. GitHub
offers HTTPS and SSH as transfer protocols. See the Downloading Source Files
page for further details. The installation directory is referred to as GHDLRoot.
Available back-ends
GHDL currently supports three different back-ends (code generators):
- mcode - built-in x86(or x86_64) code generator,
- GCC - Gnu Compiler Collection, and
- LLVM - Low-Level Virtual Machine .
Here is a short comparison, so that you can choose the one you want to use:
| Back-end | Pros | Cons |
|---|---|---|
| mcode |
|
|
| LLVM |
|
|
| GCC |
|
|
Hint
The output of both GCC and LLVM is an executable file, but mcode does not
generate any. Therefore, if using GCC/LLVM, the call with argument -r can
be replaced with direct execution of the binary. See section Quick Start Guide.
After making your choice, you can jump to the corresponding section. However, we suggest you to read Directory Structure before, so that you know where the content is placed and which temporal files are expected to be created.
Hint
Since GHDL is written in Ada, independently of the code generator you use,
the GNU Ada compiler, GNAT GPL, is required, 2014 (or later) for x86
(32 or 64 bits). GNAT GPL can be downloaded anonymously from libre.adacore.com.
Then, untar and run the doinstall script. Alternatively, most GNU/Linux
provide a package named gcc-ada or gcc-gnat.