-
Notifications
You must be signed in to change notification settings - Fork 0
[enGrid 1.4] Building on Windows
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.
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:
git clone git://github.com/enGits/engrid.gitor
git clone https://github.com/enGits/engrid.gitor
git clone git://repo.or.cz/engrid-github.git engridor
git clone http://repo.or.cz/r/engrid-github.git engrid
Using the git protocol (the first one) should be faster.
The available Windows branches for 1.4 are:
- release-1.4 - this one uses VTK 5.8.0 from ParaView 3.12.0.
- windows-1.4 - this one uses VTK 5.8.0 from ParaView 3.12.0.
git checkout -b windows-1.4 remotes/origin/windows-1.4
The git repository can also be browsed at:
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 netgen-4.9.13.zip from there. Then:
- Unpack the file in the folder
engrid\src\netgen_svn\netgen-mesher
. - Then rename the new folder
engrid\src\netgen_svn\netgen-mesher\netgen-4.9.13
toengrid\src\netgen_svn\netgen-mesher\netgen
. - Then apply the patch
nglib_engrid_mods.diff
like this (requiresmsysgit
):
- Start a Bash shell from
msysgit
. - Got to the
engrid
foldersrc\netgen_svn\netgen-mesher
. Example:User@MACHINE /m/engrid (windows) $ cd src/netgen_svn/netgen-mesher
- Apply the patch like this:
patch -p0 < ../nglib_engrid_mods.diff
- Start a Bash shell from
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.
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 www.paraview.org, you'll have to download the respective Qt version from the qt-msvc-installer project. Here are the currently known versions available:
- From ParaView 3.12.0, which uses Qt 4.6.3:
- VTK development files for MSVC 2008 32 and 64 bit (unofficial version):
- Qt 4.6.3 development files for MSVC 2008 32 and 64 bit:
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
rem =============== Developer configuration area =============== rem VTK: source the environment variables for the chosen VTK installation set VTKINCDIR=C:\Program Files (x86)\ParaView-Development 3.12.0\include\paraview-3.12 set VTKBINDIR=C:\Program Files (x86)\ParaView-Development 3.12.0\bin set VTKLIBDIR=C:\Program Files (x86)\ParaView-Development 3.12.0\lib\paraview-3.12 rem Qt: batch file with environment variables for the chosen qt installation set QTbatchfile=Q:\4.6.3\qtvars.bat rem NSIS: path to where NSIS is installed set NSIS_DIR=P:\NSIS 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:
- VTK
- 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.
- Qt
- As for Qt, you only have to specify the path to the batch file
qtvars.bat
, since all others are inferred from there.
- NSIS
- Specify the path to where NSIS is installed.
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.3 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.
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:
- VTK - see subsection Manually install VTK
- Qt - see subsection Manually install Qt
- NSIS - see subsection Manually install NSIS
- Create a folder named
VTK
inside thesrc\third_party
and/orsrc\third_party64
, depending on the 32 or 64bit architecture. - Inside that one there will be needed three new folders:
bin
,lib
andinclude
. - 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.
- In
- 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.*
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 folderthird_party64
.
- Create a folder named
Qt
inside thesrc\third_party
. - Go to where you installed the Qt version for this enGrid environment and copy the following folders into the previous folder:
lib
andinclude
.bin lib src include plugins mkspecs tools translations
- Inside the folder
''engrid_folder''\src\third_party\Qt
create or edit the fileqt.conf
and put inside the following content:[Paths] Prefix = c:\engrid-dev\src\third_party\Qt Demos = demos Examples = examples
Adapt the pathc:\engrid-dev
to where you have the enGrid development folder. - Inside the folder
''engrid_folder''\src\third_party\Qt
create or edit the fileqtvars.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 pathc:\engrid-dev
to where you have the enGrid development folder.
- Create a folder named
NSIS
inside thesrc\third_party
. - Copy the contents from your NSIS installation into that new folder.
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 in Windows currently comes only in one flavour:
In each chapter it is described how to set-up and build using each compiler.go back to [enGrid-1.4]-Installation