-
Notifications
You must be signed in to change notification settings - Fork 0
Building ispc: Linux and Mac OS X
jduprat edited this page Aug 27, 2012
·
11 revisions
Building ispc from source on Linux and Mac OS X is relatively straightforward.
First, install the LLVM headers and libraries and the clang compiler on your system:
- Download the 3.1 release of LLVM from http://llvm.org/releases/download.html and untar it into a directory.
- Download the 3.1 release of clang from http://llvm.org/releases/download.html and untar it into the llvm-3.1.src/tools/ directory. Rename the directory from clang-3.1.src to clang.
- Run ./configure from the top-level llvm-3.1 directory, then make install. (You may want to override the installation directory with the --prefix= command-line argument to configure).
- Once LLVM is installed, make sure that the bin directory it installs its binaries into is in your PATH. (In particular, the tools llvm-config and clang must be available to build ispc.
You're now ready to build ispc:
- Make sure your installed version of bison is 2.4 or later. (Unfortunately, the version that ships with Mac OS X is 2.3). Bison can be downloaded from http://www.gnu.org/software/bison/.
- Make sure that your installed version of flex is 2.5 or later. (Run flex --version to check.) Flex can be downloaded from http://flex.sourceforge.net/.
- If you are building on RHEL 6.x or CentOS 6.x, and are seeing "/usr/bin/ld: cannot find -lpthread" during link of ispc, you will need to install the glibc-static package.
- If you are building on RHEL 6.x or CentOS 6.x, and are seeing "/usr/bin/ld: cannot find -lstdc++" during link of ispc, you will need to install the libstdc++-static package.
- The static repository may need to be explicitly enabled. For example on RHEL 6.x, edit /etc/yum.repos.d/redhat.repo and set enabled = 1 in the [rhel-6-workstation-optional-rpms] section.
- If you run into the following error: /usr/include/gnu/stubs.h:7:11: fatal error: 'gnu/stubs-32.h' file not found you will need to install the 32-bit version of the glibc-devel package as explained at http://stackoverflow.com/questions/7412548/gnu-stubs-32-h-no-such-file-or-directory.
- In the ispc source directory, run make
- You should have an ispc binary in the top-level ispc directory when the build completes.
- Copy the ispc binary to a directory in your PATH and you're ready to go!
A note regarding versions of LLVM: ispc builds and runs correctly with LLVM 3.0, but support for this release of LLVM will be discontinued in the coming months. LLVM 3.1 generates better code, so is recommended if possible.
ispc usually builds with recent versions of the LLVM development top-of-tree, though there are occasionally bugs with ToT. It is currently recommended that you build with LLVM 3.1 unless you have a specific reason for using the development branch.