Building ghdl from source for Ubuntu 16.04 – mcode version
January 23, 2018 2 Comments
Based on input from Patrick Lehmann, I decided to re-install ghdl, now using the official GitHub site.
I learned from the README file how to build the mcode variant. I tried, and it worked fine (and it was much simpler than the gcc-based approach I tried earlier)!
Here are the commands that I used.
I downloaded and installed an Ada compiler, as instructed, and I proceeded with the build and install of ghdl, by first setting the PATH to include my newly installed Ada compiler, as
export PATH=/usr/gnat/bin:$PATH
I cloned the repo, using
git clone https://github.com/ghdl/ghdl.git
I configured and built ghdl, using
cd ghdl ./configure --prefix=/usr/local/ghdl_mcode make
The installation was then done, as
ghdl:-$ sudo -i # cd # PATH=/usr/gnat/bin/:$PATH make install ... ... # exit
That was all!
I could now build and run my hello world example, from my work-in-progress book about building a computer, as
vhdl:-$ export PATH=/usr/local/ghdl_mcode/bin/:$PATH vhdl:-$ ghdl -a hello.vhdl vhdl:-$ ghdl -e hello_world vhdl:-$ ghdl -r hello_world Hello, world vhdl:-$
Pingback: Installing ghdl from source on Ubuntu 16.04 | The Intobooks
Two additions: the mcode version of GHDL does not need the elaborate step (-e), you can directly run (-r) the testbench after analysis (-a) of all sources. There is also the more powerful LLVM backend version, that can be compiled almost as simple as the mcode version, but giving a higher simulation performance.
Thanks for using and supporting GHDL!