HOWTO: compiling nwchem-6.5 beta on Ubuntu 14.04 x86-64

From NWChem

You are viewing a single post from the thread title above
Jump to: navigation, search

Click here for full thread
Gets Around
Threads 18
Posts 133
I'm assuming that you have used NWChem before but have not necessarily ever built it from source. These instructions basically work for Debian Wheezy also, though you will have to tweak the Python-related paths for Debian.

I am assuming that you already have an optimized BLAS that provides a 64 bit integer interface for use by NWChem. If that is not true, skip ahead to the next post about building OpenBLAS.

All following instructions assume that you are downloading code and compiling starting in the directory /opt/science/nwchem/. Adjust paths accordingly if you are working somewhere else, like $HOME/nwchem/.

You will need a few non-standard packages to obtain the 6.5 beta source code and build it with all bells and whistles enabled. I think this covers the packages you need that aren't installed by default:

sudo apt-get install subversion openmpi-bin libopenmpi-dev libopenmpi1.6 gfortran python-dev

You will need to get the beta code from the Subversion repository:
svn checkout nwchem-6.5

You will also need to get the latest NWChem development snapshot:

You need both because the src/tools/ directory is not populated in the code you check out from subversion, and you will need to replace it from the corresponding subdirectory in the snapshot. If you have nwchem-6.5 and Nwchem-dev.revision26027-src.2014-08-28.tar.gz in the same directory, do it like this:

tar xzvf Nwchem-dev.revision26027-src.2014-08-28.tar.gz
cd nwchem-6.5
rm -rf src/tools
cp -r ../Nwchem-dev.revision26027-src.2014-08-28/src/tools src

Now set a bunch of environment variables to enable all optional features and prepare for building. We're even enabling so-new-they're-undocumented features like EA-CCSD and IP-CCSD. Note that contrary to the wiki build documentation, if you want multi-reference coupled cluster capabilites you set MRCC_METHODS, not MRCC_THEORY.

export TCGRSH=/usr/bin/ssh
export NWCHEM_TOP=`pwd`
export NWCHEM_MODULES="all python"
export PYTHONHOME=/usr
export PYTHONCONFIGDIR=config-x86_64-linux-gnu
export CC=gcc
export FC=gfortran
export FOPTIMIZE="-O3 -march=native -mtune=native -msse -msse2 -msse3 -mssse3 -msse4 -msse4.1 -msse4.2 -funroll-loops -fprefetch-loop-arrays -fvariable-expansion-in-unroller -ffast-math -mfpmath=sse"
export COPTIMIZE="-O3 -march=native -mtune=native -msse -msse2 -msse3 -mssse3 -msse4 -msse4.1 -msse4.2 -funroll-loops -ffast-math -mfpmath=sse"
export HAS_BLAS=yes
export BLASOPT="-L/opt/science/openblas/64/lib -lopenblas"
export USE_MPI=y
export USE_MPIF=y
export USE_MPIF4=y
export MPI_LOC=/usr/lib/openmpi/
export MPI_LIB=/usr/lib/openmpi/lib
export MPI_INCLUDE=/usr/lib/openmpi/include
export LIBMPI="-lpthread -L$MPI_LIB -lmpi_f90 -lmpi_f77 -lmpi"
export CCSDTQ=y
export CCSDTLR=y
export IPCCSD=y
export EACCSD=y
cd $NWCHEM_TOP/src
make clean
make nwchem_config 2>&1 | tee make.nwchem_config.log
cd ../contrib

The compiler flags are those suggested by Jeff Hammond:

This takes a while when it all goes successfully. Note especially the BLASOPT setting: if you haven't already installed OpenBLAS, and in the exact same way I did (unlikely), you will probably need to change that line.

If all builds successfully, you will find a 120 MB binary file in nwchem-6.5/bin/LINUX64. If you already have a version of NWChem installed, and you want the new version you've just built to be found when you type nwchem in a shell, adjust your PATH to put it first.

Who's here now Members 0 Guests 0 Bots/Crawler 0

AWC's: 2.5.10 MediaWiki - Stand Alone Forum Extension
Forum theme style by: AWC