Skip to content
Snippets Groups Projects
Commit ff4e659c authored by Hanieh Mirzaee's avatar Hanieh Mirzaee
Browse files

no message

git-svn-id: https://gforge.sci.utah.edu/svn/nektar/trunk@1884 305cdda6-5ce1-45b3-a98d-dfc68c8b3305
parent b5600a20
No related branches found
No related tags found
No related merge requests found
......@@ -110,16 +110,57 @@
<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>
<p style="font-size:9px;">Last Revision:<br/>$Date: 2009/04/28 12:53:35 $</p>
<p style="font-size:9px;">Last Revision:<br/>$Date: 2009/04/30 15:16:46 $</p>
</div>
<div id="mainContent">
<!-- InstanceBeginEditable name="Title" -->
<h1>Compile Instructions</h1>
<h2>Linux - GCC</h2>
<h2>Linux - GCC / kDevelop </h2>
<!-- InstanceEndEditable -->
<hr/>
<ul>
<li>
<h3 align="left">
<small>
<a href="#Setting_up_GCC">Setting up GCC</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="#Setting_up_BLAS">Setting up BLAS</a>
</small>
</h3>
</li>
<li>
<h3>
<small>
<a href="#Generating_the_GCC_Makefiles_with_CMake">Generating the GCC Makefiles with CMake</a>
</small>
</h3>
</li>
<li>
<h3>
<a href="#Compiling_the_Solvers_and_Utilities">
<small>Compiling the Solvers and Utilities</small>
</a>
</h3>
</li>
</ul>
<hr>
<!-- InstanceBeginEditable name="BodyText" -->
<h3 align="left">Setting up GCC</h3>
<h3 align="left">
<a name ="Setting_up_GCC" ></a>Setting up GCC</h3>
<p align="left">In order to compile Nektar++, you must have a newer version of GCC installed. GCC 4.1 and newer will work, but 4.2 or newer is recommended because the ATLAS (a BLAS implementation) website says 4.2 results in better performance. Below I will give instructions on how to check the GCC version number, and installing a new version if it is too old.</p>
<ol>
<li>At the terminal, type &quot;gcc -v&quot; (without the quotes).
......@@ -142,25 +183,27 @@
</ul>
</li>
</ol>
<h3 align="left">Organizing the ThirdParty Source Files</h3>
<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 <em>Nektar++</em> directory and a <em>ThirdParty</em> directory (includes needed libraries from other sources). These need to be organized into the correct directory hierarchy for CMake to find all of the required files. I will indicate a directory by following its name with a forward slash.</p>
<ol>
<li>Put the <em>ThirdParty/</em> 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>At the terminal in <em>ThirdParty/</em>, extract the tinyxml_2_4_3.zip archive with &quot;unzip tinyxml_2_4_3.zip&quot; (without the quotes). This will create <em>tinyxml/</em>. </li>
<li>Extract the loki-0.1.3.tar.bz2 archive with &quot;tar -xjvf loki-0.1.3.tar.bz2&quot; (again, without the quotes). This will create <em>loki-0.1.3/</em>.
<ol>
<li>Change to the <em>loki-0.1.3/</em> directory, and type &quot;make&quot; (without the quotes). This will create the required library file.</li>
</ol>
</li>
<li>CMake is an open-source, cross-platform make file generator system. It can be used to generate the correct GCC Makefiles. We must now build the CMake executable.
<ol>
<li>In <em>ThirdParty/</em>, extract the CMake.tar.bz2 archive with &quot;tar -xjvf CMake.tar.bz2&quot; (no quotes).</li>
<li>Change to the <em>CMake/</em> directory, and type &quot;./configure&quot; (without the quotes). After configuration is complete, type &quot;make&quot; (again, without the quotes).</li>
<ul>
<li>If you are using 64 bit Linux, extract the cmake_cvs.tar archive instead with "tar -xjvf cmake_cvs.tar.bz2". This will create the <em>cmake_cvs/</em> directory. </li>
</ul>
<li>Change to the <em>CMake/</em> (or <em>cmake_cvs/CMake/</em> in case of 64 bit linux) directory, and type &quot;./configure&quot; (without the quotes). After configuration is complete, type &quot;make&quot; (again, without the quotes).</li>
</ol>
</li>
<li>In <em>ThirdParty/</em>, extract the zlib-1.2.3.tar.bz2 archive with &quot;tar -xjvf zlib-1.2.3.tar.bz2&quot; (no quotes). This will create <em>zlib-1.2.3/</em>.
<ol>
<li>You must set the ZLIB_SOURCE and NO_BZIP2 environment variables in order to tell Boost (step 5) to use zlib and not bzip2. Be sure not to restart your shell after you set the environment variables and before you compile boost in step 7.
<li>You must set the ZLIB_SOURCE and NO_BZIP2 environment variables in order to tell Boost (step 7) to use zlib and not bzip2. Be sure not to restart your shell after you set the environment variables and before you compile boost in step 7.
<ul>
<li>Bash or KSH Shells<br />
Type &quot;export ZLIB_SOURCE=../../../../zlib-1.2.3&quot; and &quot;export NO_BZIP2=0&quot; (no quotes).</li>
......@@ -176,7 +219,7 @@
<li>Change to the <em>boost-jam-3.1.16/</em> directory and type &quot;./build.sh&quot; (no quotes), to build the bjam executable.</li>
</ol>
</li>
<li>The next step is to extract and compile the correct libraries for <em>Boost</em>.
<li>Next, extract and compile the correct libraries for <em>Boost</em>.
<ol>
<li>In <em>ThirdParty/</em>, extract the boost_1_35_0.tar.bz2 archive with &quot;tar -xjvf boost_1_35_0.tar.bz2&quot; (no quotes). This will create <em>boost_1_35_0/</em>.</li>
<li>Change to the <em>boost_1_35_0/</em> directory, and type &quot;../boost-jam-3.1.16/bin.*/bjam --prefix=../boost --build-type=complete --with-thread --with-iostreams --with-test --with-date_time --toolset=gcc install&quot; (without the quotes). This will place the compiled libraries and include files in the correct path.
......@@ -184,22 +227,25 @@
<li>The &quot;--with-libraries&quot; compiles Boost with only the libraries required by Nektar++. This is just meant to save time. You can leave the flag off and it will compile all the libraries, if you wish.</li>
</ol>
</li>
</li>
</ol>
</li>
<li>The last 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.9b.tar.bz2 archive with &quot;tar -xjvf boost_1_35_0.tar.bz2&quot; (without the quotes). This will create the directory <em>spblastk0.9b/</em>.</li>
<li>In <em>ThirdParty/</em>, extract the spblastk0.9b.tar.bz2 archive with &quot;tar -xjvf spblastk0.9b.tar.bz2&quot; (without the quotes). This will create the directory <em>spblastk0.9b/</em>.</li>
<li>Change to the directory <em>spblastk0.9b/build/</em></li>
<li>Compile the library using the previously installed <em>CMake</em></li>
<ol>
<li>Generate the makefiles using the command &quot;../../CMake/bin/cmake ../&quot;</li>
<li>Generate the makefiles using the command &quot;../../CMake/bin/cmake ../&quot; (or "../../cmake_cvs/CMake/bin/cmake ../" for 64 bit Linux) (no quotes).</li>
<li>Build the library by typing &quot;make install&quot; </li>
</ol>
</li>
</ol>
</li>
</ol>
<h3>Setting up BLAS</h3>
<h3>
<a name="Setting_up_BLAS"></a> Setting up BLAS</h3>
<p>One of three different versions of BLAS is required for Nektar++. If you do not have at least one of these BLAS implementations installed, please contact your system administrator and ask them to do so.</p>
<ul>
<li>Automatically Tuned Linear Algebra Software (ATLAS)
......@@ -224,15 +270,18 @@
</ul>
</li>
</ul>
<h3>Generating the GCC Makefiles with CMake</h3>
<h3>
<a name="Generating_the_GCC_Makefiles_with_CMake"></a> Generating the GCC Makefiles with CMake</h3>
<p>Now that all of the required libraries are setup in the correct paths, we can use CMake to generate the Makefiles that GCC requires.</p>
<ol>
<li>From the terminal, change to a directory where you want the project Makefiles to be created. (This could be the <em>Nektar++/library/</em> directory, but it isn't recommended.)</li>
<li>From the terminal, change to the directory <em>Nektar++/builds</em>. This is the directory where the library will be built.
</li>
<li>CMake can generate both GCC Makefiles, or KDevelop project files.
<ul>
<li>GCC Makefiles
<ul>
<li>Type in &quot;&lt;path_to_cmake_directory&gt;/bin/cmake -i &lt;path_to_<em>Nektar++/library/</em>_directory&gt;&quot; (without the quotes). Fill in the &lt;...&gt;'s appropriately.
<li>
Type in "../ThirdParty/CMake/bin/cmake -i ../library/" (or ../ThirdParty/cmake_cvs/CMake/bin/cmake -i ../library/ for 64 bit linux) (without the quotes).
<ul>
<li>The &quot;-i&quot; indicates that you want to use the wizard mode.</li>
</ul>
......@@ -242,7 +291,8 @@
</li>
<li>KDevelop Project Files
<ul>
<li>Type in &quot;&lt;path_to_cmake_directory&gt;/bin/cmake -i -G KDevelop3 &lt;path_to_<em>Nektar++/library/</em>_directory&gt;&quot; (without the quotes). Fill in the &lt;...&gt;'s appropriately.
<li>
Type in "../ThirdParty/CMake/bin/cmake -i -G KDevelop3 ../library/" (or ../ThirdParty/cmake_cvs/CMake/bin/cmake -i -G KDevelop3 ../library/ for 64 bit linux )(without the quotes).
<ul>
<li>The &quot;-i&quot; indicates that you want to use the wizard mode.</li>
</ul>
......@@ -274,20 +324,132 @@
<li>Note if the variable is asking for a library path (path to a *.so file), or a directory path. Don't enter a directory path if it is expecting a library.</li>
</ul>
</li>
<li>
<strong>USE_SYSTEM_BLAS_LAPACK</strong>
<ul>
<li>
Set this value to <em><strong>ON</strong></em> if you are using the system provided blas and lapack libraries and neither of the previously mentioned implementations.
</li>
</ul>
</li>
</ul>
</li>
</ol>
<h3>Compiling the Project</h3>
<h3>
<a name="Compiling_the_library"></a> Compiling the library</h3>
<p>Now that CMake generated the appropriate Makefiles, it can be compiled with GCC. If you chose to generate a KDevelop project, you can open the Nektar++.kdevelop file now, and skip the GCC instructions below.</p>
<ol>
<li>To compile the project, simply type &quot;make&quot; (no quotes) from your project directory (the directory where you started cmake from).
<li>To compile the project, simply type &quot;make&quot; (no quotes) from the project directory (i.e. <em>Nektar++/builds/</em>).
<ul>
<li>If you have multiple processors/cores, it might be beneficial to use &quot;make -j &lt;num_procs/cores&gt;&quot;. The &quot;-j&quot; options starts that many jobs, so all of the processors will be utilized, and it will compile faster</li>
</ul>
</li>
<li>Type "make install" (no quotes) to put all of the compiled libraries into a dist directory that can then be used by the solvers and utilities.</li>
<li>The executable files will be located in the path you specified in the CMake utility.</li>
</ol>
<!-- InstanceEndEditable -->
<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 typed "make install" to place all of the
Nektar++ and ThirdParty libraries into the dist directory under the
library builds directory (i.e. <em>Nektar++/Builds/dist</em>)
</br>
<p>
Once again we use CMake to generate the Makefiles that GCC requires, or
the project files that KDevelop requires.
</p>
<ol>
<li>
From the terminal, change to the build directory of the solvers, i.e. <em>Nektar++/solvers/builds</em>.
</li>
<li>CMake can generate both GCC Makefiles, or KDevelop project files.</li>
<ul>
<li>GCC Makefiles</li>
<ul>
<li>
Type in "../../ThirdParty/CMake/bin/cmake -i ../" (or ../../ThirdParty/cmake_cvs/CMake/bin/cmake -i ../ for 64 bit Linux) (without the quotes).
</li>
<ul>
<li>The "-i" indicates that you want to use the wizard mode.</li>
</ul>
<li>
Would you like to see advanced options? <strong>No</strong>
</li>
</ul>
</ul>
<ul>
<li>
KDevelop Project Files
</li>
<ul>
<li>
Type in "../../ThirdParty/CMake/bin/cmake -i -G KDevelop3 ../" (or ../../ThirdParty/cmake_cvs/CMake/bin/cmake -i -G KDevelop3 ../ for 64 bit linux) (without the quotes).
<ul>
<li>The "-i" indicates that you want to use the wizard mode.</li>
</ul>
</li>
<li>
Would you like to see advanced options? <strong>No</strong>
</li>
</ul>
</ul>
<li>
As before for
most of the questions, you will be able to select the default value by
just pressing enter. Most of the configuration will be locating the
files you setup earlier in <em>ThirdParty/</em>, but it should find
these files automatically. If you have a different setup, you may need
to enter the paths manually if they couldn't be found. Below I will
list some of the options that you need to pay attention to.
</li>
<ul>
<li>
<strong>CMAKE_BUILD_TYPE</strong>
</li>
<ul>
<li>
This
option sets the appropriate GCC flags for the different build types:
Debug, Release, etc. For this tutorial, I'll choose Release, in order
to get full optimizations.
</li>
</ul>
<li>
<strong>EXECUTABLE_OUTPUT_PATH</strong>
<ul>
<li>This is the path GCC will put the generated executable files - it can be anywhere you wish.</li>
</ul>
</li>
</ul>
</li>
<li>
Now you have generated the Makefiles, you can compile the solvers by entering "make" from the command line in the directory <em>Nektar++/solvers/builds/</em>. If you chose to compile the solvers with KDevelop, open the project "Nektar++.kdevelop" .
</ol>
To compile the utilities you follow an identical set of instructions but replace solvers in the above text with utilities.
<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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment