Building on Windows - LuxRender Wiki
Luxrender GPL Physically Based Renderer

Building on Windows

Personal tools

From LuxRender Wiki

Revision as of 08:54, 25 September 2011 by Paco (Talk | contribs)
Jump to: navigation, search

Contents

What you need:

  • TortoiseHG (or any Murcurial client)
  • MS Visual Studio 2008 (or Visual C++ Express Edition, note that the express edition cannot compile the 64-bit version without manually installing and configuring an additional Windows SDK)
  • other dependencies will be downloaded semi-automatically by the install directions

What to do:

Check out sources from the repository (anonymously using TortoiseHG)

  1. Make an empty folder (for example, LuxSource). This is the BASE directory.
  2. Right-click the folder and select TortoiseHG -> Create Clone
  3. Enter "http://src.luxrender.net/lux/" into the "source path" field, and put in BASE/lux into the destination (where BASE is the base directory)
  4. Click "clone"
  5. Wait for the module to download
  6. Similarly check out the "windows" module into the BASE folder, using "http://src.luxrender.net/windows/" as the source path (set destination to BASE/windows/)
  7. Similarly check out the "luxrays" module into the BASE folder, using "http://src.luxrender.net/luxrays/" as the source path (set destination to BASE/luxrays/)

Build instructions (Semi-Automatic)

  1. Start the VS2008 command prompt (located on the Start Menu)
    1. For 64bit you must use the 64bit VS2008 command prompt
    2. Conversely, use the 32bit VS2008 prompt if you're building luxrender for 32 bit platforms (technically, this is only required when building certain dependencies, but there's no reason to change command prompts mid build).
  2. Navigate to the "windows" directory, then run getdeps.bat. This will download the required libraries for both the 32-bit and 64-bit builds.
  3. Run the appropriate build batch file (build-x64.bat for 64-bit builds, or build-x86.bat for 32-bit builds).
  4. If this is your first time building, build the dependencies. Follow the instructions as prompted by the build script. See the notes for tips when running the build script.
  5. When it's done, the build should be found inside the Dist directory (either inside the 32 or 64 folder, depending on 32 or 64 bits).

Notes:

  1. LuxRender currently requires either the 1.39 or 1.43 boost libraries. Other versions either haven't been tested, or are known to have bugs which will break LuxRender (for instance the latest release at this writing, 1.44, breaks Python3 support).
  2. LuxRender currently requires Zlib 1.2.3. The latest as of this writing is 1.2.5, but the 1.43 boost library doesn't yet support this version.
  3. There will be some errors when building the dependencies, as well as hundreds of warnings. As long as luxrender's build succeeds, it's ok to have errors/warnings
  4. Building the Qt libraries will take a very long time. If you're building the dependencies, wait for the install script to ask you to accept the license agreement, then go do something for the new few hours. The rest of the install script should be automated.
  5. This is current as of August 23, 2010. If you are unable to build luxrender, please see the Compilation and Portability Forum for any "quick-fixes". If you know it's a bug with the luxrender program, please submit a bug report.
  6. If you don't want to build lux and just want to test it (or use the latest build), you can usually find weekly builds for various platforms/configurations in the Weekly Builds Forum.
  7. Sometimes luxrender repository is busy, that could cause errors when creating a clone. Thanks to dougal2, a mirror has been created : http://bitbucket.org/luxrender try this one if you're getting errors like "transaction abort!" warning : The mirror has a 2 hour delay with the original repository

VS Express

This is how to configure VS Express to build x64 binaries on Windows 7 64bit:

Install Visual Studio Express

Fix build environment batch files

  • Fix the following files:
    • C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat
      • globally replace %~dp0bin\amd64\vcvarsamd64.bat with %~dp0bin\vcvars64.bat
      • globally replace %~dp0bin\x86_amd64\vcvarsx86_amd64.bat with %~dp0bin\vcvarsx86_amd64.bat
    • C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat
      • the 3rd line should read:
      • @SET FrameworkDir=C:\Windows\Microsoft.NET\Framework
      • the 4th line should read:
      • @SET FrameworkVersion=v3.5
    • C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat
      • the 3rd line should read:
      • @SET FrameworkDir=C:\Windows\Microsoft.NET\Framework64
      • the 4th line should read:
      • @SET FrameworkVersion=v3.5

Create 64 bit build environment link

  • Create a shortcut for the 64bit build environment using the following settings
    • Target: %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"" x64
    • Start In: "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\"
    • Comment: Open Visual Studio 2008 Command Prompt (x64)
    • Name it "Visual Studio 2008 Command Prompt (x64)" (without the quotes) and place it in "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Visual C++ 2008 Express Edition\Visual Studio Tools" (must be admin)
You must run the build batch file from within the command prompt that this shortcut opens.

You should now be able to build x64 binaries using both the command line tools, and be able to configure x64 targets using the VS IDE.