Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Building ispc: Windows
Clone this wiki locally
In order to build ispc from source, you first must build LLVM from source. We recommend that you either use the LLVM 3.2 or LLVM 3.3 release or download a snapshot of the LLVM 3.4 development tree.
- Visual Studio 2010;
- CMake - http://www.cmake.org/cmake/resources/software.html/;
- Python 2.7 (make sure that installation path doesn't conatin white spaces and it addedto your PATH), download page: http://www.python.org/download/;
- GnuWin32 (for LLVM build) - http://gnuwin32.sourceforge.net/;
- Cygwin or any other pack of Unix utilities with m4, flex (2.5 or later), and bison (2.4 or later). Note: GnuWin32 is not supported, as flex is too old (even though it declares that it's 2.5.4).
- Optionally SVN and GIT clients to check out LLVM and ISPC sources accordingly.
- Get the sources. You can either download a tarball from LLVM web site or check out sources using SVN:
- Tarball download:
- Using you favorite SVN client (for example TortoiseSVN http://tortoisesvn.net) check out:
- svn co http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_32/final llvm-3.2.src
- cd llvm-3.2.src/tools
- svn co http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_32/final clang
- Create MSVC solution files for LLVM using "CMake". (See also the LLVM documentation about building with MSVC http://llvm.org/docs/GettingStartedVS.html for more information.) First, launch the CMake GUI and exit any running instances of Visual Studio.
- Click the "Browse Source..." button in CMake and point it to the directory LLVM extracted itself to from the tar file (llvm-3.2.src). Then click the "Browse Build..." button and select a directory for building object files (let's assume it's C:/Users/yourname/llvm/build-3.2).
- Click "Configure" (for the first time), and then select the appropriate version of Visual Studio (e.g. "Visual Studio 10"). It's recommended to use Win32.
- Click "Finish".
- Change the value of CMAKE_INSTALL_PREFIX to a reasonable directory (e.g. C:/Users/yourname/llvm/bin-3.2). Remember which directory you chose here.
- Set LLVM_LIT_TOOLS_DIR to point to your installation of GnuWin32 (typically C:/gnuwin32/bin), so you don't need to add GnuWin32 to PATH and can avoid conflict with Cygwin.
- Click "Configure" again, and then click "Generate" to finally create the solution files.
- Build LLVM:
- Open the 'install.vcxproj' file in the LLVM directory. Select the 'Release' build and then build the solution (F7). Wait.
- Right click on "INSTALL" in the solution explorer, and choose "build". This copies the appropriate files into the install directory.
- The following GNU tools must be installed (e.g. via cygwin) and in your PATH: m4, flex, and bison. Flex must be version 2.5 or later, and bison must be version 2.4 or later.
- Set an environment variable, LLVM_INSTALL_DIR, that points to the directory in which you installed the LLVM headers, binaries, and libraries (e.g. C:/Users/yourname/llvm/bin-3.2).
- Set an environment variable, LLVM_VERSION, with the value LLVM_3_2, or LLVM_3_3, or LLVM_3_4 depending on which version of LLVM you're using.
- Launch a new instance of MSVC2010 and open the ispc.sln file.
- Select the release x86 build, and build (F7)!