Danny Rehn

        


Home Tutorials
Projects RT-TDDFT

Software


Contents

Emacs

I have had issues with computer clusters supporting different versions of emacs and eventually got tired of trying to understand why certain emacs modes work with certain versions of emacs and not others. Eventually, I decided to install my own local version of emacs to forget about this issue. I ended up choosing Emacs 25.2 and installed on a CentOS system in ~/.local by doing the following:

$ cd ~/.local
$ wget https://ftp.gnu.org/gnu/emacs/emacs-25.2.tar.gz
$ tar xzf emacs-25.2.tar.gz
$ mkdir emacs
$ cd emacs-25.2
$ ### Important line here: specify prefix of install dir and no png, no gif
$ ./configure --with-png=no --with-gif=no --prefix=$HOME/.local/emacs
$ make
$ make install

Then you will want to add the following to your .bashrc.

export PATH="$HOME/.local/emacs/bin:$PATH"

It should be safe to remove $HOME/.local/emacs-25.2 if make install succeeds.

Emacs Modes

Here are links to useful emacs modes:

CMake

I have had issues using different versions of CMake in the past. What seems to work well is to download the binaries from the CMake website.

An example for installing on linux is this, installing in ~/.local

$ cd ~/.local
$ wget https://cmake.org/files/v3.8/cmake-3.8.1-Linux-x86_64.sh
$ bash cmake-3.8.1-Linux-x86_64.sh

There will be a license agreement and some other easy to follow steps to follow. Next, add export PATH="/home/user/.local/cmake-3.8.1-Linux-x86_64/bin:$PATH to your .bashrc file. (You may also wish to rename the cmake-3.8.1… folder to make things less verbose.)

MPICH

Go to the MPICH homepage and click on the Download MPICH link. You can then choose MPICH 3.2 stable release or some other version.

Use wget to download the link, untar the file and then follow the instructions in the README in the MPICH folder.

I prefer to install in ~/.local/mpich.

The build process is fairly straight-forward.

Homebrew

Homebrew is very useful and I have had success using it for many packages. It installs software in /usr/local, which is not used by Mac OS. It is similar to MacPorts (which installs in /opt/local), but I have preferred Homebrew and seem to have better luck with it. I try not to use MacPorts if I can avoid

Linuxbrew

Linuxbrew is a fork of Homebrew intended to work on Linux machines. Some things work very well with Linuxbrew, but usually it takes a while for newly-installed Homebrew packages to trickle downstream. I have had issues installing recent versions of gcc and OpenCoarrays, and was never able to get it to work quite right. At this point, I have given up hope for Linuxbrew and will wait to see what ends up happening with the project before using it again.

Anaconda

Anaconda provides a package of immediately useful Python packages. It has nearly everything I have ever needed, and I used to use it exclusively (the one thing it doesn’t support well is PyGTK). It includes numpy, scipy, matplotlib, the ipython wrapper, and many other useful packages. It also comes with the conda commandline tool, which is a package manager for different python packages.

To install on MacOS or Linux, visit the continuum website. Installation is very straightforward. It is easy to install without root access on Unix machines.

Important Note: When installing Anaconda with either Python version 2 or 3, I have had issues when loading matplotlib.pyplot or, more simply, pylab. For example, issuing the following command will result in an error:

>>> from pylab import *
>>> # or
>>> import matplotlib.pyplot as plt

The reason for the error is that Anaconda comes with PyQt5 by default, while matplotlib.pyplot is expecting to use PyQt4, which isn’t installed.

To fix this issue, adjust your matplotlibrc, usually located in ~/.matplotlib/matplotlibrc. You should see a line that looks like the following:

backend      : qt4agg

Simply change that to backend : qt5agg and your problem should be solved.

PyGTK

I have had numerous issues installing PyGTK, which is used for things like p4vasp (an automated software for plotting band-structures and DOS from VASP files).

Many Linux distributions have PyGTK already installed. To test this simply run:

$ python
...
>>> import pygtk

If this results in an error, there could be 2 reasons:

  1. You have a different version of python (not the system default version) installed (e.g., you installed Anaconda python), and pygtk does not come with the python you have installed.
  2. Your operating system never had it installed.

To test which python you are using, run

$ which python

If you see /usr/bin/python as output, that is most likely the python installed by the operating system. Most of these should have pygtk included, but some don’t. If you see some other result, it should give hints as to which python distribution you have installed.

PyGTK Mac installation

On Mac, the only way I was able to get PyGTK to work right was to install using homebrew.

$ brew install pygtk

There are a few dependencies that will have to be installed, but it should work.

If you prefer using Anaconda Python (like I do), I don’t have any good suggestions for how to get PyGTK to work with Anaconda. (conda install pygtk and other similar commands where you specifically choose a version from the Anaconda website, do not work)

PyGTK Linux installation

I don’t have much advice for installing with Linux yet. I have tried installing using Linuxbrew, conda, pip, and easy_install and never had success. It should be possible to install from source, but I also ran into issues and never had the time to think about it in detail. Generally, if I have really needed PyGTK, I unload the anaconda python in my PATH and simply use the system-installed python, which usually has PyGTK.

Opencoarrays

Note: OpenCoarrays uses Fortran coarrays, which are part of the Fortran 2008 standard. Only some compilers support the standard so far. Recent versions of icc and gcc should provide at least partial support. A useful link to checking on Fortran 2008 standard implementations is found at this website. Even fewer compilers support parts of the Fortran 2015 standard, and gcc 7.1.0 and higher are the best bet at getting new features.

In general, it seems like gcc 6.3 and higher should have most capabilities needed for coarray Fortran code, and icc 16 and greater may be usable, as well. However, I have experience only using GCC.

Building from Source

Currently (June 2017), OpenCoarrays 1.9.0 is the most current version. I have only been able to very successfully install OpenCoarrays from source (on both Mac and Linux). However, there are important prerequisites

Prerequisites

In general, I have found that the following are all important to have installed before trying to install OpenCoarrays. You will want to make sure your PATH varialbe is updated to include all binaries from these builds:

Source Build

First, go to the Coarrays release page

$ cd OpenCoarrays-1.9.0
$ mkdir build
$ cd build
$ CC=gcc FC=gfortran cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/.local/opencoarrays
$ make
$ make install

That should do everything for you if you have the necessary prerequisites

OpenCoarrays on Mac

On Mac OS Sierra (10.12), this is very easily installed with Homebrew:

$ brew install opencoarrays

It uses gcc-7.1.0 as a prerequisite (as of May 2017). It should work immediately after doing this.

Note: I have had issues with using opencoarrays from Homebrew. The caf compiler and cafrun seem to work fine with coarrays code, but compiling standard MPI code with mpif90 and mpirun ends up causing serious issues. I haven’t figured out exactly why, but it has to do with the fact that the Homebrew version of coarrays installs OpenMPI, and OpenMPI itself has some issues I haven’t been able to debug. Basically, it gives errors with MPI_Send and MPI_Recv for even the simplest MPI Fortran code.

OpenCoarrays on Linux

Linux installation is either easy or a pain, depending on: 1) what specific operating system you are using and 2) whether you have root access.

Debian/Ubuntu

If you are using Debian-based Linux distributions like Ubuntu, Debian, etc. then it could be very easy to install using apt-get (if you have root access), and if that doesn’t work (you don’t have root access), then the install script from the OpenCoarrays github page should work by simply running it.

CentOS/Redhat/Fedora

If you are using one of these operating systems and have root access, you may be able to get it to work with yum or rpm. I don’t have root access to a system with one of these OS’s, so I can’t say much on that.

For CentOS 6.7 without root access, I have not been able to get the install script at the OpenCoarrays website to work (as of May 2017). Generally, this means that you have to download the OpenCoarrays source and try to build the prerequisites separately, and then try to compile opencoarrays on top of those prerequisites.

Quantum Espresso

Quantum ESPRESSO is an open-source DFT code that can be downloaded from quantum-espresso.org.

XCrysden

XCrysden is a useful X-windows crystal-structure visualization software. I was able to install it via MacPorts. Hopefully they will port it to Homebrew eventually.

VASP

VASP is open-source, but requires a license to build.

p4vasp

p4vasp is a useful band structure/DOS visualization software that relies on PyGTK. The source code and website for it seems to have dissappeared from existence (May 2017), but we have old source code in our group.

Once you have the source code and PyGTK installed, it is easy to use. You have to modify the file in /path/to/p4vasp/bin/p4v (the p4v file in /p4vasp/bin is a shell script disguising as a binary executable). Once you adjust the paths inside this file and export PATH=/path/to/p4vasp/bin:$PATH to your .bashrc, it should work.

Wannier90

I have written detailed instructions on installing Wannier90 (v2.1) for use with VASP at this link.