How To Build ghdl-0.33-llvm From Source On OS X: Obtain Sources
How To Build ghdl-0.33-llvm From Source On OS X: Obtain Sources
Obtain Sources
OS X Xcode Command Line Tools are required to build and run ghdl-0.33. If the Command Line Tools are not
installed already, in a terminal:
xcode-select --install
The Xcode command line tools also provide a gcc that is used to link objects produced during ghdl analysis at
elaboration time.
download gnat-gpl-2015-x86_64-darwin-bin.tar.gz
(depending on mirror):
curl -O http://mirrors.cdn.adacore.com/art/564b3e75c8e196b040fbdcf9
Obtain an llvm binary (note Apple does not distribute llvm-config which is required):
curl -O http://llvm.org/releases/3.5.0/clang+llvm-3.5.0-macosx-apple-darwin.tar.xz
https://github.com/tgingold/ghdl/releases
curl -O https://github.com/tgingold/ghdl/archive/v0.33.tar.gz
There are no modifications made to the ghdl-0.33 source in producing the distributed binary package.
Build GHDL
At this point we assume you've got the command line tools installed, gnat is in your execution search path and
the llvm distribution is uncompressed.
From a suitable directory location for building ghdl-0.33, with the ghdl-0.33.tar.gz archive present unarchive the
ghdl source:
cd ghdl-0.33
mkdir build
cd build
(From the toplevel ghdl README):
Build:
make
When finished building optionally run the testsuite (shown before install):
make grt.links
export set GHDL=$PWD/ghdl_llvm # Bash for testing
or
setenv GHDL `pwd`/ghdl_llvm # csh/tcsh
cd ../testsuite
./testsuite.sh
Installation
If a prior version of ghdl is installed it should be removedto preserve the integrity of the package manager
database. A previous version of ghdl will have an uninstall script. This installation will overwrite links found in /
usr/local/belonging to a prior version of ghdl.
Install
make install
/usr/local/bin/ghdl
/usr/local/bin/ghdl1-llvm
/usr/include/vhpi_user.h
/usr/local/lib/ghdl/ # recursively
/usr/local/man/man1/ghdl.1
/usr/local/share/doc/ghdl/ghdl.readthedocs.org/en/latest # recurs.
/usr/local/share/doc/ghdl/gpl-3.0.txt
/uae/local/share/doc/ghdl/scripts # recursively
/usr/local/share/info/ghdl.1
The ghdl.info file is made using makeinfo. The source can be found in the ghdl-0.33/doc directory along with
the man page ghdl.1.
http://ghdl.readthedocs.org/en/latest/Starting_with_GHDL.html#starting-with-a-design
The ghdl-0.33-llvm-darwin13 distribution package will delete ghdl-0.31 and install ghdl.info, the man page and a
copy of the on line documents. It also includes a copy of the GPLv3 license and all scripts and notes neccesary
to build ghdl-0.33 on OS X.
Uninstalling ghdl-0.33
Uninstallation of a manually installed ghdl-0.33 can be accomplished by:
/bin/rm -f /usr/local/bin/ghdl
/bin/rm -f /usr/local/bin/ghdl1-llvm
/bin/rm -f /usr/include/vhpi_user.h
/bin/rm -rf /usr/local/lib/ghdl
/bin/rm -f /usr/local/man/man1/ghdl.1
/bin/rm -rf /usr/local/share/doc/ghdl
/bin/rm -f /usr/local/share/info/ghdl.1
ghdl does not depend on the gnat or llvm build binaries being present once built and installed.