-
Notifications
You must be signed in to change notification settings - Fork 0
Building ispc: Windows
mmp edited this page Sep 6, 2012
·
11 revisions
In order to build ispc from source, you first must build LLVM from source. We recommend that you either use the LLVM 3.1 release or download a snapshot of the LLVM 3.2 development tree. It is possible to build ispc with LLVM 3.0, though the code generated isn't as good as when using more recent LLVM releases.
To build LLVM, do the following. (These directions assume LLVM 3.1; building other versions of LLVM is essentially the same process.)
- 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.
- If needed, install "cmake" on your system, specifically using the Win32 installer available from http://www.cmake.org/cmake/resources/software.html/.
- 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. Then click the "browse build..." button and select same directory.
- Click "configure" (for the first time), and then select the appropriate version of Visual Studio (e.g. "Visual Studio 10"). Note that the Win64 build doesn't work, so don't choose that.
- Click "Finish".
- Change the value of CMAKE_INSTALL_PREFIX to a reasonable directory (e.g. c:/Users/yourname/LLVM). Remember which directory you chose here.
- Click "configure" again, and then click "generate" to finally create the solution files.
- 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.
- Set an environment variable, LLVM_VERSION, with the value LLVM_3_0, or LLVM_3_1, or LLVM_3_2 depending on which version of LLVM you're using.
- Launch a new instance of MSVC2010 and open the ispc.sln file.
- (If you are compiling with LLVM 3.0, remove "clangEdit.lib" from the list of libraries that ispc is linked with.)
- Select the release x86 build, and build (F7)!