NWChem 6.6 compilation fails on mac


Just Got Here
Hello,

I've been trying to compile NWChem 6.6 on a macbook pro (os x 10.10) but I keep getting a c compiler error

test \! -f 64_to_32 -o \! -f 32_to_64 || rm -f 64_to_32 32_to_64
test -d /Users/Nev/nwchem-6.6/lib/MACX64 || mkdir -p /Users/Nev/nwchem-6.6/lib/MACX64
test -d /Users/Nev/nwchem-6.6/bin/MACX64 || mkdir -p /Users/Nev/nwchem-6.6/bin/MACX64
./util/util_nwchem_version.bash
Making libraries in tools

*** Configuring Parallel Tools ****

../ga-5-4/configure --prefix=/Users/Nev/nwchem-6.6/src/tools/install --with-tcgmsg --with-mpi=-I/usr/local/Cellar/mpich/3.2_1/include -L/usr/local/Cellar/mpich/3.2_1/lib -lmpifort -lmpi -lpmpi -lpthread /usr/local/Cellar/mpich/3.2_1 --enable-peigs --enable-underscoring --disable-mpi-tests --without-scalapack --without-lapack --without-blas --with-mpi-ts CC=gcc CXX=c++ F77=gfortran CFLAGS=-DMPICH_NO_ATTR_TYPE_TAGS -DMPICH_NO_ATTR_TYPE_TAGS -DMPICH_NO_ATTR_TYPE_TAGS ARMCI_DEFAULT_SHMMAX_UBOUND=131072
checking build system type... x86_64-apple-darwin15.5.0
checking host system type... x86_64-apple-darwin15.5.0
checking for TARGET base (64bit-ness checked later)... MACX
checking whether we think this system is what we call SYSV... no
checking whether we are cross compiling... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ../ga-5-4/build-aux/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
configure: Detected VPATH build
configure: 
configure: C compiler
configure: 
checking for style of include used by make... GNU
checking whether the C compiler works... no
configure: error: in `/Users/Nev/nwchem-6.6/src/tools/build':
configure: error: C compiler cannot create executables
See `config.log' for more details
make[1]: *** [build/config.status] Error 1
make: *** [libraries] Error 1



I tried putting different c compilers ( gcc-mp-5, gcc-mp-4.8, gcc-4.8, gcc-5, clang) in the environment vars but this didn't help much.

My environment config is as follows

export FC=gfortran
export CC=gcc
export F77=gfortran
#export FC=/usr/local/Cellar/gcc48/4.8.5/bin/gfortran-4.8
#export CC=/usr/local/Cellar/gcc48/4.8.5/bin/gcc-4.8
#export F77=/usr/local/Cellar/gcc48/4.8.5/bin/gfortran-4.8
#export CXX=/usr/local/Cellar/gcc48/4.8.5/bin/c++-4.8

#NWCHEM 
export NWCHEM_TOP=/Users/Nev/nwchem-6.6
export NWCHEM_TARGET=MACX64
export NWCHEM_MODULES=all
export USE_NOFSCHECK=y
export USE_MPI=y
export USE_INTERNALBLAS=y
export MPI_LOC=/usr/local/Cellar/mpich/3.2_1
export MPI_LIB=$MPI_LOC/lib
export MPI_INCLUDE=$MPI_LOC/include 
export LIBMPI="-lmpifort -lmpi -lpmpi -lpthread"
export CFLAGS_FORGA="-DMPICH_NO_ATTR_TYPE_TAGS"


config.log Download


Thanks for your help.

Forum Vet
Please upload $NWCHEM_TOP/src/tools/build/config.log to a easily accessible website

Just Got Here
Quote:Edoapra Aug 3rd 8:57 am
Please upload $NWCHEM_TOP/src/tools/build/config.log to a easily accessible website



Here it is https://cl.ly/grxl

Forum Vet
You seems to have an env. variable LIBS set to
"-lccsd -lmcscf -lselci -lmp2 -lmoints -lstepper -ldriver -loptim ............"
Please unset it and re-start the compilation

Just Got Here
Hello & thank you,

I've unset LIBS and the compilation proceeds for a long time before breaking on another error

gfortran  -L/Users/Nev/nwchem/nwchem-6.6/lib/MACX64 -L/Users/Nev/nwchem/nwchem-6.6/src/tools/install/lib   -o /Users/Nev/nwchem/nwchem-6.6/bin/MACX64/nwchem nwchem.o stubs.o -lnwctask -lccsd -lmcscf -lselci -lmp2 -lmoints -lstepper -ldriver -loptim -lnwdft -lgradients -lcphf -lesp -lddscf -ldangchang -lguess -lhessian -lvib -lnwcutil -lrimp2 -lproperty -lsolvation -lnwints -lprepar -lnwmd -lnwpw -lofpw -lpaw -lpspw -lband -lnwpwlib -lcafe -lspace -lanalyze -lqhop -lpfft -ldplot -ldrdy -lvscf -lqmmm -lqmd -letrans -lpspw -ltce -lbq -lmm -lcons -lperfm -ldntmc -lccca -lnwcutil -lga -larmci -lpeigs -lperfm -lcons -lbq -lnwcutil -lnwclapack -L/opt/local/lib/ -lopenblas -lnwcblas   -L/opt/local/lib/ -lopenblas  -lnwclapack  -lnwcblas   -L/opt/local/lib/mpich-mp -lmpifort -lmpi -lpmpi -lpthread      -lpthread   
Undefined symbols for architecture x86_64:
  "_caxpy", referenced from:
      __acc in libarmci.a(comex.o)
  "_daxpy", referenced from:
      __acc in libarmci.a(comex.o)
     (maybe you meant: _daxpy3_, _pack_tt_daxpy_ , _grsm_gg_daxpy_ , _grsm_gmg_daxpy_ , _LP_daxpy , _dneall_mm_daxpy_ , _d3db_rr_daxpy_ , _d3db_cc_daxpy_ , _cram_rr_daxpy_ , _c3db_cc_daxpy_ , _daxpyfile_ , _cram_cc_daxpy_ , _pack_cc_daxpy_ , _c3db_rr_daxpy_ )
  "_saxpy", referenced from:
      __acc in libarmci.a(comex.o)
  "_zaxpy", referenced from:
      __acc in libarmci.a(comex.o)
     (maybe you meant: _pack_cc_zaxpy_, _c3db_cc_zaxpy_ , _d3db_cc_zaxpy_ , _cram_cc_zaxpy_ )
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [all] Error 1


env:
export NWCHEM_TOP=/Users/Nev/nwchem/nwchem-6.6
export NWCHEM_TARGET=MACX64
export NWCHEM_MODULES=all
export USE_NOFSCHECK=TRUE
export USE_MPI=y
export USE_MPIF=y
export USE_MPIF4=y
export BLASOPT=“ “
#export BLASOPT="-L/opt/local/lib/ -lopenblas"
#export MPI_LOC=/usr/local/Cellar/mpich/3.2_1
#export MPI_LIB=$MPI_LOC/lib
#export MPI_INCLUDE=$MPI_LOC/include 
export LIBMPI="-lmpifort -lmpi -lpmpi -lpthread"
#export LIBMPI="-lmpi_f90 -lmpi_f77 -lmpi -ldl -Wl,--export-dynamic -lnsl -lutil"
export CFLAGS_FORGA="-DMPICH_NO_ATTR_TYPE_TAGS"


config.log https://cl.ly/guX4


I figured it might be connected with the BLAS library, but switching to openblas (installed with macports) didn't help.

I was able to compile successfully with the Apple vendor blas BLAS_OPT="-framework Accelerate" (together eith thr 64to32 option) and everything apparently works but from what I've read this can often produce errnous results with nwchem.

Forum Vet
Here is how to use OpenBlas from Homebrew and fix your installation issues

1) brew install openblas

2) cd $NWCHEM_TOP/src/tools

3) rm -rf build

4) export BLASOPT="-L/usr/local/opt/openblas/lib -lopenblas"

5) export BLAS_SIZE=4

6) make

7) cd ..

8) make link


Forum >> NWChem's corner >> Compiling NWChem