Install Yambo on Ubuntu/LinuxMint: Difference between revisions

From The Yambo Project
Jump to navigation Jump to search
No edit summary
m (Removed patch level)
 
(19 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Here we can find the instruction to install Yambo 5.0 on a standard machine with a [https://ubuntu.com/ Ubuntu]/[https://linuxmint.com/ LinuxMint] distribution.
Here we can find the instruction to install Yambo 5.1 on a standard machine with a [https://ubuntu.com/ Ubuntu]/[https://linuxmint.com/ LinuxMint] distribution.


We suppose you have root permission on your machine
We suppose you have root permission on your machine to install all the required packages.
 
Run apt-get to update the package list


Run apt-get to install the required packages:
  apt-get -yqq update  
  apt-get -yqq update  


  apt-get -yqq install --no-install-recommends
Install compilers, python, mkl, and all necessary libraries to compile Yambo:
        build-essential ca-certificates curl file \
 
         make gcc g++ gfortran \
  apt-get install build-essential ca-certificates curl file \
        git gnupg2 iproute2 lmod \
         make gcc g++ gfortran git gnupg2 iproute2 \
         locales lua-posix \
         unzip m4 wget git zlib1g-dev ssh \
        python3 python3-pip python3-setuptools \
        libmkl-avx libmkl-avx2 libmkl-avx512 libmkl-core libmkl-def \
        tcl unzip m4 wget git zlib1g-dev ssh \
        libmkl-dev libmkl-gf-ilp64 libmkl-gf-lp64 libmkl-gnu-thread
libmkl-gf-lp64 libmkl-gnu-thread libmkl-avx libmkl-avx2 libmkl-avx512 libmkl-core libmkl-def libmkl-dev libmkl-gf-ilp64 \
  && apt-get clean \
  && locale-gen en_US.UTF-8
download lastest Yambo release, in this case the 5.1.1:
 
wget https://github.com/yambo-code/yambo/archive/5.1.1.tar.gz -O yambo-5.1.1.tar.gz
 
decompress the file
 
  tar zxfv yambo-5.1.1.tar.gz && cd yambo-5.1.1
 
configure Yambo
 
./configure --disable-mpi --enable-open-mp \
  --enable-slepc-linalg --disable-hdf5-par-io \
  --enable-msgs-comps --enable-time-profile --enable-memory-profile \
  --with-blas-libs="-L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl" \
  --with-lapack-libs="-L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl"
 
compile the code (where -j4 means that the code is compiled in parallel on 4 cores):
 
  make -j4 core
 
The compilation was successful if there are the yambo executables in the <code>bin/</code> directory.
 
From now the instructions are optional but suggested! You may need sudo privileges to install Yambo in a system directory, otherwise install it in your home space. 
 
Create a folder to install code and libraries:
 
mkdir -p /usr/local/yambo-5.1.1/lib
 
copy code and libraries in Yambo folder:
 
cp -r bin /usr/local/yambo-5.1.1/
cp -r lib/external/*/*/lib/*.* /usr/local/yambo-5.1.1/lib/
cp -r lib/external/*/*/v4/serial/lib/*.* /usr/local/yambo-5.1.1/lib/
 
you can remove the tar.gz file and the Yambo folder (optional):
 
  cp ..
  rm -rf yambo-5.1.1 yambo-5.1.1.tar.gz
 
set the path to the Yambo bin folder, for tcsh/csh:
 
setenv PATH=/usr/local/yambo-5.1.1/bin:$PATH
setenv LD_LIBRARY_PATH=/usr/local/yambo-5.1.1/lib:$LD_LIBRARY_PATH
 
or in bash:
 
export PATH=/usr/local/yambo-5.1.1/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/yambo-5.1.1/lib:$LD_LIBRARY_PATH
 
you are ready to use Yambo!!!!
 
<br>
'''Optional for developers'''
 
you can copy also the include files:
 
mkdir -p /usr/local/yambo-5.1.1/include
cp -r lib/external/*/*/include/*.* /usr/local/yambo-5.1.1/include/
  cp -r lib/external/*/*/v4/serial/include/*.* /usr/local/yambo-5.1.1/include/ 
 
and can add to the configure the following lines:
 
export YAMBO_LIBS=/usr/local/yambo-5.1.1


WORKDIR /tmpdir
and use the following options in the configure:


### YAMBO ###
--with-iotk-path="${YAMBO_LIBS}" --with-libxc-path="${YAMBO_LIBS}" --with-hdf5-path="${YAMBO_LIBS}" --with-netcdf-path="${YAMBO_LIBS}" --with-netcdff-path="${YAMBO_LIBS}" \
ARG yambo_version=5.0.0
  --with-petsc-path="${YAMBO_LIBS}" --with-slepc-path="${YAMBO_LIBS}"
RUN wget https://github.com/yambo-code/yambo/archive/${yambo_version}.tar.gz -O yambo-${yambo_version}.tar.gz \
  && tar zxf yambo-${yambo_version}.tar.gz && cd yambo-${yambo_version} \
&& ./configure --disable-mpi --enable-open-mp --enable-msgs-comps --enable-time-profile --enable-memory-profile \
    --with-blas-libs="-L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl" \
    --with-lapack-libs="-L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl" \
&& make -j4 yambo && make -j4 interfaces && make -j4 ypp \
&& mkdir -p /usr/local/yambo-${yambo_version}/lib \
  && cp -r bin /usr/local/yambo-${yambo_version}/. \
&& cp -r lib/external/*/*/lib/*.* /usr/local/yambo-${yambo_version}/lib/. \
&& cp -r lib/external/*/*/v4/serial/lib/*.* /usr/local/yambo-${yambo_version}/lib/. \
&& cd .. && rm -rf yambo-${yambo_version} yambo-${yambo_version}.tar.gz


ENV PATH=/usr/local/yambo-${yambo_version}/bin:$PATH \
so the next time you recompile yambo from scrach it will not recompile the libraries.
    LD_LIBRARY_PATH=/usr/local/yambo-${yambo_version}/lib:$LD_LIBRARY_PATH

Latest revision as of 17:12, 4 November 2024

Here we can find the instruction to install Yambo 5.1 on a standard machine with a Ubuntu/LinuxMint distribution.

We suppose you have root permission on your machine to install all the required packages.

Run apt-get to update the package list

apt-get -yqq update 

Install compilers, python, mkl, and all necessary libraries to compile Yambo:

apt-get install build-essential ca-certificates curl file \
       make gcc g++ gfortran git gnupg2 iproute2 \
       unzip m4 wget git zlib1g-dev ssh \
       libmkl-avx libmkl-avx2 libmkl-avx512 libmkl-core libmkl-def \
       libmkl-dev libmkl-gf-ilp64 libmkl-gf-lp64 libmkl-gnu-thread


download lastest Yambo release, in this case the 5.1.1:

wget https://github.com/yambo-code/yambo/archive/5.1.1.tar.gz -O yambo-5.1.1.tar.gz 

decompress the file

tar zxfv yambo-5.1.1.tar.gz && cd yambo-5.1.1 

configure Yambo

./configure --disable-mpi --enable-open-mp \
  --enable-slepc-linalg --disable-hdf5-par-io \
  --enable-msgs-comps --enable-time-profile --enable-memory-profile \
  --with-blas-libs="-L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl" \
  --with-lapack-libs="-L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl" 

compile the code (where -j4 means that the code is compiled in parallel on 4 cores):

 make -j4 core

The compilation was successful if there are the yambo executables in the bin/ directory.

From now the instructions are optional but suggested! You may need sudo privileges to install Yambo in a system directory, otherwise install it in your home space.

Create a folder to install code and libraries:

mkdir -p /usr/local/yambo-5.1.1/lib 

copy code and libraries in Yambo folder:

cp -r bin /usr/local/yambo-5.1.1/ 
cp -r lib/external/*/*/lib/*.* /usr/local/yambo-5.1.1/lib/ 
cp -r lib/external/*/*/v4/serial/lib/*.* /usr/local/yambo-5.1.1/lib/ 

you can remove the tar.gz file and the Yambo folder (optional):

 cp ..
 rm -rf yambo-5.1.1 yambo-5.1.1.tar.gz

set the path to the Yambo bin folder, for tcsh/csh:

setenv PATH=/usr/local/yambo-5.1.1/bin:$PATH 
setenv LD_LIBRARY_PATH=/usr/local/yambo-5.1.1/lib:$LD_LIBRARY_PATH

or in bash:

export PATH=/usr/local/yambo-5.1.1/bin:$PATH 
export LD_LIBRARY_PATH=/usr/local/yambo-5.1.1/lib:$LD_LIBRARY_PATH

you are ready to use Yambo!!!!


Optional for developers

you can copy also the include files:

mkdir -p /usr/local/yambo-5.1.1/include
cp -r lib/external/*/*/include/*.* /usr/local/yambo-5.1.1/include/ 
cp -r lib/external/*/*/v4/serial/include/*.* /usr/local/yambo-5.1.1/include/  

and can add to the configure the following lines:

export YAMBO_LIBS=/usr/local/yambo-5.1.1

and use the following options in the configure:

--with-iotk-path="${YAMBO_LIBS}"  --with-libxc-path="${YAMBO_LIBS}" --with-hdf5-path="${YAMBO_LIBS}" --with-netcdf-path="${YAMBO_LIBS}" --with-netcdff-path="${YAMBO_LIBS}" \
--with-petsc-path="${YAMBO_LIBS}" --with-slepc-path="${YAMBO_LIBS}"

so the next time you recompile yambo from scrach it will not recompile the libraries.