Installation of NWChem on RHEL & CentOS: Error and Solution

Compile Error and Run-time Error

This post summarized some error I frequently found during install NWChem. The solution I provide here works for me. So it should also work for you who install NWChem on CentOS.

1. Error while compiling program

Error 1: Build NWChem fails

test \! -f 64_to_32 -o \! -f 32_to_64 || rm -f 64_to_32 32_to_64
test -d /share/apps/nwchem-6.6/lib/LINUX64 || mkdir -p /share/apps/nwchem-6.6/lib/LINUX64
test -d /share/apps/nwchem-6.6/bin/LINUX64 || mkdir -p /share/apps/nwchem-6.6/bin/LINUX64
./util/util_nwchem_version.bash
Making libraries in tools
make[1]: Entering directory `/share/apps/nwchem-6.6/src/tools'
*** Building Parallel Tools ****
make[2]: Entering directory `/share/apps/nwchem-6.6/src/tools/build'
/usr/bin/make all-recursive
make[3]: Entering directory `/share/apps/nwchem-6.6/src/tools/build'
Making all in comex
make[4]: Entering directory `/share/apps/nwchem-6.6/src/tools/build/comex'
make[4]: *** No rule to make target `all'. Stop.
make[4]: Leaving directory `/share/apps/nwchem-6.6/src/tools/build/comex'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/share/apps/nwchem-6.6/src/tools/build'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/share/apps/nwchem-6.6/src/tools/build'
make[1]: *** [build/.libs/libga.a] Error 1
make[1]: Leaving directory `/share/apps/nwchem-6.6/src/tools'
make: *** [libraries] Error 1
~

Work around: try following commands

cd $NWCHEM_TOP/src 
make clean 
make

or try

cd $NWCHEM_TOP/src/tools
rm -rf build install
make FC=ifort

If these commands cannot fix error, try command to delete all configuration.

make realclean

Then run script again, the suggested commands are following

make nwchem_config NWCHEM_MODULES="all python"
make 64_to_32
make


Error 2: USE_ARUR=TRUE

generic modifiers:
[c] - do not warn if the library had to be created
[s] - create an archive index (cf. ranlib)
[S] - do not build a symbol table
[T] - make a thin archive
[v] - be verbose
[V] - display the version number
@<file> - read options from <file>
emulation options:
No emulation specific options
ar: supported targets: elf64-x86-64 elf32-i386 a.out-i386-linux pei-i386 pei-x86-64 elf64-l1om elf64-little elf64-big elf32-little elf32-big srec symbolsrec verilog tekhex binary ihex
make[3]: *** [all] Error 1
make[3]: Leaving directory `/home/ittipat/installer/nwchem-6.6/src/peigs/src/c'
make[2]: *** [lib] Error 2
make[2]: Leaving directory `/home/ittipat/installer/nwchem-6.6/src/peigs'
make[1]: *** [peigs_stamp] Error 1
make[1]: Leaving directory `/home/ittipat/installer/nwchem-6.6/src/peigs'
make: *** [libraries] Error 1

To solve this problem, do not use export USE_ARUR=TRUE and compile again.


Error 3: Python version not match

If you have a problem with Python, you shold use the following environment variable as default.

export PYTHONVERSION=2.6
export PYTHONHOME=/usr
export USE_PYTHONCONFIG=1

Set PYTHONVERSION=2.7 instead if your cluster is using version 2.7.

Error 4: Library not found

If you faced the following error while compiling or running NWChem

libmpi_f90.so.1: cannot open

You can fix this error using command

export LD_LIBRARY_PATH=/usr/local/openmpi/lib/:$LD_LIBRARY_PATH 
source $HOME/.bashrc

2. Error while compiling program using yum

Error 1: If you get an error while installing NWChem using yum, I may guess that yum repo is whether disabled or not installed.

To check the status of yum repository, use following commands

yum repolist​
yum repolist disabled

If packages or libraries have not been installed yet, use following command to install EPEL repository.

sudo yum install epel-release

or installing using following command (depending on RHEL version) https://fedoraproject.org/wiki/EPEL

  • RHEL/CentOS 7
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
  • RHEL/CentOS 6
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

Now you should try to install NWChem again

sudo yum -y install nwchem nwchem-openmpi nwchem-mpich

If having no any error, NWChem executable should be available at /usr/lib64/openmpi/bin/nwchem_openmpi


Error 2: When you run NWChem and suddenly confront an error like this

/usr/lib64/openmpi/bin/nwchem_openmpi: error while loading shared libraries: libga.so.0: cannot open shared object file: No such file or directory

It means that libga.so.0 dynamics library has not been added into $LD_LIBRARY_PATH. You can search where this library is by using command

locate libga.so.0

Then add the absolute path of directory of this library to $LD_LIBRARY_PATH into .bashrc or .profile file.

3. Error while installing using rpm: cannot install elpa-openmpi-devel (1)

checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... (cached) yes
checking for GNU make... make
checking for cpp... yes
checking for GNU make... make
checking for style of include used by make... GNU
checking whether to compile using MPI... yes
checking for gcc... icc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether icc accepts -g... yes
checking for icc option to accept ISO C89... none needed
checking whether icc understands -c and -o together... yes
checking dependency style of icc... gcc3
checking for function MPI_Init... no
checking for function MPI_Init in -lmpi... no
checking for function MPI_Init in -lmpich... no
configure: error: no MPI C wrapper found

Error above is about calling MPI. You can use following command to fix it.

./configure ... -- -DCMAKE_MODULE_PATH=/path/to/new/findmpi

or

./configure -- -DCMAKE_MODULE_PATH=/path/to/new/findmpi

P.S. I am not sure about the syntax usage and position of hyphen of this command. However, you can make trial and error.


If above solution does not work and you still want to use OpenMPI, you can use rpm to install NWChem instead, which is convenient for beginner.

Download elpa-openmpi-devel from pkgs.org ot rpmfind.net. Choose version of rpm carefully. It must match to version of Linux distribution.

First, download rpm binary file by running command

Then install using commands

chmod +x ./*rpm
rpm -ivh name_of_rpm.rpm

If you are asked to install the dependency, you have to install the package that OpenMPI requires as following

  • /usr/bin/pkg-config
  • elpa-devel = 2015.02.002-4.el6.1
  • elpa-openmpi(x86-64) = 2015.02.002-4.el6.1
  • gcc-gfortran
  • libelpa.so.3()(64bit)

If installation is finished, you can check where OpenMPI is installed using command

rpm -qi --filesbypkg elpa-openmpi-devel

4. Error while installing using rpm: cannot install elpa-openmpi-devel (2)

If you cannot install epla-openmpi-devel by using neither yum nor rpm, you can try following commands to install ELPA repo.

yum list elpa*
yum install elpa*

If you see warning message "No package elpa* available", this means that your Linux repository server does not have this package.

For example, I use a mirror of mirrors.bestthaihost.com. elpa-open-devel is available and can be installed using yum command.

5. Error while running NWChem

Error 1: Segmentation fault with ARMCI

When you call NWChem but it fails in which a problem is about ARMCI and segmentation violation, it means that you incorrectly chose the library of BLAS or SCALAPACK.

0:Segmentation Violation error, status=: 11 
(rank:0 hostname:castor.narit.or.th pid:887):ARMCI DASSERT fail. ../../ga-5-4/armci/src/common/signaltrap.c:SigSegvHandler():315 cond:0 
Last System Error Message from Task 0:: Bad address 
[unset]: aborting job: 
application called MPI_Abort(comm=0x84000001, 11) - process 0

Also this error is about conflict of BLAS=4 and ilp64.

  • lp64 requires BLAS_SIZE=4
  • ilp64 requires BLAS_SIZE=8

This can be fixed by re-compile program using another library. The old one is

export BLASOPT="-lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -ldl"

For setting BLAS=4, use -lmkl_intel_lp64 instead of -lmkl_intel_ilp64.

export BLASOPT="-lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -ldl"

Trick: You do not need to run make 64_to_32 as long as you set either BLAS or SCALAPACK to 8.


Error 2: Cannot allocate memory

If NWChem parallelized with MPI cannot allocate the memory with number of processors that you specified, the error like this generally occurs

utilfname: cannot allocate or utilfname: cannot allocate:Received an Error in Communication 

To fix this error, you must specify the amount of memory PER processor core that NWChem can possibly employs for a calculation.

Use memory keyword to control a certain amount of memory, for example, 1 Gigabyte per process.

memory total 1 GB

Rangsiman Ketkaew