Nektar++

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

Mac OS X - GCC / Xcode



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.

  1. 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++/.)
  2. At the terminal in ThirdParty/, extract the tinyxml_2_4_3.zip archive with
    unzip tinyxml_2_4_3.zip
    This will create tinyxml/.
  3. Extract the loki-0.1.3.tar.bz2 archive with
    tar -xjvf loki-0.1.3.tar.bz2
    This will create loki-0.1.3/.
  4. 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:
    ccmake --version
    If you do not have CMake installed, or the version is too old, then you can build it from source.
    1. In ThirdParty/, extract the cmake-2.8.0.tar.gz archive with
      tar -xzvf cmake-2.8.0.tar.gz
    2. Change to the cmake-2.8.0/ directory, and type
      ./configure
      After configuration is complete, type
      make
  5. In ThirdParty/, extract the zlib-1.2.3.tar.bz2 archive with
    tar -xjvf zlib-1.2.3.tar.bz2
    This will create zlib-1.2.3/.
    1. 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
        Type
        export ZLIB_SOURCE=../../../../zlib-1.2.3
        export NO_BZIP2=0
      • CSH or Tcsh Shells
        Type
        setenv ZLIB_SOURCE ../../../../zlib-1.2.3
        setenv NO_BZIP2 0
  6. The next step is to compile bjam, which will allow for the building and installation of Boost.
    1. In ThirdParty/, extract the boost-jam-3.1.17.tgz archive with
      tar -xzvf boost-jam-3.1.17.tgz
      This will create boost-jam-3.1.17/.
    2. Change to the boost-jam-3.1.17/ directory and type
      ./build.sh
      to build the bjam executable
  7. The next step is to extract and compile the correct libraries for Boost.
    1. In ThirdParty/, extract the boost_1_40_0.tar.bz2 archive with
      tar -xjvf boost_1_40_0.tar.bz2
      This will create boost_1_40_0/.
    2. Change to the boost_1_40_0/ directory, and type
      ../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
      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
  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.9b.tar.bz2 archive with
      tar -xjvf spblastk0.9b.tar.bz2
      This will create the directory spblastk0.9b/.
    2. Change to the directory spblastk0.9b/build/
    3. Compile the library using the previously installed CMake
      1. Generate the makefiles using the command
        ../../cmake-2.8.0/bin/cmake ../
      2. Build and install the library by typing
        make install
  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 with
      tar -xjvf  modmetis-4.0.tar.bz2
      This will create the directory modmetis-4.0/.
    2. Change to the directory modmetis-4.0/build/
    3. Compile the library using the previously installed CMake
      1. Generate the makefiles using the command
        ../../cmake-2.8.0/bin/cmake ../
      2. Build and install the library by typing
        make install
  10. 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.
    1. In ThirdParty/, extract the fftw-3.2.2.tar.gz archive with
      tar -xzvf  fftw-3.2.2.tar.gz
      This will create the directory fftw-3.2.2/.
    2. Change to the directory fftw-3.2.2/
    3. Compile the library using the previously installed CMake
      1. Generate the makefiles using the command
        ./configure --prefix=$PWD
      2. Build and install the library by typing
        make install
  11. 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.
    1. 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)
    2. At the terminal, downaload and install ARPACK typing:
      sudo port install arpack
    3. 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.

  1. From the terminal, change to the directory Nektar++/builds/. This is the directory where the library will be built.
  2. 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
    • 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
  3. 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.

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.

  1. To compile the project, simply type
    make
    from the project directory (i.e. Nektar++/builds/).
    • 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
  2. Type
    make install
    to put all of the compiled libraries into a dist directory that can then be used by the solvers and utilities

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.

  1. From the terminal, change to the build directory of the solvers, i.e. Nektar++/solvers/builds.
  2. 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
    • 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
  3. 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.
  4. Now you have generated the Makefiles, you can compile the solvers by entering
    make
    from the command line in the directory Nektar++/solvers/builds/. If you chose to compile the solvers with Xcode, open the project "SOLVERS.xcodeproj".
  5. The solvers need also installation to be properly used by the regression tests. You can do it by entering
    make install
    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.
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 Makefiles that GCC requires, or the project files that Xcode requires.

  1. From the terminal, change to the build directory of the regressionTests, i.e. Nektar++/regressionTests/builds.
  2. 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
    • 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
  3. 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.
  4. Now you have generated the Makefiles, you can compile the regression tests by typing
    make
    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.
  5. 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.