Installation


The following instructions refer to Environ v1.0, for the installation procedure of previous versions of Environ, please go here


The archive of Environ can be downloaded from the this website, from the (soon to be closed) QE-Forge portal or from the public GitLab repository. After extraction of the archive (e.g. 'tar -xzf Environ-1.0.tgz'), the Environ/ directory needs to be placed inside the main directory of the Qauntum ESPRESSO (QE) distribution that requires to be patched. All the following installation steps need to be performed from the main Quantum ESPRESSO directory. 


NOTE: there is an issue with the installation procedure for codes different from pw.x. The problem seems to depend on the compiler, but it is present with the most common Intel Fortran compiler. The solution for this problem requires some more work, which is described here. This issue is going to be fixed in the next releases.

Preliminary steps:
   -1) configure QE following the standard procedure, running
        ./configure 
        should be enough in most cases.
    0) compile QE without the Environ module, e.g. running

    make pw

If there are problems with the preliminary steps, look up for solutions on the PW-forum or refer to the Quantum ESPRESSO documentation and web site http://www.quantum-espresso.org/.

    1) modify the make.inc file generated by ./configure by adding the -D__ENVIRON flag to the MANUAL_DFLAGS variable.
    2) run the QE script addonpatch.sh with the -patch option
          ./install/addsonpatch.sh Environ Environ/src Modules -patch
    3) run the Environ installation script with the -patch option
          ./Environ/patches/environpatch.sh -patch
    4) run the QE script to regenerate modules' dependencies
          ./install/makedeps.sh
    5) re-compile, e.g.
          make all
    6) run executables with -environ flag, e.g.
          pw.x -environ < pw.in > pw.out


Uninstallation


To clean up the compilation with Environ follow these steps:
    1) modify the make.inc file generated by ./configure by removing the -D__ENVIRON flag from the MANUAL_DFLAGS variable.
    2) run the QE script addsonpatch.sh with the -revert option
          ./install/addsonpatch.sh Environ Environ/src Modules -revert
    3) run the Environ installation script with the -revert option
          ./Environ/patches/environpatch.sh -revert
    4) run the QE script to regenerate modules' dependencies
          ./install/makedeps.sh
    5) be sure to remove objects, modules and executables
          make clean