Configuration ************* Quickstart ========== **Warning** Before a run, the TZ variable must be set always be set to GMT. In bash, do: :: $ export TZ=GMT Create the configuration with :: $ autoreconf --install Configure, compile and create the executable with :: $ ./configure && make install The executable ``pangolin`` is ready to use in the ``bin/`` directory. **Warning** Always compile from the root folder. Configuring for MPI =================== The configure script will use by default ``mpif90`` as a compiler. If you want a different compile, you have to define it with ``--with-compiler=NAME``. Here, the values of ``NAME`` are: ``gfortran``, ``pgf90`` or ``ifort``. If you want to override the search for the compile, you can set the MPI\_DIR variable. Then it will use ``mpif90`` and ``mpirun`` defined in this folder as compiler and script. Example : :: $ ./configure MPI_DIR=/usr/lib64/openmpi/bin However, you have to set manually the MPI library with LD\_LIBRARY\_FLAGS (see ?). Another solution is to add the location of the MPI executables to your PATH (see `below <#select_mpi>`__). How the script select the proper MPI/compiler version ----------------------------------------------------- If you have supplied a compiler to search, the configure script will find for all MPI compilers. Each one of them will be run with the ``-show`` option (so it needs to support it). The result will be compared to ``ifort``, ``pgf90``, ``gfortran``. If no compiler is specified or nothing is found, then we will try default mpi scripts : ``mpif90`` and ``mpiifort``. As they cannot be set in the PATH (for example if you use module), we check if they exist by running it with the ``-show`` option. We stop at the first found. This case is for special configurations where you source a configuration file. You can find quickly all your mpi executables with the command :: $ locate mpif90 mpiifort Configuring for HDF5 ==================== By default, the script search for the HDF5 helper script (namely ``h5fc`` or ``h5pfc``). If they are not in a standard location, the easiest way is to tell the configure script the location of ``h5fc``: :: $ ./configure HDF5_BINDIR=/yourpath/bin The script will check we can link to HDF5 and, if available, to its parallel version. We link only to the shared libraires of HDF5, so be sure they are installed ! By default, the compilation and link flags are given by: :: $ h5fc -show -shlib Custom configuration -------------------- If you do not want to use the ``h5fc`` utiliy, you can specify the HDF5 folder with the HDF5\_DIR variable. The include and libraries location are then ``HDF5_DIR/include`` and ``HDF5_DIR/lib``. It also reverts back to default compilation and linking flags, so know what you are doing. You can add compilation flags with HDF5\_FLAGS. It can be useful to set alternative locations for the HDF5 module files for example. On my machine (Pannus), I use: :: $ export HDF5_DIR=/usr/lib64/openmpi/ $ ./configure HDF5_FLAGS=" -I/usr/include/openmpi-x86_64/" This allows me to set the HDF5 directory (containing the libs and executables), while adding a custom path to find the HDF5 fortran module. If you want to search it, try :: $ locate hdf5.mod If there are several installations of HDF5, I encourage you to search for the file ``libhdf5.settings``. It will give you the install configuration: compiler used, if it has shared librairies, if it has parallel support etc. Configuring for netCDF ====================== By default, the script search for the netCDF helper script (namely ``nf-config``). If they are not in a standard location, the easiest way is to tell the configure script the location of ``nf-config``: :: $ ./configure NETCDF_FDIR=/yourpath/bin The script will check we can compile with and link to netCDF. By default, the compilation and link flags are given by: :: $ nf-config -fflags $ nf-config -flibs If the script fails to compile a simple netCDF example, it may be due to the location of the ``.mod`` file. In this case, you can specify a search directory. For example, on my machine (Pannus), I do: :: $ ./configure NETCDF_INCDIR=/usr/lib64/gfortran/modules As a last resort, compilation flags and linking flags can be set by hand with: :: $ ./configure NETCDF_FCFLAGS="compil flags" NETCDF_FLIBS="link flags" Managing different netCDf versions ---------------------------------- If you have several installations of netCDF and the default search does not return the proper version, you can desactivate the search. For that, simply set NETCDF\_FCFLAGS and NETCDF\_FLIBS by hand. The values are often given by ``nf-config --fflabgs`` and ``nf-config --fflibs`` for the latest version. Otherwise, check similar options for ``nc-config``. Here is an example: :: $ ./configure NETCDF_FCFLAGS=-I/usr/include NETCDF_FLIBS="-L/usr/lib -lnetcdff -lnetcdf" Examples ======== On Neptune ---------- On neptune, Pangolin can be configured with parallel HDF5 and netCDF with : :: $ export NETCDF_FLIBS="-Wl,-rpath,/softs/local/lib -L/softs/local/lib -lnetcdff -lnetcdf" $ export NETCDF_FCFLAGS=-I/softs/local/include NETCDF_FLIBS="-Wl,-rpath,/softs/local/lib -L/softs/local/lib -lnetcdff -lnetcdf" $ ./configure HDF5_BINDIR=/softs/PHDF5-1.8.9/bin/ --with-compiler=ifort Unfortunately, netCDF flags must be set by hands (both compilation and linking flags). However, HDF5 flags are set automatically by simply setting the location of the executables. On Airain --------- Load the necessary modules: :: $ module load hdf5/1.8.9_parallel $ module load netcdf/4.2_hdf5_parallel Then configure and compile: :: $ ./configure --with-compiler=ifort && make install On Pannus --------- We use a custom HDF5 install and we have to specify the location of ``netcdf.mod`` by hand: :: $ ./configure NETCDF_INCDIR=/usr/lib64/gfortran/modules/ HDF5_INCDIR=/usr/include/mpich-x86_64 On Vortex --------- :: $ module purge $ module load mpich2-x86_64 $ ./configure HDF5_INCDIR=/usr/include/mpich2-x86_64/