<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/Main.dwt" codeOutsideHTMLIsLocked="false" --> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="shortcut icon" href="images/favicon.ico" > <!-- InstanceBeginEditable name="doctitle" --> <title>Nektar++ - Windows Compile Instructions</title> <!-- InstanceEndEditable --> <link rel="stylesheet" href="style.css"> <!-- InstanceBeginEditable name="CSS_Style" --> <style type="text/css"> <!-- #menu_CompileWindows { font-weight: bold; } --> </style> <!-- InstanceEndEditable --> <!--[if IE]> <style type="text/css"> .twoColHybLt #sidebar1 { padding-top: 30px; margin-top: 20px; } .twoColHybLt #mainContent { zoom: 1; padding-top: 15px; } </style> <![endif]--> <!-- InstanceParam name="LibraryMenu" type="boolean" value="false" --> <!-- InstanceParam name="CompileMenu" type="boolean" value="true" --> </head> <body class="twoColHybLt"> <div id="container"> <div id="sidebar1"> <h3 style="text-align: center;"><a href="index.html" id="menu_Nektar"><img src="images/nektar.png" alt="Nektar++" width="155" height="38" /></a></h3> <p><a href="downloads.html" id="menu_Downloads">Downloads</a></p> <p><a href="compile.html" id="menu_Compile">Compilation Instructions</a> <br/> <a href="compile_linux.html" id="menu_CompileLinux">Linux</a><br/> <a href="compile_windows.html" id="menu_CompileWindows">Windows</a><br/> <a href="compile_osx.html" id="menu_CompileOSX">Mac OS X</a><br/> <a href="compile_unit_tests.html" id="menu_CompileUnitTests">Unit Tests</a><br/> <a href="compile_regression_tests.html" id="menu_CompileRegressionTests">Regression Tests</a><br/> <a href="compile_documentation.html" id="menu_CompileDocumentation">Documentation</a><br/> </p> <p><a href="usage.html" id="menu_Usage">Example Usage</a></p> <p><a href="educational_material.html" id="menu_EducationalMaterial">Educational Material</a></p> <p><a href="code/index.html" id="menu_Library">Documentation</a></p> <p><a href="team.html" id="menu_Team">Team Members</a></p> <p><a href="publications.html" id="menu_Publications">Publications</a></p> <p><a href="license.html" id="menu_License">License</a></p> <p><a href="acknowledgments.html" id="menu_Acknowledgments">Acknowledgments</a></p> <p><a href="mailto:nektar-inquiry@sci.utah.edu" id="menu_Contact">Contact</a></p> </div> <div id="mainContent"> <!-- InstanceBeginEditable name="Title" --> <h1>Compile Instructions</h1> <h2>Windows - Visual Studio 2008</h2> <hr> <ul> <li> <h3 align="left"> <small> <a href="#Setting_up_CMake_(2.8+_required)">Setting up CMake (2.8+ required)</a> </small> </h3> </li> <li> <h3 align="left"> <small> <a href="#Organizing_the_ThirdParty_Source_Files">Organizing the ThirdParty Source Files</a> </small> </h3> </li> <li> <h3> <small> <a href="#Generating_the_Visula_Studio_Solution_Files_with_CMake">Generating the Visual Studio Solution Files with CMake</a> </small> </h3> </li> <li> <h3> <small> <a href="#Compiling_the_Solution_in_Visual_Studio_">Compiling the Solution in Visual Studio</a> </small> </h3> </li> <li> <h3> <a href="#Compiling_the_Solvers_and_Utilities"> <small>Compiling the Solvers and Utilities</small> </a> </h3> </li> <li> <h3><a href="#Compiling_Regression_Tests"><small>Compiling the Regression Tests</small></a></h3> </li> </ul> <!-- InstanceEndEditable --> <hr/> <!-- InstanceBeginEditable name="BodyText" --> <h3 align="left"> <a name="Setting_up_CMake_(2.8+_required)"></a>Setting up CMake (2.8+ required) </h3> <p align="left">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 <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyId=FBEE1648-7106-44A7-9649-6D9F6D58056E&displaylang=en">Visual Studio 2008 Service Pack 1<span class="Apple-converted-space"> </span></a> is installed on the computer.</p> <ol> <li>Go to the <a href="http://www.cmake.org/HTML/index.html" target="_blank">CMake Website</a> and download the Win32 Installer.</li> <li>Run the installer and click the <em>Next</em>, and then <em>I Agree</em>.</li> <li>Select the option to "Add CMake to the system PATH"</li> </ol> <h3 align="left"> <a name="Organizing_the_ThirdParty_Source_Files"></a> Organizing the ThirdParty Source Files</h3> <p align="left">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.</p> <ol> <li>Unpack the <em>ThirdParty-3.x.x.tar.gz</em> file and rename the resulting directory to <em>ThirdParty</em>. Put the ThirdParty directory in <em>Nektar++\</em>. (This will mean <em>library\</em> and <em>ThirdParty\</em> are both sub-directories of the original <em>Nektar++\</em>.)</li> <li>In <em>ThirdParty\</em>, extract the tinyxml_2_4_3.zip archive. This will create <em>tinyxml\</em>. </li> <li> Extract the loki-0.1.3.tar.bz2 archive. This will create <em>loki-0.1.3\</em>. </li> <li>Extract the blaslapack-dll.zip archive. This will create blas_win32.* and lapack_win32.* files in <em>ThirdParty\</em>.</li> <li>Extract the zlib-1.2.3.tar.bz2 archive. This will create <em>zlib-1.2.3\</em>.</li> <li>The next step is to extract and compile the correct libraries for <em>Boost</em>. <ol> <li>Open the <em>Visual Studio 2008 Command Prompt </em> This is located in the <em>Microsoft Visual Studio 2008\Visual Studio Tools</em> folder in your "Start -> Programs" menu. </li> <li>In <em>ThirdParty\</em>, extract the boost_1_40_0.tar.bz2 archive. This will create <em>boost_1_40_0\</em>.</li> <li>With the <em>Visual Studio Command Prompt</em>, change to the <em>ThirdParty\boost_1_40_0\</em> directory.</li> <li>Type the following <div class="code"><pre>..\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</pre></div> and press enter. This will compile the correct <em>Boost</em> libraries. <ul> <li>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).</li> </ul> </li> </ol> </li> <li> The following step is to extract and compile the sparse matrix library developed by <em>NIST</em>.(For more information about this library, see <a href="http://math.nist.gov/spblas/original.html" target="_blank">http://math.nist.gov/spblas/original.html</a>) <ol> <li>In <em>ThirdParty\,</em> extract the spblastk0.9.tar.bz2 archive. This will create the directory <em>spblastk0.9\</em>. <li> Launch the previously installed <em>CMake</em> by typing <div class="code"><pre>CMakeSetup.exe</pre></div> at the VS command prompt or by just double clicking on the <em>CMake</em> icon that appears on your desktop after installation. <ul> <li>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 <div class="code"><pre>"C:\Program Files\CMake 2.8\bin\CMakeSetup.exe"</pre></div> (with the quotes).</li> </ul> </li> <li>Fill in the "Where is the source code:" field at the top of the CMake. This is the path to the <em>ThirdParty\spblastk0.9\</em> directory. For example, <em>C:\Nektar++\ThirdParty\spblastk0.9</em> </li> <li>Fill in the "Where to build the binaries:" field at the top of CMake. This is the path to the <em>ThirdParty\spblastk0.9\build\</em> directory. For example, <em>C:\Nektar++\ThirdParty\spblastk0.9\build</em>. The Visual Studio solution files will be placed here. </li> <li> Click the "Configure" button at the bottom of the program. It will ask for the platform to generate the files for. Select <em>Visual Studio 9 2008</em>. Press <em>OK</em>. </li> <li>Press the "Configure" button again. This time everything should be GRAY, meaning everything is set. Press the "OK" button, and the Visual Studio solution will be created. </li> </li> <li>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.</li> <li> 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. </li> </ol> </li> <li> The last step is to extract and compile the graph partitioning package <em>METIS</em>. 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 <a href="http://www.cs.umn.edu/~karypis/metis" target="_blank">http://www.cs.umn.edu/~karypis/metis</a>, for more information about the modified version, click <a href="./metisandnektar++.txt" target="_blank">here</a>) <ol> <li>In <em>ThirdParty\,</em> extract the modmetis-4.0.tar.bz2 archive. This will create the directory <em>modmetis-4.0\</em>. <li> Launch the previously installed <em>CMake</em> by typing <div class="code"><pre>CMakeSetup.exe</pre></div> at the VS command prompt or by just double clicking on the <em>CMake</em> icon that appears on your desktop after installation. <ul> <li>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 <div class="code"><pre>"C:\Program Files\CMake 2.8\bin\CMakeSetup.exe"</pre></div> (with the quotes).</li> </ul> </li> <li>Fill in the "Where is the source code:" field at the top of the CMake. This is the path to the <em>ThirdParty\modmetis-4.0\</em> directory. For example, <em>C:\Nektar++\ThirdParty\modmetis-4.0</em> </li> <li>Fill in the "Where to build the binaries:" field at the top of CMake. This is the path to the <em>ThirdParty\modmetis-4.0\build\</em> directory. For example, <em>C:\Nektar++\ThirdParty\modmetis-4.0\build</em>. The Visual Studio solution files will be placed here. </li> <li> Click the "Configure" button at the bottom of the program. It will ask for the platform to generate the files for. Select <em>Visual Studio 9 2008</em>. Press <em>OK</em>. </li> <li>Press the "Configure" button again. This time everything should be GRAY, meaning everything is set. Press the "OK" button, and the Visual Studio solution will be created. </li> </li> <li>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.</li> <li> 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. </li> </ol> </li> </ol> <h3> <a name="Generating_the_Visula_Studio_Solution_Files_with_CMake"></a> Generating the Visual Studio Solution Files with CMake</h3> <p>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 instrction <em>#7</em> mentioned in the previous section to generate solutions files for the Nektar++ library. </p> <ol> <li> Launch the previously installed <em>CMake</em> by typing <div class="code"><pre>CMakeSetup.exe</pre></div> at the VS command prompt or by just double clicking on the <em>CMake</em> icon that appears on your desktop after installation. <ul> <li>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 <div class="code"><pre>"C:\Program Files\CMake 2.8\bin\CMakeSetup.exe"</pre></div> (with the quotes).</li> </ul> </li> <li>Fill in the "Where is the source code:" field at the top of CMake. This is the path to the <em>Nektar++\library\</em> directory. For example, <em>C:\Nektar++\library</em>.</li> <li>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 <em>Nektar++\builds\</em> directory. For example, <em>C:\Nektar++\builds</em>.</li> <li>Click the "Configure" button at the bottom of the program. It will ask for the platform to generate the files for. Select <em>Visual Studio 9 2008</em>. Press <em>OK</em>. 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.</li> <li> You must now change some of the CMake settings:<ul><li><strong>CMAKE_INSTALL_PREFIX</strong> <ul> <li>This is the path where Visual Studio will put the *.exe executable files after they are compiled. This can be any directory you please.</li> </ul> </li> <li><strong>LIBRARY_OUTPUT_PATH</strong> <ul> <li>This is the path where Visual Studio will put the *.lib library files after they are generated. This can once again be any directory you wish.</li> </ul> </li> </ul> </li> <li>Press the "Configure" button again. This time everything should be GRAY, meaning everything is set. Press the "OK" button, and the Visual Studio solution will be created.</li> </ol> <h3> <a name="Compiling_the_Solution_in_Visual_Studio_"></a> Compiling the Solution in Visual Studio</h3> <p>Now that CMake generated the appropriate solution files, it can be opened in Visual Studio and compiled.</p> <ol> <li>From the "Build" menu, select "Configuration Manager...". For full optimizations, select "Release" from the "Active solution configuration:" menu.</li> <li>To build the solution, select "Build Solution" from the "Build" menu.</li> <li>Take a break as it compiles. It could take a while.</li> <li>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 <em>dist</em> directory that can then be used by the solvers and the utilities.</li> <li>The executable files will be located in the path you specified in the CMake utility.</li> <li>In order to run the executable files, they need to find the appropriate library files (*.dll). <ul> <li>Put the <em>Nektar++\ThirdParty\boost\lib\</em> and <em>Nektar++\ThirdParty\</em> directories in your PATH.</li> <li><em>Alternatively</em>, copy the following files into your Release executable output directory. (Or the ones with "-gd" in the name if you are using debug mode.) <ul> <li><em>N</em><em>ektar++\ThirdParty\boost\lib\boost_thread-vc90-mt-1_40_0.dll</em></li> <li><em>N</em><em>ektar++\ThirdParty\boost\lib\boost_filesystem-vc90-mt-1_40_0.dll</em></li> <li><em>N</em><em>ektar++\ThirdParty\boost\lib\boost_iostreams-vc90-mt-1_40_0.dll</em></li> <li><em>N</em><em>ektar++\ThirdParty\boost\lib\boost_zlib-vc90-mt-1_40_0.dll</em></li> <li><em>Nektar++\ThirdParty\lapack_win32.dll</em></li> <li><em>Nektar++\ThirdParty\blas_win32.dll</em></li> </ul> </li> </ul> </li> </ol> <h3> <a name="Compiling_the_Solvers_and_Utilities"></a>Compiling the Solvers and Utilities </h3> <br> 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. <em>Nektar++\builds\dist</em>)</br> <p> Once again we use CMake to generate the solution files that Visual Studio requires. </p> <ol> <li>Launch <em>CMake</em>. </li> <li>Fill in the "Where is the source code:" field at the top of CMake. This is the path to the <em>Nektar++\solvers</em> directory. For example, <em>C:\Nektar++\solvers</em> </li> <li>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 <em>solvers\builds\</em> directory. For example, <em>C:\Nektar++\solvers\builds</em>.</li> <li> Click the "Configure" button at the bottom of the program. It will ask for the platform to generate the files for. Select <em>Visual Studio 9 2008</em>. Answer <em>OK</em>.It should find all of the library and include paths automatically. </li> <li>Set the <b>EXECUTABLE_OUTPUT_PATH</b>. This can be any directory you please.</li> <li>Press the "Configure" button again. This time everything should be GRAY, meaning everything is set. Press the "OK" button, and the Visual Studio solution will be created.</li> <li>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. </li> <li>To build the solution, select "Build Solution" from the "Build" menu.</li> <li>The executable files will be located in the path you specified in the CMake utility. </li> </ol> To compile the utilities you follow an identical set of instructions but replace solvers in the above text with utilities. <h3><a name="Compiling_Regression_Tests"></a>Compiling the Regression Tests</h3> <br> To compile the regression tests you first need to have compiled the Nektar++ library and Solvers </br> <p>Once again we use CMake to generate the solution files that Visual Studio requires.</p> <ol> <li>Launch <em>CMake</em></li> <li>Fill in the "Where is the source code:" field at the top of CMake. This is the path to the <em>Nektar++\regressionTests</em> directory. For example, <em>C:\Nektar++\regressionTests</em></li> <li>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 <em>regressionTests\builds\</em> directory. For example, <em>C:\Nektar++\regressionTests\builds</em>.</li> <li>Click the "Configure" button at the bottom of the program. It will ask for the platform to generate the files for. Select <em>Visual Studio 9 2008</em>. Answer <em>OK</em>.It should find all of the library and include paths automatically.</li> <li>Set the <b>EXECUTABLE_OUTPUT_PATH</b>. This can be any directory you please.</li> <li>Press the "Configure" button again. This time everything should be GRAY, meaning everything is set. Press the "OK" button, and the Visual Studio solution will be created.<br/> <b>Note:</b> If you are modifying the regression tests by adding or removing tests you can generate a new master ".ok" file by setting the variable <em>REGRESSION_MAKE_OK_FILES_EXEC</em> to <em>ON</em>. This will, for example, generate the executable <em>StdRegionsDemoMakeOKFile</em> which when executed will execute a series of demos and make the updated .ok files. <li>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. </li> <li>To build the solution, select "Build Solution" from the "Build" menu.</li> <li>The executable files will be located in the path you specified in the CMake utility. </li> </ol> <h3> <br> The entire Nektar++ package should now have been succesfully compiled. Instructions on how to use Nektar++ are described on the <a href="usage.html" id="menu_Usage">usage</a> page. </h3> <!-- InstanceEndEditable --> <p><br class="clearfloat" /></p> </div> </div> </body> <!-- InstanceEnd --></html>