Compile Instructions
Windows - Visual Studio 2008
-
Setting up Python Compiler (2.7.2+ required)
-
Setting up CMake (2.8+ required)
-
Organizing the ThirdParty Source Files
-
Generating the Visual Studio Solution Files with CMake
-
Compiling the Solution in Visual Studio
-
Compiling the Solvers and Utilities
-
Compiling the Regression Tests
Setting up Python Compiler (2.7.2+ required)
In order to successfully compile Visual Studio a python compiler is needed. We tested the version 2.7.2 so it would not be a problem if the installed version is greater.
- Go to the Python Website and download the Windows Installer.
- Run the installer and click the Next, and then I Agree.
Setting up CMake (2.8+ required)
CMake is an open-source, cross-platform make file generator system. It can be used to generate Visual Studio solutions, as well as make files for other compilers such as GCC. We will use it to create a Visual Studio solution for the Nektar project. To compile the code properly, make sure that Visual Studio 2008 Service Pack 1 is installed on the computer.
- Go to the CMake Website and download the Win32 Installer.
- Run the installer and click the Next, and then I Agree.
- Select the option to "Add CMake to the system PATH"
Organizing the ThirdParty Source Files
You will be given a Nektar++ directory and a ThirdParty directory (includes needed libraries from output sources). These need to be organized into the correct directory heirarchy for CMake to find all of the required files. I will indicate a directory by following its name with a backslash.
- Unpack the Nektar++-3.x.x.tar.gz file and rename the resulting directory to Nektar. Put the Nektar directory in C:\. Some windows version do not recognise the path of a folder which has '++' in the name. If you think that your windows version can handle path containing special characters, you do not need to rename Nektar++ Nektar.
- Unpack the ThirdParty-3.x.x.tar.gz file and rename the resulting directory to ThirdParty. Put the ThirdParty directory in Nektar\. (This will mean library\ and ThirdParty\ are both sub-directories of the original Nektar\.)
- In ThirdParty\, extract the tinyxml_2_4_3.zip archive. This will create tinyxml\.
- Extract the loki-0.1.3.tar.bz2 archive. This will create loki-0.1.3\.
- Extract the blaslapack-dll.zip archive. This will create blas_win32.* and lapack_win32.* files in ThirdParty\.
- Extract the zlib-1.2.3.tar.bz2 archive. This will create zlib-1.2.3\.
- The next step is to extract and compile the correct libraries for Boost.
- Open the Visual Studio 2008 Command Prompt This is located in the Microsoft Visual Studio 2008\Visual Studio Tools folder in your "Start -> Programs" menu.
- In ThirdParty\, extract the boost_1_40_0.tar.bz2 archive. This will create boost_1_40_0\.
- With the Visual Studio Command Prompt, change to the ThirdParty\boost_1_40_0\ directory.
- Type the following
and press enter. This will compile the correct Boost libraries.
..\bjam-windows.exe --prefix=..\boost -s ZLIB_SOURCE=..\..\..\..\zlib-1.2.3 --build-type=complete --with-thread --with-iostreams --with-test --with-date_time --with-filesystem --with-system --toolset=msvc-9.0 install
- I've seen some reports that Boost might not be able to find the zlib-1.2.3 directory specified by the relative path in the command line above. If this happens, you can replace the relative path with the absolute path of the zlib-1.2.3 directory (surround it in quotes).
- The following step is to extract and compile the sparse matrix library developed by NIST.(For more information about this library, see http://math.nist.gov/spblas/original.html)
- In ThirdParty\, extract the spblastk0.9.tar.bz2 archive. This will create the directory spblastk0.9\.
- Launch the previously installed CMake by typing
at the VS command prompt or by just double clicking on the CMake icon that appears on your desktop after installation.
CMakeSetup.exe
- If launching from the VS command prompt and it can't
find the file give it the full path. If you installed it in the default
path, try entering
(with the quotes).
"C:\Program Files\CMake 2.8\bin\CMakeSetup.exe"
- If launching from the VS command prompt and it can't
find the file give it the full path. If you installed it in the default
path, try entering
- Fill in the "Where is the source code:" field at the top of the CMake. This is the path to the ThirdParty\spblastk0.9\ directory. For example, C:\Nektar\ThirdParty\spblastk0.9
- Fill in the "Where to build the binaries:" field at the top of CMake. This is the path to the ThirdParty\spblastk0.9\build\ directory. For example, C:\Nektar\ThirdParty\spblastk0.9\build. The Visual Studio solution files will be placed here.
- Click the "Configure" button at the bottom of the program. It will ask for the platform to generate the files for. Select Visual Studio 9 2008. Press Generate.
- Press the "Configure" button again. This time everything should be GRAY, meaning everything is set. Press the "Generate" button, and the Visual Studio solution will be created.
- Open the solution file with Visual Studio.From the "Build" menu, select "Configuration Manager...". For full optimizations, select "Release" from the "Active solution configuration:" menu.
- Select the "INSTALL" project from the "Solution Explorer" on the left. From the "Build" menu, select "build INSTALL". This will build and install the library.
-
The last step is to extract and compile the graph partitioning package METIS. As we use a modified version of the
standard METIS distribution, you are required to link against this version rather than the standard version possibly
available on your system. (For more information about the original METIS library, see http://www.cs.umn.edu/~karypis/metis,
for more information about the modified version, click here)
- In ThirdParty\, extract the modmetis-4.0.tar.bz2 archive. This will create the directory modmetis-4.0\.
- Launch the previously installed CMake by typing
at the VS command prompt or by just double clicking on the CMake icon that appears on your desktop after installation.
CMakeSetup.exe
- If launching from the VS command prompt and it can't
find the file give it the full path. If you installed it in the default
path, try entering
(with the quotes).
"C:\Program Files\CMake 2.8\bin\CMakeSetup.exe"
- If launching from the VS command prompt and it can't
find the file give it the full path. If you installed it in the default
path, try entering
- Fill in the "Where is the source code:" field at the top of the CMake. This is the path to the ThirdParty\modmetis-4.0\ directory. For example, C:\Nektar\ThirdParty\modmetis-4.0
- Fill in the "Where to build the binaries:" field at the top of CMake. This is the path to the ThirdParty\modmetis-4.0\build\ directory. For example, C:\Nektar\ThirdParty\modmetis-4.0\build. The Visual Studio solution files will be placed here.
- Click the "Configure" button at the bottom of the program. It will ask for the platform to generate the files for. Select Visual Studio 9 2008. Press Generate.
- Press the "Configure" button again. This time everything should be GRAY, meaning everything is set. Press the "Generate" button, and the Visual Studio solution will be created.
- Open the solution file with Visual Studio.From the "Build" menu, select "Configuration Manager...". For full optimizations, select "Release" from the "Active solution configuration:" menu.
- Select the "INSTALL" project from the "Solution Explorer" on the left. From the "Build" menu, select "build INSTALL". This will build and install the library.
Generating the Visual Studio Solution Files with CMake
Now that all of the required libraries are setup in the correct paths, we can use CMake to generate the solution files that Visual Studio requires. We will be doing similar steps to instruction #7 mentioned in the previous section to generate solutions files for the Nektar++ library.
- Launch the previously installed CMake by typing
at the VS command prompt or by just double clicking on the CMake icon that appears on your desktop after installation.
CMakeSetup.exe
- If launching from the VS command prompt and it can't find
the file give it the full path. If you installed it in the default path,
try entering
(with the quotes).
"C:\Program Files\CMake 2.8\bin\CMakeSetup.exe"
- If launching from the VS command prompt and it can't find
the file give it the full path. If you installed it in the default path,
try entering
- Fill in the "Where is the source code:" field at the top of CMake. This is the path to the Nektar\library\ directory.
- Fill in the "Where to build the binaries:" field at the top of CMake. This is the path that the Visual Studio solution files will be written to and is the path to Nektar\builds\ directory. For example, C:\Nektar\builds.
- Click the "Configure" button at the bottom of the program. It will ask for the platform to generate the files for. Select Visual Studio 9 2008. Press Generate. CMake will now search for the paths to the ThirdParty files that were setup in the previous section. It should find all of the library and include paths automatically.
- Press the "Configure" button again. This time everything should be GRAY, meaning everything is set. Press the "Generate" button, and the Visual Studio solution will be created.
Compiling the Solution in Visual Studio
Now that CMake generated the appropriate solution files, it can be opened in Visual Studio and compiled.
- From the "Build" menu, select "Configuration Manager...". For full optimizations, select "Release" from the "Active solution configuration:" menu.
- To build the solution, select "Build Solution" from the "Build" menu.
- Take a break as it compiles. It could take a while.
- Select the "INSTALL" project from "Solution Explorer" on the left. From the "Build" menu, select "build INSTALL". This will put all of the compiled libraries into a dist directory that can then be used by the solvers and the utilities.
- The executable files will be located in the path you specified in the CMake utility.
- In order to run the executable files, they need to find the appropriate library files (*.dll).
- Put the Nektar\ThirdParty\boost\lib\ and Nektar\ThirdParty\ directories in your ENVIROMENT VARIABLES PATH.
- Alternatively, copy the following files into
your Release executable output directory. (Or the ones with "-gd" in the
name if you are using debug mode.)
- Nektar\ThirdParty\boost\lib\boost_thread-vc90-mt-1_40_0.dll
- Nektar++\ThirdParty\boost\lib\boost_filesystem-vc90-mt-1_40_0.dll
- Nektar++\ThirdParty\boost\lib\boost_iostreams-vc90-mt-1_40_0.dll
- Nektar++\ThirdParty\boost\lib\boost_zlib-vc90-mt-1_40_0.dll
- Nektar++\ThirdParty\lapack_win32.dll
- Nektar++\ThirdParty\blas_win32.dll
-
Right-click on My Computer and choose "Properties"
In the box that opens, click the "Advanced" tab to obtain another dialog box
Click the button "Environment Variables"
In the list of system variables, double click on the Path variable for editing it
Add the following line: C:\Nektar\ThirdParty\boost\lib\; C:\Nektar\ThirdParty\
Compiling the Solvers and Utilities
To compile the solvers and the utilities you first need to have compiled the library and build the "INSTALL" project by selecting "INSTALL" from the solution explorer and then "build INSTALL" form the "build" menu. Doing this, all the Nektar++ and ThirdParty libraries are placed into the dist directory under the Nektar++ build directory (i.e. Nektar++\builds\dist)
Once again we use CMake to generate the solution files that Visual Studio requires.
- Launch CMake.
- Fill in the "Where is the source code:" field at the top of CMake. This is the path to the Nektar++\solvers directory. For example, C:\Nektar++\solvers
- Fill in the "Where to build the binaries:" field at the top of CMake. This is the path that the Visual Studio solution files will be written to and is the path to the solvers\builds\ directory. For example, C:\Nektar++\solvers\builds.
- Click the "Configure" button at the bottom of the program. It will ask for the platform to generate the files for. Select Visual Studio 9 2008. Answer Generate.It should find all of the library and include paths automatically.
- Set the EXECUTABLE_OUTPUT_PATH. This can be any directory you please.
- Press the "Configure" button again. This time everything should be GRAY, meaning everything is set. Press the "Generate" button, and the Visual Studio solution will be created.
- Open the solution file in Visual Studio. From the "Build" menu, select "Configuration Manager...". For full optimizations, select "Release" from the "Active solution configuration:" menu.
- To build the solution, select "Build Solution" from the "Build" menu.
- The executable files will be located in the path you specified in the CMake utility.
Compiling the Regression Tests
To compile the regression tests you first need to have compiled the Nektar++ library and Solvers
Once again we use CMake to generate the solution files that Visual Studio requires.
- Launch CMake
- Fill in the "Where is the source code:" field at the top of CMake. This is the path to the Nektar++\regressionTests directory. For example, C:\Nektar++\regressionTests
- Fill in the "Where to build the binaries:" field at the top of CMake. This is the path that the Visual Studio solution files will be written to and is the path to the regressionTests\builds\ directory. For example, C:\Nektar++\regressionTests\builds.
- Click the "Configure" button at the bottom of the program. It will ask for the platform to generate the files for. Select Visual Studio 9 2008. Answer Generate.It should find all of the library and include paths automatically.
- Set the EXECUTABLE_OUTPUT_PATH. This can be any directory you please.
- Press the "Configure" button again. This time everything should
be GRAY, meaning everything is set. Press the "Generate" button, and the
Visual Studio solution will be created.
Note: If you are modifying the regression tests by adding or removing tests you can generate a new master ".ok" file by setting the variable REGRESSION_MAKE_OK_FILES_EXEC to ON. This will, for example, generate the executable StdRegionsDemoMakeOKFile which when executed will execute a series of demos and make the updated .ok files. - Open the solution file in Visual Studio. From the "Build" menu, select "Configuration Manager...". For full optimizations, select "Release" from the "Active solution configuration:" menu.
- To build the solution, select "Build Solution" from the "Build" menu.
- The executable files will be located in the path you specified in the CMake utility.