Building on Windows - LuxRender Wiki

Building on Windows

Personal tools

From LuxRender Wiki

Jump to: navigation, search

Contents

What you need:

What to do:

Check out sources from the repository (anonymously using TortoiseCVS)

  1. Make an empty directory
  2. Right-click on it
  3. Enter ":pserver:anonymous(_AT_)cvs.savannah.nongnu.org:/sources/ecume" into the CVSROOT field (replace "(_AT_)" with "@")
  4. Enter "lux" into the "Module" field
  5. Click "OK"
  6. Wait for the module to download
  7. Similarly check out the "win32" module into the same directory (note: it might take a while)

Install required tools and libraries

  1. bison and flex are provided with setup programs that install them along with their dependencies
  2. If you don't want to build the libraries yourself, you can use the installer they provide:
  1. Download and launch "boost_1_34_1_setup.exe"
  2. When asked pick the "Visual C++ 8.0" compiler along with "Multithread" and "Multithread Debug" variants (you only need Debug if you plan to build a debugging version of the Lux binary)
  3. In the component selection step you can uncheck "Source and Documentation" and "Tools", they're not necessary to use the libraries.
  4. The installer will download and unpack binaries and headers to the selected directory.
  5. Similarly, download and launch "wxMSW-2.8.7-Setup.exe"
  6. The only option here is the install directory which can be left at the default "C:\wxWidgets-2.8.7"
  7. Tell Visual Studio where to look for the newly installed libraries:
  1. Open VS and go to "Tools->Options...->Projects and Solutions->VC++ Directories"
  2. Make sure "Platform: Win32" is selected.
  3. Select "Show directories for: Include files" and add a new entry with the path where you installed boost (default is: "C:\Program Files\boost\boost_1_34_1") and wxWidgets include directories (defaults are: "C:\wxWidgets-2.8.7\include" and "C:\wxWidgets-2.8.7\include\msvc")
  4. Select "Show directories for: Library files" and add a new entry with the path where you installed boost ending with "\lib" (default is: "C:\Program Files\boost\boost_1_34_1\lib"). Do the same for wxWidgets library path (default is: "C:\wxWidgets-2.8.7\lib\vc_lib")
  5. Click "OK" to save the changes.

Compile Lux in Visual Studio

  1. Open the solution "win32\lux.sln" in VS
  2. Pick "Release" as a Solution Configuration
  3. If using Express Edition:
    1. Open the "core" project properties and under Configuration Properties>Linker>Input add "Additional Dependencies": "user32.lib gdi32.lib comdlg32.lib comctl32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib rpcrt4.lib"
    2. Remove the "Resource Files" folder from the project since Express Edition can't work with resources
  4. Click the "Build Solution" button
  5. Wait for the build process to complete

You're done!

The executable should be located at "win32\Projects\Release\luxrender.exe". Run it and see what happens... :)

Notes

  • Instead of checking out individual modules you can get the whole repository (the "." module), but it's unnecessary and will take much longer as you'll be downloading libraries for other platforms as well.
  • If you don't have an SSE2-compatible CPU, you will need to tweak compiler options before building. In VS go to "Project->Properties->Configuration Properties->C/C++->Code Generation->Enable Enhanced Instruction Set" and change it from SSE2 to SSE or none depending on your architecture.
  • Make sure that bison and flex are accessible to the compiler (i.e. add "C:\Program Files\GnuWin32\bin" to your PATH environment variable or to VC++ Directories in VS options).
  • Additional instructions for setting up wxWidgets in Visual Studio can be found here.