Compiling ElmerGUI with Visual Studio Express Edition
- Visual C++ 2008 Express Edition
- Qt4 compiled for Visual C++ 2008 Express Edition
- Qwt5 compiled for Visual C++ 2008 Express Edition
- If you already have VC++, Qt4 and Qwt5 installed on your system, please goto step 4.
Installing Visual C++ 2008 Express Edition
Get the compiler from http://www.microsoft.com/express/vc/
Get the source code of Qt4 from Trolltech's site (choose the open source edition for Windows). Uncompress the source package in C:\Qt and rename directory for convenience e.g. as 4.4.0 (this was the current version when this document was written). You should then have a directory structure which looks like this:
Open the Visual Studio Command prompt (Start -> Programs -> Visual C++ 9.0... -> Visual studio tools -> Cmd prompt) and "cd" to the directory C:\Qt\4.4.0. Type (please follow the instructions provided by "configure" carefully):
These two commands will compile the Qt4 library for you. It may take hours to complete, so be patient.
Finally, modify the environment variables by typing:
C:\Qt\4.4.0> set QTDIR=C:\Qt\4.4.0
C:\Qt\4.4.0> set path=%QTDIR%\bin;%path%
Get the source package "qwt-5.1.1.zip" from SF.net and uncompress its contents in "C:\". You should then have a directory called C:\Qwt-5.1.1 containing Qwt's source code:
Open the Visual Studio Command Prompt, go to the directory C:\Qwt-5.1.1 and type (please make sure that QTDIR is set and %QTDIR%\bin is in path - see Section 1 above):
C:\Qwt-5.1.1> nmake install
If the compilation fails, you may need to edit the file "qwtconfig.pri" and comment out (at the bottom of the file) the line
CONFIG += QwtDesigner
Then retype the above command sequence.
Compiling ElmerGUI from command line
Get the source code for ElmerGUI from the subversion repository of Elmer.
Open the Visual Studio Command Prompt and go to the source directory "elmerfem\trunk\ElmerGUI" (please make sure that the environment variable QTDIR has been set up correctly. Also make sure that %QTDIR%\bin is in path - see the Section 1 above). Edit the file ElmerGUI.pri as follows:
DEFINES += EG_QWT
DEFINES -= EG_VTK
DEFINES += EG_MATC
DEFINES -= EG_OCC
DEFINES -= EG_PYTHONQT
Finally install and run the executable as:
> nmake install
Note: The installation directory must be included in your path variable.
Creating a Visual C++ project for ElmerGUI
Follow the steps of section 4, but instead of "qmake", type:
> qmake -tp vc -spec win32-msvc2008
This will create the Visual Studio project file "Mesh3D.vcproj".