Forked from
Nektar / Nektar
15582 commits behind the upstream repository.
-
Peter Vos authored
git-svn-id: https://gforge.sci.utah.edu/svn/nektar/trunk@2095 305cdda6-5ce1-45b3-a98d-dfc68c8b3305
Peter Vos authoredgit-svn-id: https://gforge.sci.utah.edu/svn/nektar/trunk@2095 305cdda6-5ce1-45b3-a98d-dfc68c8b3305
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
compile_osx.html 19.29 KiB
<!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">
<head>
<!-- InstanceBegin template="/Templates/Main.dwt" codeOutsideHTMLIsLocked="false" -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="shortcut icon" href="images/favicon.ico">
<!-- InstanceBeginEditable name="doctitle" -->
<title>Nektar++ - OS X Compile Instructions</title>
<!-- InstanceEndEditable -->
<style type="text/css">
<!--
html {
min-height: 101%; // force a scrollbar to always appear
}
body {
font: 100% Verdana, Arial, Helvetica, sans-serif;
background: #FFFFFF;
margin: 0;
padding: 0;
text-align: center;
color: #000000;
}
.twoColHybLt #container {
//max-width: 90em;
max-width: 60em;
width: 99%;
background: #FFFFFF;
margin: 0 auto;
text-align: left;
}
.twoColHybLt #sidebar1 {
float: left;
width: 13.7em;
background: #EBEBEB;
border: 1px solid #000000;
padding-top: 15px;
padding-right: 0;
padding-bottom: 15px;
padding-left: 0;
}
.twoColHybLt #sidebar1 h3, .twoColHybLt #sidebar1 p {
margin-left: 10px;
margin-right: 10px;
}
.twoColHybLt #mainContent {
margin-top: 0;
margin-right: 20px;
margin-bottom: 0;
margin-left: 14.5em;
}
.fltrt {
float: right;
margin-left: 8px;
}
.fltlft {
float: left;
margin-right: 8px;
}
.clearfloat {
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
img {
border:0;
}
h1,h2,h3 {
margin-bottom: 0;
}
-->
</style><!-- InstanceBeginEditable name="CSS_Style" -->
<style type="text/css">
<!--
#menu_CompileOSX {
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++" height="38" width="155"></a></h3>
<p><a href="downloads.html" id="menu_Downloads">Downloads</a></p>
<p><a href="compile.html" id="menu_Compile">Compile 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_documentation.html" id="menu_CompileDocumentation">Documentation</a><br/>
</p>
<p><a href="library.html" id="menu_Library">Library Overview</a></p>
<p><a href="team.html" id="menu_Team">Team Members</a></p>
<p><a href="pre-processing.html" id="menu_PreProcessing">Pre-processing</a></p>
<p><a href="post-processing.html" id="menu_PostProcessing">Post-processing</a></p>
<p><a href="usage.html" id="menu_Usage">Usage</a></p>
<p><a href="http://www.nektar.info/2nd_edition/" target="_blank" id="menu_Book2ndEd">Spectral/hp element methods for CFD</a> (Karniadakis and Sherwin)</p>
<p><a href="educational_material.html" id="menu_EducationalMaterial">Educational Material</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>
<p style="font-size: 9px;">Last Revision:<br>
$Date: 2009/10/30 13:56:36 $</p>
</div>
<div id="mainContent">
<!-- InstanceBeginEditable name="Title" -->
<h1>Compile Instructions</h1>
<h2>Mac OS X - GCC / Xcode</h2>
<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="#Generating_the_GCC_Makefiles_with_CMake">Generating the GCC Makefiles with CMake</a></small></h3>
</li>
<li>
<h3><small><a href="#Compiling_the_library_">Compiling the library</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"><a name="Setting_up_GCC"></a>Setting up GCC</h3>
<p align="left">In order to compile Nektar++, you must have GCC installed.
The GCC compiler comes with Apple's XCode package. You can download
this from <a href="http://connect.apple.com/" target="_blank">http://connect.apple.com/</a> (you are required to have an Apple Developer Connection account).</p>
<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 "unzip tinyxml_2_4_3.zip" (without the quotes). This will create <em>tinyxml/</em>. </li>
<li>Extract the loki-0.1.3.tar.bz2 archive with "tar -xjvf loki-0.1.3.tar.bz2" (again, without the quotes). This will create <em>loki-0.1.3/</em>.
</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 "tar -xjvf CMake.tar.bz2" (no quotes).</li>
<li>Change to the <em>CMake/</em> directory, and type
"./configure" (without the quotes). After configuration is complete,
type "make" (again, without the quotes).</li>
</ol>
</li>
<li>In <em>ThirdParty/</em>, extract the zlib-1.2.3.tar.bz2 archive with "tar -xjvf zlib-1.2.3.tar.bz2" (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 7) to use zlib and not bzip2.
<ul>
<li>Bash or KSH Shells<br>
Type "export ZLIB_SOURCE=../../../../zlib-1.2.3" and "export NO_BZIP2=0" (no quotes).</li>
<li>CSH or Tcsh Shells<br>
Type "setenv ZLIB_SOURCE ../../../../zlib-1.2.3" and "setenv NO_BZIP2 0" (no quotes).</li>
</ul>
</li>
</ol>
</li>
<li>The next step is to compile bjam, which will allow for the building and installation of Boost.
<ol>
<li>In <em>ThirdParty/</em>, extract the boost-jam-3.1.16.tgz archive with "tar -xzvf boost-jam-3.1.16.tgz" (no quotes). This will create <em>boost-jam-3.1.16/</em>.</li>
<li>Change to the <em>boost-jam-3.1.16/</em> directory and type "./build.sh" (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>.
<ol>
<li>In <em>ThirdParty/</em>, extract the boost_1_35_0.tar.bz2 archive with "tar -xjvf boost_1_35_0.tar.bz2" (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 "../boost-jam-3.1.16/bin.macosxx86/bjam --prefix=../boost
--build-type=complete --with-thread --with-iostreams --with-test
--with-date_time --with-filesystem --with-system --toolset=darwin install" (without the quotes). This
will place the compiled libraries and include files in the correct
path.
<ol>
<li>The "--with-*" 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>
</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.9b.tar.bz2 archive with "tar -xjvf spblastk0.9b.tar.bz2"
(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 "../../CMake/bin/cmake ../"</li>
<li>Build and install the library by typing "make install" </li>
</ol>
</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 with "tar -xjvf modmetis-4.0.tar.bz2" (without the quotes). This will create the directory <em>modmetis-4.0/</em>.
</li>
<li>
Change to the directory <em>modmetis-4.0/build/</em>
</li>
<li>Compile the library using the previously installed <em>CMake</em></li>
<ol>
<li>Generate the makefiles using the command "../../CMake/bin/cmake ../"</li>
<li>Build and install the library by typing "make install" </li>
</ol>
</ol>
</li>
</ol>
<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, or
the project files that Xcode requires.</p>
<ol>
<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 Xcode project files.
<ul>
<li>GCC Makefiles
<ul>
<li>Type in "../ThirdParty/CMake/bin/cmake -i ../library/" (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>
</li>
<li>Xcode Project Files
<ul>
<li>Type in "../ThirdParty/CMake/bin/cmake -i -G Xcode ../library/" (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>
</li>
</ul>
</li>
<li>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.
<ul>
<li><strong>CMAKE_BUILD_TYPE</strong>
<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>
<!-- <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>
<li><strong>LIBRARY_OUTPUT_PATH</strong>
<ul>
<li>This is the path GCC will put the generated *.a library files.</li>
</ul> -->
</li>
</ul>
</li>
</ol>
<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 Xcode project, you can
open <em>Nektar++.xcodeproj/</em> now, and skip the GCC instructions below.</p>
<ol>
<li>To compile the project, simply type "make" (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 "make -j <num_procs/cores>". The "-j" options
starts that many jobs, so all of the processors will be utilized, and
it will compile faster</li>
</ul>
</li>
<!-- <li>The executable files will be located in the path you specified in the CMake utility.</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>
</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 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 Xcode 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 Xcode project files.
<ul>
<li>GCC Makefiles
<ul>
<li>Type in "../../ThirdParty/CMake/bin/cmake -i ../" (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>
</li>
<li>Xcode Project Files
<ul>
<li>Type in "../../ThirdParty/CMake/bin/cmake -i -G Xcode ../" (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>
</li>
</ul>
</li>
<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.
<ul>
<li><strong>CMAKE_BUILD_TYPE</strong>
<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>
<!-- <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.<span style="font-weight: bold;"></span></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 Xcode, open the project "SOLVERS.xcodeproj".
</span></li>
</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>
<p><br class="clearfloat">
</p>
</div>
</div>
<!-- InstanceEnd -->
</body>
</html>