0% found this document useful (0 votes)
80 views

How To Build ghdl-0.33-llvm From Source On OS X: Obtain Sources

This document provides instructions for building ghdl-0.33 from source on OS X. It describes downloading the necessary tools like Xcode Command Line Tools, gnat, and llvm. It then guides compiling ghdl from source in a build directory. Finally, it explains how to optionally run tests and install ghdl system-wide or remove an existing installation.

Uploaded by

Joy Tech
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views

How To Build ghdl-0.33-llvm From Source On OS X: Obtain Sources

This document provides instructions for building ghdl-0.33 from source on OS X. It describes downloading the necessary tools like Xcode Command Line Tools, gnat, and llvm. It then guides compiling ghdl from source in a build directory. Finally, it explains how to optionally run tests and install ghdl system-wide or remove an existing installation.

Uploaded by

Joy Tech
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

How to Build ghdl-0.

33-llvm from source on OS X

The build described here was performed on OS X 10.10.5 (Yosemite).

Obtain Sources

Get Xcode Command Line Tools

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.

Get a version of gnat

If you don't have gnat installed obtain an OS X GNAT binary:

http://libre.adacore.com/download/configurations (source available)

download gnat-gpl-2015-x86_64-darwin-bin.tar.gz

(depending on mirror):

curl -O http://mirrors.cdn.adacore.com/art/564b3e75c8e196b040fbdcf9

Get the specific version of llvm

Obtain an llvm binary (note Apple does not distribute llvm-config which is required):

http://llvm.org/releases/download.html#3.5.0 (source also available)

curl -O http://llvm.org/releases/3.5.0/clang+llvm-3.5.0-macosx-apple-darwin.tar.xz

Get ghdl-0.33 source

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:

tar -xovzf ghdl-0.33.tar.gz

Set up a build directory:

cd ghdl-0.33
mkdir build
cd build
(From the toplevel ghdl README):

You need to build and install


llvm version 3.5 [do not modify this line as this is read by scripts].

First configure ghdl and specify where llvm is installed


$ ./configure --with-llvm=PREFIX
where PREFIX/bin/llvm-config is present

Configure to build in the build directory: (note the ..)

../configure --with-llvm=<PATH to unarchived llvm distribution>

Build:

make

Optional validation testing prior to installation

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

($GHDL wants the full path to ghdl executable)

cd ../testsuite

Run the testsuite (will take a bit of time):

./testsuite.sh

You'll be notified of successful conclusion

cd ../.. # (top of build tree)

Installation

Installation can depend on administrative privileges (write access to /usr/local).

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

In the build directory:

make install

Here's the list of files distributed by the packge:

/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 package name is ghdl-llvm_0.33-darwin13and the package ID is com.ktz.pkg.ghdl-033-llvm-


darwin13. (You should use your own package ID if you build a distribution package).

All of the above files are not installed by make install.

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.

The on line GHDL documentation is found at:

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.

You might also like