User Tools

Site Tools


playground:gadgetwalkthrough
Gadget Compilation Walkthrough

This page describes how to compile your own Gadget and libraries at CHPC. Before doing anything it is recommended that you create an installation directory (e.g installations) on your /export/home/username/ directory. This will help you avoid any super user conflicts. For the rest of this walkthrough I will refer to /export/home/username/installations/ as PATHINSTALL.

  • Prerequisites
  • First, add these lines in your startup file .profile:
    . /etc/profile.d/modules.sh
    module load sunstudio
    module load clustertools 

These lines will help you to load openmpi and other tools that are required to compile and run Gadget. It is also recommended to add them to your job script.

  • Compile GSL by following these steps:
    • ./configure –prefix=/PATHINSTALL
    • make
    • make install
  • Compile FFTW-2.1.5 by following these steps:
    • ./configure –prefix=/PATHINSTALL –enable-type-prefix –enable-mpi
    • make
    • make install
    • make clean
    • ./configure –prefix=/PATHINSTALL –enable-float –enable-type-prefix –enable-mpi
    • make
    • make install

Note that only FFTW-2.xx can be used because version 3.xx does not work with Gadget2.

  • Compile HDF5 by following these steps:

First build SZIP by following these steps

  • ./configure –prefix=/PATHINSTALL –enable-shared=no –enable-static=yes
  • make
  • make install

After building SZIP build HDF5 by following these steps

  • ./configure -prefix=/PATHINSTALL
  • make
  • make install

Note that you need to use HDF5 version 1.6.x to avoid the latest changes in the HDF5 API.

  • Now compile GADGET by following the following steps:
    • Find the Makefile and add the “CHPC” SYSTYPE on the list of SYSTYPEs listed and add this code
       
      ifeq ($(SYSTYPE),"CHPC")
      CC       =  mpicc
      OPTIMIZE =  -O3
      GSL_INCL =  -I/PATHINSTALL/include
      GSL_LIBS =  -L/PATHINSTALL/lib  -Wl,"-R /PATHINSTALL/lib"
      FFTW_INCL=  -I/PATHINSTALL/include
      FFTW_LIBS=  -L/PATHINSTALL/lib
      MPICHLIB =
      HDF5INCL =  -I/PATHINSTALL/include
      HDF5LIB  =  -L/PATHINSTALL/lib -lhdf5
      endif
  • make

GADGET is now compiled and you can test it by using one of the examples that come with Gadget download. You can also download a pdf version of this walkthrough here

/var/www/wiki/data/pages/playground/gadgetwalkthrough.txt · Last modified: 2013/01/30 13:28 by jabu_v