From enGrid Wiki

Revision as of 12:53, 14 July 2012 by Wyldckat (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

NOTE: This page has moved to the new wiki location: Building enGrid on Windows

The content below is kept here only for historic reasons.



Building enGrid in Windows OS takes some effort, but this tutorial should teach you just enough to get everything going as intended.

First follow the chapters on this page. The last chapter Building enGrid will then redirect you to the compiler of your choice.

Retrieving code from git

You'll first need to install msysgit and/or Tortoise GIT. Follow their instructions, since those will not be explained here.

The following commands are to be executed from msysgit. Source code repository to get the latest development version (UNSTABLE):

git clone git://


git clone git://


git clone

Using the git protocol (the first two) should be faster.

WARNING: The master branch may be unstable! It is the main development branch. Please use one of the release branches if you want a stable version.

The available Windows branches are:

  • windows - this one uses VTK 5.8.0 from ParaView 3.12.0 and follows the master branch.
  • windows-1.2.0 - this one uses VTK 5.4.0 from ParaView 3.8.1.
  • windows-1.3 - this one uses VTK 5.8.0 from ParaView 3.12.0.
  • release-1.3 - this one uses VTK 5.4.0 from ParaView 3.8.1.

To retrieve one of them, run for example the following command after git clone:

git checkout -b release-1.3 remotes/origin/release-1.3

The git repository can also be browsed at:

Retrieving NETGEN code

enGrid relies on nglib to generate volume meshes; that library comes from NETGEN.

The code version used for the Windows build is from the latest release, namely version 4.9.13; the SVN version was not working with the Windows version at the time of the development of enGrid's Windows builds. Download the zip file from there. Then:

  1. Unpack the file in the folder engrid\src\netgen_svn\netgen-mesher.
  2. Then rename the new folder engrid\src\netgen_svn\netgen-mesher\netgen-4.9.13 to engrid\src\netgen_svn\netgen-mesher\netgen.
  3. Then apply the patch nglib_engrid_mods.diff like this (requires msysgit):
    1. Start a Bash shell from msysgit.
    2. Got to the engrid folder src\netgen_svn\netgen-mesher. Example:
      User@MACHINE /m/engrid (windows)
      $ cd src/netgen_svn/netgen-mesher
    3. Apply the patch like this:
      patch -p0 < ../nglib_engrid_mods.diff

Retrieving other Third-party dependencies

The current development environment for enGrid in Windows uses a dedicated Third-party software folder. This is a rough way of setting things up, but it makes it easier to replicate the set-up with the same environment in any machine for anyone. Keep in mind that this set-up will occupy more disk space than usual; expect around 1GB and 25000 files, depending on the versions of the libraries.

Currently the additional Third-party software necessary is:

This chapter divides into two sections, where the installation process is described:

  • Automated installation, where it's explained how to make a quick deployment of the necessary Third-party applications, libraries and headers.
  • Manual installation, where it's explained what needs to be copied to the common Third-party folder.

Automated installation

This automated installation is one of the quickest deployments you can find. It uses a special Qt project that provides Qt in MSVC2008 builds in both 32 and 64bits, along with ParaView's binaries development versions. This means that no further compiling is needed for both Qt and VTK!

Depending on the ParaView development version available at, you'll have to download the respective Qt version from the qt-msvc-installer project. Here are the currently known versions available:

Also download the latest version of NSIS from here: Download NSIS - there is only a 32bit version, but works for both architectures.

Install the respective versions you wish to work with, which are also depending on the architecture of your Windows OS. Install anywhere you want to, but keep track of where they're installed.

After they are all installed, edit one or both of the following files in the enGrid development folder:

  • src\scripts\populate3p.bat for 32bit
  • src\scripts\populate3p64.bat for 64bit

In each you should see a header similar to this one:

rem =============== Developer configuration area ===============

rem VTK: source the environment variables for the chosen VTK installation
set VTKINCDIR=C:\Program Files (x86)\ParaView-Development 3.8.1\include\paraview-3.8
set VTKBINDIR=C:\Program Files (x86)\ParaView-Development 3.8.1\bin
set VTKLIBDIR=C:\Program Files (x86)\ParaView-Development 3.8.1\lib\paraview-3.8

rem Qt: batch file with environment variables for the chosen qt installation
set QTbatchfile=Q:\4.6.2\qtvars.bat

rem NSIS: path to where NSIS is installed

rem ============= End Developer configuration area =============

The lines that start with rem are comment lines. You will need to adapt the paths in the file to your own installation folders. Details about each software:

Notice that for VTK there are 3 variables that need to be defined, namely the folders include, binary and library interfaces. If you use VTK from another source or local build, the folder distribution is most likely very different.
As for Qt, you only have to specify the path to the batch file qtvars.bat, since all others are inferred from there.
Specify the path to where NSIS is installed.

Don't forget to define the proper folders for the respective architectures, namely 32 and 64bit versions for each applicable libraries/applications. For those that work for both architectures, such as NSIS, you can use the origin folder to copy from.

Finally save the edited file(s) and run it/them. You can simply double-click on it/them in Windows Explorer and it/them will copy everything necessary to the right place, namely to the respective folders src\third_party and src\third_party64. The final output should look something like this:

Copying VTK files, please wait...
Setting QMAKESPEC to win32-msvc2008
Setting QTDIR environment variable to Q:\4.6.2
Putting Qt\bin in the current PATH environment variable.
The system cannot find the path specified.
All done...
Copying Qt files, please wait...
Copying NSIS files, please wait...
All done
Press any key to continue . . .

If something went wrong, you might want to check the section Manual installation, since the steps made by this batch file are the ones described there.

Manual installation

As said in the beginning of this chapter, the development environment for enGrid used is based on a dedicated Third-party software folder, namely src\third_party. Inside this folder there should be the following folders:

This is the currently supported development environment for enGrid in Windows OS. If other configurations are available, they will be described in one of the articles listed in section Building enGrid.

Manually install VTK

  1. Create a folder named VTK inside the src\third_party and/or src\third_party64, depending on the 32 or 64bit architecture.
  2. Inside that one there will be needed three new folders: bin, lib and include.
  3. Inside each folder should be put the respective contents:
    • In bin should be placed only the DLL files (the ones with file extension .dll). You should also remove any .dll files that start with Qt, namely Qt*.dll.
    • In lib should be placed only the library interfaces (the ones with file extension .lib).
    • In include should be placed the header files (the ones with file extension .h and/or .hxx and/or .hpp), along with some other support files. The simplest is to copy the contents of the include folder from where you are copying.

And you're done on this point. If you are going to use the VTK version available in the ParaView Development installer, the reference folders are:

  • Contents for the include folder are available inside this one: ParaView-Development 3.*.*\include\paraview-3.*
  • Contents for the bin folder are available inside this one: ParaView-Development 3.*.*\bin
  • Contents for the lib folder are available inside this one: ParaView-Development 3.*.*\lib\paraview-3.*

Manually install Qt

THings to keep in mind during when following the instructions on this sub-section:

  • You need a compatible version of Qt for the VTK ready-to-use version.
  • If you are going to (also) use the 64bit version of Qt, whenever the folder third_party is mentioned, you should use the folder third_party64.
  • Create a folder named Qt inside the src\third_party.
  • Go to where you installed the Qt version for this enGrid environment and copy the following folders into the previous folder:lib and include.
  • Inside the folder engrid_folder\src\third_party\Qt create or edit the file qt.conf and put inside the following content:
    Prefix = c:\engrid-dev\src\third_party\Qt
    Demos = demos
    Examples = examples
    Adapt the path c:\engrid-dev to where you have the enGrid development folder.
  • Inside the folder engrid_folder\src\third_party\Qt create or edit the file qtvars.bat and put inside the following content:
    @echo off
    echo Setting QMAKESPEC to win32-msvc2008 
    set QMAKESPEC=win32-msvc2008
    echo Setting QTDIR environment variable to c:\engrid-dev\src\third_party\Qt
    set QTDIR=c:\engrid-dev\src\third_party\Qt
    echo Putting Qt\bin in the current PATH environment variable.
    set PATH=%QTDIR%\bin;%PATH%

    Once again, adapt the path c:\engrid-dev to where you have the enGrid development folder.

And you are done here as well.

Manually install NSIS

  1. Create a folder named NSIS inside the src\third_party.
  2. Copy the contents from your NSIS installation into that new folder.

And it's as simple as that. If you wish, you can install NSIS directly into that folder, but chances are that you'll need to install NSIS for other development applications as well.

A final note: there is only one architecture with NSIS, so you should copy it both third_party and third_party64 folders, where applicable.

Building enGrid

Building enGrid in Windows comes in the following flavours:

In each chapter it is described how to set-up and build using each compiler.

go back to Building

Personal tools