Compile Instructions
Mac OS X - GCC / Xcode
-
Setting up GCC
-
Organizing the ThirdParty Source Files
-
Generating the GCC Makefiles with CMake
-
Compiling the library
-
Compiling the Solvers and Utilities
-
Compiling the Regression Tests
Setting up GCC
In order to compile Nektar++, you must have GCC installed. The GCC compiler comes with Apple's XCode package. You can download this from http://connect.apple.com/ (you are required to have an Apple Developer Connection account).
Organizing the ThirdParty Source Files
You will be given a Nektar++ directory and a ThirdParty 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.
- Unpack the ThirdParty-3.x.x.tar.gz file. Rename the resulting directory to ThirdParty/ and put it in Nektar++/. (This will mean library/ and ThirdParty/ are both sub-directories of the original Nektar++/.)
- At the terminal in ThirdParty/, extract the tinyxml_2_4_3.zip archive with
This will create tinyxml/.
unzip tinyxml_2_4_3.zip
- Extract the loki-0.1.3.tar.bz2 archive with
This will create loki-0.1.3/.
tar -xjvf loki-0.1.3.tar.bz2
- CMake is an open-source, cross-platform make file
generator system. We require version 2.8 or greater. To check your
currently installed version, type the following at the command line:
If you do not have CMake installed, or the version is too old, then you can build it from source.
ccmake --version
- In ThirdParty/, extract the cmake-2.8.0.tar.gz archive with
tar -xzvf cmake-2.8.0.tar.gz
- Change to the cmake-2.8.0/ directory, and type
After configuration is complete, type
./configure
make
- In ThirdParty/, extract the cmake-2.8.0.tar.gz archive with
- In ThirdParty/, extract the zlib-1.2.3.tar.bz2 archive with
This will create zlib-1.2.3/.
tar -xjvf zlib-1.2.3.tar.bz2
- You must set the ZLIB_SOURCE and NO_BZIP2 environment variables in order to tell Boost (step 7) to use zlib and not bzip2.
- Bash or KSH Shells
Typeexport ZLIB_SOURCE=../../../../zlib-1.2.3
export NO_BZIP2=0 - CSH or Tcsh Shells
Typesetenv ZLIB_SOURCE ../../../../zlib-1.2.3
setenv NO_BZIP2 0
- Bash or KSH Shells
- You must set the ZLIB_SOURCE and NO_BZIP2 environment variables in order to tell Boost (step 7) to use zlib and not bzip2.
- The next step is to compile bjam, which will allow for the building and installation of Boost.
- In ThirdParty/, extract the boost-jam-3.1.17.tgz archive with
This will create boost-jam-3.1.17/.
tar -xzvf boost-jam-3.1.17.tgz
- Change to the boost-jam-3.1.17/ directory and type
to build the bjam executable
./build.sh
- In ThirdParty/, extract the boost-jam-3.1.17.tgz archive with
- The next step is to extract and compile the correct libraries for Boost.
- In ThirdParty/, extract the boost_1_40_0.tar.bz2 archive with
This will create boost_1_40_0/.
tar -xjvf boost_1_40_0.tar.bz2
- Change to the boost_1_40_0/ directory, and
type
This will generate both static and dynamic libraries and place them, along with the include files, in the correct path. (Note: that for a 64 bit operating system, such as Mac OSX 10.6, it may be necessary to use "../boost-jam-3.1.17/bin.macosxx86_64/bjam" instead of "../boost-jam-3.1.17/bin.macosxx86/bjam"). 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
../boost-jam-3.1.17/bin.macosxx86/bjam --prefix=../boost --build-type=complete --with-thread --with-iostreams --with-test --with-date_time --with-filesystem --with-system --layout=versioned --link=shared --toolset=darwin install
- In ThirdParty/, extract the boost_1_40_0.tar.bz2 archive with
- 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.9b.tar.bz2 archive with
This will create the directory spblastk0.9b/.
tar -xjvf spblastk0.9b.tar.bz2
- Change to the directory spblastk0.9b/build/
- Compile the library using the previously installed CMake
- Generate the makefiles using the command
../../cmake-2.8.0/bin/cmake ../
- Build and install the library by typing
make install
- In ThirdParty/, extract the
spblastk0.9b.tar.bz2 archive with
-
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 with This will create the directory modmetis-4.0/.
tar -xjvf modmetis-4.0.tar.bz2
- Change to the directory modmetis-4.0/build/
- Compile the library using the previously installed CMake
- Generate the makefiles using the command
../../cmake-2.8.0/bin/cmake ../
- Build and install the library by typing
make install
-
In ThirdParty/, extract the modmetis-4.0.tar.bz2 archive with
-
In case you want to use the Quasi-3D approach in combination with the FFT algorithm, you also need
to compile the FFTW library. The use of the FFT algorithm is suggested in case of a large number of
degrees of freedom in the homogeneous direction (10 or more).
(For more information about the original FFTW library, see http://www.fftw.org)
By default the FFTW routines are not in use, you need to compile the FFTW library and switch it
on before to build up the Nektar++ library.
-
In ThirdParty/, extract the fftw-3.2.2.tar.gz archive with This will create the directory fftw-3.2.2/.
tar -xzvf fftw-3.2.2.tar.gz
- Change to the directory fftw-3.2.2/
- Compile the library using the previously installed CMake
- Generate the makefiles using the command
./configure --prefix=$PWD
- Build and install the library by typing
make install
-
In ThirdParty/, extract the fftw-3.2.2.tar.gz archive with
-
In case you need to evaluate the eigenvalues and
eigenvectors, it is possile to complile
the ARPACK library. ARPACK uses Implicit Restarted Arnoldi Algorithm
and it is able to solve the large-scale eigenvalues problems in a wide
range of cases(for more information about the ARPACK, see http://www.caam.rice.edu/software/ARPACK/).
By default the ARPACK routines are not in use, you need to compile the ARPACK library and switch it
on before to build up the Nektar++ library.
- The easiest and fastest way to compile ARPACK in OSX Systems is using Macports,a free/open source software that simplifies the installation of packages on the Mac OS X and Darwin operating systems. It is possible to install easily Macports following the instructions on http://www.macports.org/install.php)
-
At the terminal, downaload and install ARPACK typing:
sudo port install arpack
- ARPACK libraries are now installed in your machines in the folder /opt/local/lib
Generating the GCC Makefiles with CMake
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.
- From the terminal, change to the directory Nektar++/builds/. This is the directory where the library will be built.
- CMake can generate both GCC Makefiles, or Xcode project files.
- GCC Makefiles
- Type in
../ThirdParty/cmake-2.8.0/bin/cmake -i ../library/
- The "-i" indicates that you want to use the wizard mode.
- Would you like to see advanced options? No
- Type in
- Xcode Project Files
- Type in
../ThirdParty/cmake-2.8.0/bin/cmake -i -G Xcode ../library/
- The "-i" indicates that you want to use the wizard mode.
- Would you like to see advanced options? No
- Type in
- GCC Makefiles
- 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 ThirdParty/,
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.
- CMAKE_BUILD_TYPE
- 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.
- CMAKE_BUILD_TYPE
Compiling the library
Now that CMake generated the appropriate Makefiles, it can be compiled with GCC. If you chose to generate a Xcode project, you can open Nektar++.xcodeproj/ now, and skip the GCC instructions below.
- To compile the project, simply type from the project directory (i.e. Nektar++/builds/).
make
- If you have multiple processors/cores, it might be
beneficial to use The "-j" options starts that many jobs, so all of the processors will be utilized, and it will compile faster
make -j <num_procs/cores>
- If you have multiple processors/cores, it might be
beneficial to use
- Type to put all of the compiled libraries into a dist directory that can then be used by the solvers and utilities
make install
Compiling the Solvers and Utilities
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. Nektar++/Builds/dist)
Once again we use CMake to generate the Makefiles that GCC requires, or the project files that Xcode requires.
- From the terminal, change to the build directory of the solvers, i.e. Nektar++/solvers/builds.
- CMake can generate both GCC Makefiles, or Xcode project files.
- GCC Makefiles
- Type in
../../ThirdParty/cmake-2.8.0/bin/cmake -i ../
- The "-i" indicates that you want to use the wizard mode.
- Would you like to see advanced options? No
- Type in
- Xcode Project Files
- Type in
../../ThirdParty/cmake-2.8.0/bin/cmake -i -G Xcode ../
- The "-i" indicates that you want to use the wizard mode.
- Would you like to see advanced options? No
- Type in
- GCC Makefiles
- 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 ThirdParty/, 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.
- CMAKE_BUILD_TYPE
- 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.
- CMAKE_BUILD_TYPE
- Now you have generated the Makefiles, you can compile the solvers by entering
from the command line in the directory Nektar++/solvers/builds/. If you chose to compile the solvers with Xcode, open the project "SOLVERS.xcodeproj".
make
- The solvers need also installation to be properly used by the regression tests. You can do it by entering
from the command line in the directory Nektar++/solvers/builds/. It will create a new directory Nektar++/solvers/builds/dist/bin/ where all the solvers executables are collected.
make install
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 Makefiles that GCC requires, or the project files that Xcode requires.
- From the terminal, change to the build directory of the regressionTests, i.e. Nektar++/regressionTests/builds.
- CMake can generate both GCC Makefiles, or Xcode project files.
- GCC Makefiles
- Type in
../../ThirdParty/cmake-2.8.0/bin/cmake -i ../
- The "-i" indicates that you want to use the wizard mode.
- Would you like to see advanced options? No
- Type in
- Xcode Project Files
- Type in
../../ThirdParty/cmake-2.8.0/bin/cmake -i -G Xcode ../
- The "-i" indicates that you want to use the wizard mode.
- Would you like to see advanced options? No
- Type in
- GCC Makefiles
- 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 ThirdParty/,
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.
- CMAKE_BUILD_TYPE
- 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.
- CMAKE_BUILD_TYPE
- Now you have generated the Makefiles, you can compile the regression tests by typing
from the command line in any of the sub-directories of the current build location. For example to compile the regression tests for Demos/StdRegions, move to this directory and type
make
This will generate an executable called StdRegionsDemoTest. Executing this file will run a series of demos located in the Nektar++/library/Demos/StdRegions directory and check them against known solutions for these demos.make
- If you are modifying the regression tests by adding or removing tests you can generate a new master ".ok" file by answering No to the "Would you like to see advanced options?" in step 2 and 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.
The entire Nektar++ package should now have been succesfully compiled. Instructions on how to use Nektar++ are described on the usage page.