WIEN2k configuration on Debian GNU/Linux

When you purchase a WIEN2k license you can install the compiled binaries or you can compile from source. The documentation says that the code will be better optimized by being compiled on your hardware. For those of us who run Debian GNU/Linux and don't have the Intel ifort compiler, gfortran can also be used. This is a guide to compiling on the buster/stable distribution.

Minimum installation

The packages that are needed for compilation depend on how many of the options you wish to take advantage of. The minimum installation is for straight line execution and requires the following packages and their dependencies:

tcsh
gfortran
libopenblas-base
automake
perl

As root execute the following commands to set up for compilation and start the configuration:

# mkdir /usr/local/wien2k
# cd /usr/local/wien2k
# tar -xfv /path/to/WIEN2k_19.2.tar
# gunzip *.gz
# ./expand_lapw
# ./siteconfig_lapw

When configuring, select the LG option for Linux+gfortran then set the following options

f90 compiler: gfortran
C compiler: gcc
R_LIBS: /usr/lib/x86_64-linux-gnu/libopenblas.so.0

Full compilation without MPI

These additional libraries are not required but what the heck, let's be complete! Install the following additional packages with their dependencies:

libxc-dev
libfftw3-dev

In the LIBXC section select manual configuration and answer the questions as below but note that you can always change these values later either with the X command or manually editing the variables below in the WIEN2k_OPTIONS file. NOTE: if you make a change to the WIEN2k_OPTIONS file you will need to enter the options (O) menu in the siteconfig_lapw program and then save (S) them to reconfigure the sources to the changed variables.

Root directory: /usr/    LIBXCROOT
Library directory: lib/x86_64-linux-gnu/    LIBXC_LIBDNAME
Fortran library name: xcf03    LIBXC_FORTRAN
Library nameLIBXC_LIBNAME: xc    LIBXC_LIBNAME

In the FFTW section select manual configuration and answer the questions as below but note that you can always change these values later either with the X command or manually editing the variables below in the WIEN2k_OPTIONS file. NOTE: if you make a change to the WIEN2k_OPTIONS file you will need to enter the options (O) menu in the siteconfig_lapw program and then save (S) them to reconfigure the sources to the changed variables.

Root directory: /usr/    FFTWROOT
Library version: FFTW3    FFTW_VERSION
Library directory: lib/x86_64-linux-gnu    FFTW_FORTRAN
Library name: fftw3    FFTW_LIBNAME

Compilation for parallel execution

If you want to compile for parallel execution with openmpi, you will need to include non-free sources to get one of the Intel MKL libraries. Install the following packages and their dependencies:

libfftw3-mpi-dev
libscalapack-openmpi-dev
libmkl-blacs-openmpi-ilp64
libmkl-dev

The libelpa-dev package brings in the Intel MLK libraries which must be configured to replace the open source libraries we have installed previously (BLAS and LAPACK. If this is not done, the compilation will fail.

During this configuration, answer the following. It is also possible to change your configuration from the options menu before compiling and, as before, some of these answers can be changed by manually editing the variables below in the WIEN2k_OPTIONS file. NOTE: if you make a change to the WIEN2k_OPTIONS file you will need to enter the options (O) menu in the siteconfig_lapw program and then save (S) them to reconfigure the sources to the changed variables.

Parallel f90 compiler: mpif90   
ScaLAPACK target architecture: lib/x86_64-linux-gnu    MKL_TARGET_ARCH
ScaLAPACK root path: /usr/    SCALAPACKROOT
ScaLAPACK library name: scalapack-openmpi    SCALAPACK_LIBNAME
BLACS root path: /usr/    BLACSROOT
BLACS library name: mkl_blacs_openmpi_ilp64    SCALAPACK_LIBNAME
Parallel libraries for gfortran: scalapack-openmpi    RP_LIBS
ScaLAPACK library name: scalapack-openmpi    SCALAPACK_LIBNAME

The optional ELPA libraries available in Debian (version 4 from 2016) are not compatible with WIEN2k and cannot be compiled against the newer version available in the experimental Debian distribution may work but requires installation of newer versions of other openmpi packages which might not be compatible with the buster/stable distribution. At the moment, it is wiser to leave this out.

Last bits before compiling

The configuration program will ask you for the location of the perl interpreter and the tmp directory for temporary files. Before compiling, you can re-enter a number of the settings and adjust the configuration as needed (number of processors and so on).

If the compilation completed without errors, you can now install additional packages and follow the rest of the instructions found in this presentation on WIEN2k installation.

ghostscript
python
python-numpy
xpdf/okular
octave
xcrysden

After this system setup, each user needs to run the /usr/local/wien2k/userconfig_lapw to setup environment variables used in running WIEN2k.

Structure vizualization via the web server interface

The easiest way to use WIEN2k is through its web interface w2web. One of the features of this interface is that it is possible to launch xcrysden. This requires that you be on a computer which has XWindows capability. All Linux systems have this built in and it is possible to get this capability on MacOS and Windows as described below. In addition, to make this work, the system on which WIEN2k is installed must have the following settings in the /etc/ssh/sshd_config file:

X11Forwarding yes

It is also necessary to have the following environment variables set in your account's .bashrc initialization file on the WIEN2k server since they are not automatically inserted by the /usr/local/wien2k/userconfig_lapw program that each user runs to set up for WIEN2k operation. The first three are necessary for any client system and the last is specifically needed if you intend to use Windows clients.

export XCRYSDEN_TOPDIR=/usr/share/xcrysden
export XCRYSDEN_LIB_BINDIR=/usr/lib/xcrysden
export XCRYSDEN_SCRATCH=/tmp

Finally, in order to be most compatible with all client operating systems, it is necessary to delete line number 483 in the /usr/share/xcrysden/Viewer.tcl which reads

-accum          true \

Notes for running various client operating systems

WIEN2k can be run from its web interface, w2web using a variety of client operating systems but visualization requires XWindows compatibility and, most importantly, an active secure shell connection through which WIEN2k transmits the xcrysden graphics. There are a few steps required to make this work for each different operating system.

Linux

All software needed is generally installed by default in a modern Linux system. The important requirement is to enable X11 forwarding. This can be done for the entire system by the following settings in the /etc/ssh/ssh_config file:

ForwardAgent yes
ForwardX11 yes
ForwardX11Trusted yes

Alternatively, you can make a specific connection with X11 Forwarding enabled by executing ssh -X user@system.

Windows

An XWindows Server must be installed on the Microsoft Windows client in order to view the crystal structure. Xming is a good option which can be obtained free of charge for the 6.9.0.31 version. Make sure to install both the Xming-mesa and Xming-fonts packages and make sure that the X-Server is running before you attempt to start any visualizations.

In addition you will need to install an ssh client, PuTTY is an excellent choice.

Once installed, PuTTY needs to be configured with the following options which if saved in a named session, makes sure that your commection is always set up properly.

Category    Option    Value

Session    Host Name    IP Address
Connection    Seconds between keepalives    30
Connection    Enable TCP keepalives   
SSH:X11    Enable X11 forwarding   

MacOS

MacOS is based on System V Unix and as such has ssh natively available, however, it uses it's own proprietary window manager instead of the X11 protocol. The open source XQuartz program provides X11 support for MacOS versions 10.6.3 or later. The safest option is to install version 2.7.8 but it is possible that later version also will work fine.

After installation run Applications ➙ Utilities ➙ XQuartz.app then right click on the XQuartz icon in the dock and select Applications ➙ Terminal. This should bring up a new xterm terminal window. In this xterm window, connect to the WIEN2k system using the ssh -Y user@system command to allow X11 forwarding.

Depending on your version of XQuartz you might have to enable OpenGL support by issuing the following command at the terminal command prompt and then reboot

defaults write org.macosforge.xquartz.X11 enable_iglx -bool true


Last modified 07/14/2020