User Tools

Site Tools


tips:building_abinit

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Last revisionBoth sides next revision
tips:building_abinit [2013/07/04 18:01] – external edit 127.0.0.1tips:building_abinit [2014/01/22 17:22] Yann Pouillon
Line 1: Line 1:
 +====== Tips and tricks ======
 +
 +===== How to link netCDF 4 with Abinit =====
 +
 +First create a directory where you are going to store all you libraries. It is common to create this directory under /local/name_of_the_compiler. In my case I want to compile using Intel 13 compiler and therefore I will issue:
 +
 +<code>
 +cd local
 +mkdir Intel13
 +</code>
 +
 +  - **Install zlib** \\ Go on the Zlib website [[http://zlib.net/|http://zlib.net/]] and download the latest version and then untar it e.g.: <code>
 +wget http://zlib.net/zlib-1.2.8.tar.gz
 +tar -xvf zlib-1.2.8.tar.gz
 +</code> Then go into the folder and issue: <code>
 +./configure --prefix='/home/ucl/naps/sponce/local/Intel13'
 +make 
 +make install
 +</code>
 +  - **Install HDF5** \\ Go on the HDF5 website [[http://www.hdfgroup.org/HDF5/]] and download it, e.g.:<code>
 +wget http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.11.tar
 + tar -xvf hdf5-1.8.11.tar
 +</code> Then go into the folder and issue:<code>
 +./configure --with-zlib=/home/ucl/naps/sponce/local/Intel13 --prefix=/home/ucl/naps/sponce/local/Intel13 --enable-fortran --enable-cxx
 +make 
 +make install
 +</code>
 +  - **Install netCDF4** \\ Go on the netcdf4 website [[http://www.unidata.ucar.edu/downloads/netcdf/netcdf-4_0/index.jsp]] and download it, e.g. :<code>
 +wget http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.1.3.tar.gz
 +tar -xvf netcdf-4.1.3.tar.gz
 +</code> Because the --with-hdf5= option does not work for necdf-4.1.3, you will need to export HDF5 location paths as follows: <code>
 +export CPPFLAGS=-I/home/ucl/naps/sponce/local/Intel13/include/
 +export LDFLAGS=-L/home/ucl/naps/sponce/local/Intel13/lib
 +export LD_LIBRARY_PATH=/home/ucl/naps/sponce/local/Intel13/lib
 +export FC=ifort
 +export CC=icc
 +</code>Then issue:<code>
 +./configure --enable-netcdf4 --prefix=/home/ucl/naps/sponce/local/Intel13  --enable-dap --enable-shared
 +make 
 +make install
 +</code>
 +  - **Install Abinit with netCDF4**\\ Be careful if you have set flags into you .ac file. You should unset the variable first: <code>
 +unset FC
 +unset CC
 +</code> You should then add the following lines into your .ac configuration file:<code>
 +with_netcdf_incs="-I/home/ucl/naps/sponce/local/Intel13/include"
 +with_netcdf_libs="-L/home/ucl/naps/sponce/local/Intel13/lib -lnetcdf -lnetcdff"
 +with_trio_flavor="netcdf+etsf_io"
 +</code> Then you should make a build directory into Abinit and issue: <code>
 +../configure --with-config-file='./name_of_your_ac_file.ac'
 +make mj4
 +</code>
 +
 +
 +
 +
 +
 +
 +
  
tips/building_abinit.txt · Last modified: 2017/05/24 11:30 by Matthieu Verstraete