###

Downloads

Compilation Instructions
Linux
Windows
Mac OS X
Unit Tests
Regression Tests
Documentation

Example Usage

Educational Material

Documentation

Team Members

Publications

License

Acknowledgments

Contact

# 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.

1. Go to the Python Website and download the Windows Installer.
2. 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.

1. Go to the CMake Website and download the Win32 Installer.
2. Run the installer and click the Next, and then I Agree.
3. 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.

1. 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.
2. 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\.)
3. In ThirdParty\, extract the tinyxml_2_4_3.zip archive. This will create tinyxml\.
4. Extract the loki-0.1.3.tar.bz2 archive. This will create loki-0.1.3\.
5. Extract the blaslapack-dll.zip archive. This will create blas_win32.* and lapack_win32.* files in ThirdParty\.
6. Extract the zlib-1.2.3.tar.bz2 archive. This will create zlib-1.2.3\.
7. The next step is to extract and compile the correct libraries for Boost.
   1. 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.
   2. In ThirdParty\, extract the boost_1_40_0.tar.bz2 archive. This will create boost_1_40_0\.
   3. With the Visual Studio Command Prompt, change to the ThirdParty\boost_1_40_0\ directory.
   4. Type the following

          ..\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

      and press enter. This will compile the correct Boost libraries.
      - 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).
8. 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)
   1. In ThirdParty\, extract the spblastk0.9.tar.bz2 archive. This will create the directory spblastk0.9\.
   2. Launch the previously installed CMake by typing

          CMakeSetup.exe

      at the VS command prompt or by just double clicking on the CMake icon that appears on your desktop after installation.
      - 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

            "C:\Program Files\CMake 2.8\bin\CMakeSetup.exe"

        (with the quotes).
   3. 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
   4. 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.
   5. 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.
   6. 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.
   7. 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.
   8. 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.
9. 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)
   1. In ThirdParty\, extract the modmetis-4.0.tar.bz2 archive. This will create the directory modmetis-4.0\.
   2. Launch the previously installed CMake by typing

          CMakeSetup.exe

      at the VS command prompt or by just double clicking on the CMake icon that appears on your desktop after installation.
      - 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

            "C:\Program Files\CMake 2.8\bin\CMakeSetup.exe"

        (with the quotes).
   3. 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
   4. 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.
   5. 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.
   6. 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.
   7. 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.
   8. 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.

1. Launch the previously installed CMake by typing

       CMakeSetup.exe

   at the VS command prompt or by just double clicking on the CMake icon that appears on your desktop after installation.
   - 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

         "C:\Program Files\CMake 2.8\bin\CMakeSetup.exe"

     (with the quotes).
2. Fill in the "Where is the source code:" field at the top of CMake. This is the path to the Nektar\library\ directory.
3. 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.
4. 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.
5. 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.

1. From the "Build" menu, select "Configuration Manager...". For full optimizations, select "Release" from the "Active solution configuration:" menu.
2. To build the solution, select "Build Solution" from the "Build" menu.
3. Take a break as it compiles. It could take a while.
4. 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.
5. The executable files will be located in the path you specified in the CMake utility.
6. 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.
   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\
   - 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.)
     - N ektar\ThirdParty\boost\lib\boost_thread-vc90-mt-1_40_0.dll
     - N ektar++\ThirdParty\boost\lib\boost_filesystem-vc90-mt-1_40_0.dll
     - N ektar++\ThirdParty\boost\lib\boost_iostreams-vc90-mt-1_40_0.dll
     - N ektar++\ThirdParty\boost\lib\boost_zlib-vc90-mt-1_40_0.dll
     - Nektar++\ThirdParty\lapack_win32.dll
     - Nektar++\ThirdParty\blas_win32.dll

### 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.

1. Launch CMake.
2. 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
3. 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.
4. 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.
5. Set the EXECUTABLE_OUTPUT_PATH. This can be any directory you please.
6. 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.
7. 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.
8. To build the solution, select "Build Solution" from the "Build" menu.
9. The executable files will be located in the path you specified in the CMake utility.

To compile the utilities you follow an identical set of instructions but replace solvers in the above text with utilities.

### 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.

1. Launch CMake
2. 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
3. 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.
4. 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.
5. Set the EXECUTABLE_OUTPUT_PATH. This can be any directory you please.
6. 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.
7. 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.
8. To build the solution, select "Build Solution" from the "Build" menu.
9. The executable files will be located in the path you specified in the CMake utility.

###
The entire Nektar++ package should now have been succesfully compiled. Instructions on how to use Nektar++ are described on the usage page.