Admin Application Area

From Begrid Wiki
Jump to navigationJump to search

ABINIT

How to build Abinit under Scientific Linux 5.5 ?

The procedure below describes how to build Abinit 6.8.2 under Scientific Linus 5.5. The results of the different build processes will be installed in the software area, whose path is supposed to be /swmgrs/beappss/abinit. These commands should be run on a workernode.

su - beappss
cd /swmgrs/beappss/abinit
mkdir install
mkdir install/gmp-4.3.2
mkdir install/mpfr-2.4.2
mkdir install/gcc-4.4.5
mkdir install/abinit-6.8.2

wget ftp://ftp.gmplib.org/pub/gmp-4.3.2/gmp-4.3.2.tar.bz2
tar xjvf gmp-4.3.2.tar.bz2
cd gmp-4.3.2
./configure --prefix=/swmgrs/beappss/abinit/install/gmp-4.3.2
make
make check
make install
cd..

wget http://www.mpfr.org/mpfr-2.4.2/mpfr-2.4.2.tar.bz2
tar xjvf mpfr-2.4.2.tar.bz2
cd mpfr-2.4.2
./configure --prefix=/swmgrs/beappss/abinit/install/mpfr-2.4.2 --with-gmp=/swmgrs/beappss/abinit/install/gmp-4.3.2
make
make check
make install
cd ..

wget ftp://ftp.irisa.fr/pub/mirrors/gcc.gnu.org/gcc/releases/gcc-4.4.5/gcc-4.4.5.tar.gz
tar xvzf gcc-4.4.5.tar.gz
mkdir gcc-4.4.5-build
cd gcc-4.4.5-build
export LD_LIBRARY_PATH=/swmgrs/beappss/abinit/install/gmp-4.3.2/lib:/swmgrs/beappss/abinit/install/mpfr-2.4.2/lib:$LD_LIBRARY_PATH
../gcc-4.4.5/configure --prefix=/swmgrs/beappss/abinit/install/gcc-4.4.5 --enable-bootstrap --enable-shared --enable-threads=posix --with-system-zlib --enable-languages=c,c++,fortran --with-cpu=generic --with-mpfr=/swmgrs/beappss/abinit/install/mpfr-2.4.2 --with-gmp=/swmgrs/beappss/abinit/install/gmp-4.3.2
make
make install
cd ..

export PATH=/swmgrs/beappss/abinit/install/gcc-4.4.5/bin:$PATH
export LD_LIBRARY_PATH=/swmgrs/beappss/abinit/install/gcc-4.4.5/lib:$LD_LIBRARY_PATH
wget http://ftp.abinit.org/abinit-6.8.2.tar.gz
tar xvzf abinit-6.8.2.tar.gz
cd abinit-6.8.2
./configure --prefix=/swmgrs/beappss/abinit/install/abinit-6.8.2
make
make install

Useful links

Usage

Abinit should be used with the same environment as the one that was set during the build. So, before using Abinit, you should type the following in your shell :

export LD_LIBRARY_PATH=/swmgrs/beappss/abinit/install/gmp-4.3.2/lib:/swmgrs/beappss/abinit/install/mpfr-2.4.2/lib:$LD_LIBRARY_PATH
export PATH=/swmgrs/beappss/abinit/install/gcc-4.4.5/bin:$PATH
export LD_LIBRARY_PATH=/swmgrs/beappss/abinit/install/gcc-4.4.5/lib:$LD_LIBRARY_PATH

Update : how to build Abinit with MPI support ?

In the following procedure, we suppose that you've already build a newer version of gcc as described above. We also suppose that you want to use the openmpi MPI flavour.

# Never build an app as root :
su - beappss

# Remove the previous build
cd /swmgrs/beappss/abinit
mv abinit-6.8.2 abinit-6.8.2_old
tar xvzf abinit-6.8.2.tar.gz

# With these exports, we will use a newer version of gcc than the one that was initially available.
# (We have already built ourself this new version previously.)
export LD_LIBRARY_PATH=/swmgrs/beappss/abinit/install/gmp-4.3.2/lib:/swmgrs/beappss/abinit/install/mpfr-2.4.2/lib:$LD_LIBRARY_PATH
export PATH=/swmgrs/beappss/abinit/install/gcc-4.4.5/bin:$PATH
export LD_LIBRARY_PATH=/swmgrs/beappss/abinit/install/gcc-4.4.5/lib:$LD_LIBRARY_PATH

# Now that we are using a new gcc, we must also build a new MPI
wget http://www.open-mpi.org/software/ompi/v1.4/downloads/openmpi-1.4.3.tar.bz2
tar xjvf openmpi-1.4.3.tar.bz2
mkdir install/openmpi-1.4.3_gcc-4.4.5
cd openmpi-1.4.3
./configure --prefix=/swmgrs/beappss/abinit/install/openmpi-1.4.3_gcc-4.4.5 CC=/swmgrs/beappss/abinit/install/gcc-4.4.5/bin/gcc CXX=/swmgrs/beappss/abinit/install/gcc-4.4.5/bin/g++ F77=/swmgrs/beappss/abinit/install/gcc-4.4.5/bin/gfortran FC=/swmgrs/beappss/abinit/install/gcc-4.4.5/bin/gfortran CPP=/swmgrs/beappss/abinit/install/gcc-4.4.5/bin/cpp
make
make check
make install

# We adapt our environment to use the new MPI we've just built :
export LD_LIBRARY_PATH=/swmgrs/beappss/abinit/install/openmpi-1.4.3_gcc-4.4.5/lib:$LD_LIBRARY_PATH

mkdir install/abinit-6.8.2_mpi
cd abinit-6.8.2/
./configure --prefix=/swmgrs/beappss/abinit/install/abinit-6.8.2_mpi --enable-mpi=yes --with-mpi-prefix=/swmgrs/beappss/abinit/install/openmpi-1.4.3_gcc-4.4.5
make mj4
make install

Useful links

Usage

Abinit should be used with the same environment as the one that was set during the build. So, before using Abinit, you should type the following in your shell :

export LD_LIBRARY_PATH=/swmgrs/beappss/abinit/install/gmp-4.3.2/lib:/swmgrs/beappss/abinit/install/mpfr-2.4.2/lib:$LD_LIBRARY_PATH
export PATH=/swmgrs/beappss/abinit/install/gcc-4.4.5/bin:$PATH
export LD_LIBRARY_PATH=/swmgrs/beappss/abinit/install/gcc-4.4.5/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/swmgrs/beappss/abinit/install/openmpi-1.4.3_gcc-4.4.5/lib:$LD_LIBRARY_PATH


Template:TracNotice