`Compilation faied for nwchem-6.3.revision2-src.2013-10-17 with undefined reference


Clicked A Few Times
Hi,

I'm trying to install NWChem 6.3 and I'm getting undefined reference error.

Some how i'm not able to paste the entire error message, however, what ever the possible message that I can include, I pasted below. Hope some one can help me resolve the issue




gfortran -Wl,--export-dynamic -L/opt/ZIP/nwchem-6.3.revision2-src.2013-10-17/lib/LINUX64 -L/opt/ZIP/nwchem-6.3.revision2-src.2013-10-17/src/tools/install/lib -o /opt/ZIP/nwchem-6.3.revision2-src.2013-10-17/bin/LINUX64/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 -lnwints -lprepar -lnwmd -lnwpw -lofpw -lpaw -lpspw -lband -lnwpwlib -lnwxc -lcafe -lspace -lanalyze -lqhop -lpfft -ldplot -lnwpython -ldrdy -lvscf -lqmmm -lqmd -letrans -lpspw -ltce -lbq -lcons -lperfm -ldntmc -lccca -lnwcutil -lga -larmci -lpeigs -lperfm -lcons -lbq -lnwcutil /usr//lib64/python2.6/config/libpython2.6.so -l64to32 -L/app1/centos6.3/gnu/SCIlibs/lib -lblas -latlas -lblas -L/app1/centos6.3/gnu/mvapich2-1.9/lib -lmpichf90 -Wl,-rpath -Wl,/app1/centos6.3/gnu/mvapich2-1.9/lib -lmpich -lopa -lmpl -libmad -lrdmacm -libumad -libverbs -ldl -lrt -lm -lpthread -lnwcutil -lpthread -lutil -ldl

/opt/ZIP/nwchem-6.3.revision2-src.2013-10-17/lib/LINUX64/libdriver.a(lbfgs-b.o): In function `mainlb_':
lbfgs-b.F:(.text+0x94cb): undefined reference to `dlamch_'
/opt/ZIP/nwchem-6.3.revision2-src.2013-10-17/lib/LINUX64/libnwdft.a(zmat_diag.o): In function `zmat_diag_serial_':
zmat_diag.F:(.text+0xf7c): undefined reference to `zheev_'
zmat_diag.F:(.text+0x11c8): undefined reference to `zgeev_'
/opt/ZIP/nwchem-6.3.revision2-src.2013-10-17/lib/LINUX64/libnwdft.a(zmat_inv.o): In function `zmat_inv_serial_':
zmat_inv.F:(.text+0x30c): undefined reference to `zgetrf_'
zmat_inv.F:(.text+0x39d): undefined reference to `zgetrs_'
/opt/ZIP/nwchem-6.3.revision2-src.2013-10-17/lib/LINUX64/libnwcutil.a(geom_input.o): In function `hnd_molops_':
geom_input.F:(.text+0x3709): undefined reference to `dlamch_'




I installed my libraries at a specific location and below are my libs:

make libblas.a libf77blas.a libfftw3_mpi.a libfftw3_mpi.so.3 libfftw3_omp.la libfftw3_omp.so.3.4.4 libfftw3.so.3.4.4 libptcblas.a libscalapack.a libtmglib.so
lapack_LINUX.a libblas.so libfftw3.a libfftw3_mpi.la libfftw3_mpi.so.3.4.4 libfftw3_omp.so libfftw3.so liblapack.a libptf77blas.a libtatlas.so pkgconfig
libatlas.a libcblas.a libfftw3.la libfftw3_mpi.so libfftw3_omp.a libfftw3_omp.so.3 libfftw3.so.3 liblapack.so libsatlas.so libtmglib.a


----

My compilation environment is:

mpicc -v
mpicc for MVAPICH2 version 1.9
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/nfs/app1/centos6.3/gnu/gcc-4.8.2/bin/../libexec/gcc/x86_64-redhat-linux/4.8.2/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/app1/centos6.3/gnu/gcc-4.8.2 CFLAGS='-fPIC -O3 ' LDFLAGS='-L/app1/centos6.3/gnu/gcc-4.8.2/lib -L/app1/centos6.3/gnu/gcc-4.8.2/lib/ ' --enable-libada --enable-libssp --enable-objc-gc --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --with-system-zlib--enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,fortran,ada --disable-dssi --with-cloog --with-tune=generic --with-arch_32=i386 --build=x86_64-redhat-linux --with-gmp=/app1/centos6.3/gnu/gcc-4.8.2 --with-mpfr=/app1/centos6.3/gnu/gcc-4.8.2 --with-mpc=/app1/centos6.3/gnu/gcc-4.8.2
Thread model: posix
gcc version 4.8.2 (GCC)


----

Hope some one can help me resolving the issue.

Thanks a lot in advance.

Regards
Srikanth Gumma

Forum Vet
Srikanth
Your link command seems to imply that you set
BLASOPT=" -L/app1/centos6.3/gnu/SCIlibs/lib -lblas -latlas -lblas".
If this is correct, could you send us the output of the commands

nm /app1/centos6.3/gnu/SCIlibs/lib/libblas.a|grep dlamch
nm /app1/centos6.3/gnu/SCIlibs/lib/libatlas.a|grep dlamch

By the way, could you please report all the env. variables you have set for the NWChem compilation?

PS Did you run make 64_to_32? If you did, you should not have the symbol dlamch_ in libdriver.a, but ylamch_, instead.

Clicked A Few Times
Thank you for quick response. please find the below environment




Below is the environment which i'm using:


export USE_NOFSCHECK=TRUE
export LIB_DEFINES="-DDFLT_TOT_MEM=16777216"
export TCGRSH=/usr/local/bin/ssh
export USE_64TO32=yes
export HAS_BLAS=yes
export MRCC_THEORY=TRUE
export LAPACK_LIB="-L/app1/centos6.3/gnu/SCIlibs/lib -llapack"
export USE_SCALAPACK=y
export SCALAPACK_LIB="-L/app1/centos6.3/gnu/SCIlibs/lib -lscalapack"
export SCALAPACK_SIZE=4
export BLASOPT="-L/app1/centos6.3/gnu/SCIlibs/lib -lblas -latlas"
export PYTHONHOME=/usr/
export PYTHONVERSION=2.6
export USE_PYTHON64=y
export NWCHEM_MODULES="all python qm md"



  1. MPICH
       export MPI_LOC=/app1/centos6.3/gnu/mvapich2-1.9  #location of mpich
export MPI_LIB=$MPI_LOC/lib
export MPI_INCLUDE=$MPI_LOC/include
export LIBMPI=" -lmpichf90 -Wl,-rpath -Wl,/app1/centos6.3/gnu/mvapich2-1.9/lib -lmpich -lopa -lmpl -libmad -lrdmacm -libumad -libverbs -ldl -lrt -lm -lpthread "
export MPI_CC=mpicc
export MPI_CXX=mpicxx
export ARMCI_NETWORK=OPENIB
export USE_MPI=y
export USE_MPIF=y
export USE_MPIF4=y
export MPI_F90=mpiifort
export FC=mpif90
export CC=mpicc


export NWCHEM_TOP=opt/ZIP/nwchem-6.3.revision2-src.2013-10-17
cd $NWCHEM_TOP/src
export NWCHEM_TARGET=LINUX64

make clean
make 64_to_32
make nwchem_config
make |tee make.log





I installed my libraries at a specific location and below are my libs:

cmake libblas.a libf77blas.a libfftw3_mpi.a libfftw3_mpi.so.3 libfftw3_omp.la libfftw3_omp.so.3.4.4 libfftw3.so.3.4.4 libptcblas.a libscalapack.a libtmglib.so
lapack_LINUX.a libblas.so libfftw3.a libfftw3_mpi.la libfftw3_mpi.so.3.4.4 libfftw3_omp.so libfftw3.so liblapack.a libptf77blas.a libtatlas.so pkgconfig
libatlas.a libcblas.a libfftw3.la libfftw3_mpi.so libfftw3_omp.a libfftw3_omp.so.3 libfftw3.so.3 liblapack.so libsatlas.so libtmglib.a





My compilation environment is:

mpicc -v
mpicc for MVAPICH2 version 1.9
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/nfs/app1/centos6.3/gnu/gcc-4.8.2/bin/../libexec/gcc/x86_64-redhat-linux/4.8.2/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/app1/centos6.3/gnu/gcc-4.8.2 CFLAGS='-fPIC -O3 ' LDFLAGS='-L/app1/centos6.3/gnu/gcc-4.8.2/lib -L/app1/centos6.3/gnu/gcc-4.8.2/lib/ ' --enable-libada --enable-libssp --enable-objc-gc --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --with-system-zlib--enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,fortran,ada --disable-dssi --with-cloog --with-tune=generic --with-arch_32=i386 --build=x86_64-redhat-linux --with-gmp=/app1/centos6.3/gnu/gcc-4.8.2 --with-mpfr=/app1/centos6.3/gnu/gcc-4.8.2 --with-mpc=/app1/centos6.3/gnu/gcc-4.8.2
Thread model: posix
gcc version 4.8.2 (GCC)





for the commands given by you, there's no output at all, please suggest.

Forum Vet
I would set BLASOPT as
"-L/app1/centos6.3/gnu/SCIlibs/lib -llapack -lf77blas -lcblas -latlas"

Please send me the output of
nm /app1/centos6.3/gnu/SCIlibs/lib/libf77blas.a|grep dlamch

If the linking operation works, please do the following before using NWChem
rm -f 64_to_32 32_to_64
make 64_to_32
make FC=gfortran

Clicked A Few Times
unfortunately, there's no output for the command nm /app1/centos6.3/gnu/SCIlibs/lib/libf77blas.a|grep dlamch

I started to compile again, and I'll post the observations as soon as I get some result

Clicked A Few Times
unfortunately, there's no output for the command nm /app1/centos6.3/gnu/SCIlibs/lib/libf77blas.a|grep dlamch

I started to compile again, and I'll post the observations as soon as I get some result

Forum Vet
What about
nm /app1/centos6.3/gnu/SCIlibs/lib/liblapack.a|grep dlamch

Clicked A Few Times
Hi,

Thanks a lot for the help and sorry for the delay. I got some output with the last command and pasting it here.

nm /app1/centos6.3/gnu/SCIlibs/lib/liblapack.a|grep dlamch
ATL_dlamch.o:
0000000000000000 T ATL_dlamch
clapack_dlamch.o:
0000000000000000 T clapack_dlamch
dlamch.o:
0000000000000000 T dlamch_

Clicked A Few Times
Still I'm getting the error:

fortran -Wl,--export-dynamic -L/opt/ZIP/nwchem-6.3.revision2-src.2013-10-17/lib/LINUX64 -L/opt/ZIP/nwchem-6.3.revision2-src.2013-10-17/src/tools/install/lib -o /opt/ZIP/nwchem-6.3.revision2-src.2013-10-17/bin/LINUX64/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 -lnwints -lprepar -lnwmd -lnwpw -lofpw -lpaw -lpspw -lband -lnwpwlib -lnwxc -lcafe -lspace -lanalyze -lqhop -lpfft -ldplot -lnwpython -ldrdy -lvscf -lqmmm -lqmd -letrans -lpspw -ltce -lbq -lcons -lperfm -ldntmc -lccca -lnwcutil -lga -larmci -lpeigs -lperfm -lcons -lbq -lnwcutil /usr//lib64/python2.6/config/libpython2.6.so /app1/centos6.3/gnu/SCIlibs/lib/libscalapack.a -l64to32 /app1/centos6.3/gnu/SCIlibs/lib/libatlas.a -lblas -L/app1/centos6.3/gnu/mvapich2-1.9/lib -lmpichf90 -Wl,-rpath -Wl,/app1/centos6.3/gnu/mvapich2-1.9/lib -lmpich -lopa -lmpl -libmad -lrdmacm -libumad -libverbs -ldl -lrt -lm -lpthread -lnwcutil -lpthread -lutil -ldl
/opt/ZIP/nwchem-6.3.revision2-src.2013-10-17/lib/LINUX64/libdriver.a(lbfgs-b.o): In function `mainlb_':
lbfgs-b.F:(.text+0x94cb): undefined reference to `dlamch_'



My configuration script is here:

  1. !/bin/bash
module load mvapich2_gnu

  1. OPTIONAL environment variables

export LARGE_FILES=TRUE
export USE_NOFSCHECK=TRUE
export LIB_DEFINES="-DDFLT_TOT_MEM=16777216"
export TCGRSH=/usr/local/bin/ssh
export USE_64TO32=yes
export MRCC_THEORY=TRUE


export HAS_BLAS=yes
export LAPACK_LIB="/app1/centos6.3/gnu/SCIlibs/lib/liblapack.a"
export BLASOPT="/app1/centos6.3/gnu/SCIlibs/lib/libatlas.a"

export USE_SCALAPACK=y
export SCALAPACK="/app1/centos6.3/gnu/SCIlibs/lib/libscalapack.a"
export SCALAPACK_SIZE=4


export NWCHEM_MODULES=all
export PYTHONHOME=/usr/
export PYTHONVERSION=2.6
export USE_PYTHON64=y
export PYTHONLIBTYPE=so
export NWCHEM_MODULES="all python"
export FOPTIMIZE=-O1



  1. MPICH
       export MPI_LOC=/app1/centos6.3/gnu/mvapich2-1.9  #location of mpich
export MPI_LIB=$MPI_LOC/lib
export MPI_INCLUDE=$MPI_LOC/include
export LIBMPI=" -lmpichf90 -Wl,-rpath -Wl,/app1/centos6.3/gnu/mvapich2-1.9/lib -lmpich -lopa -lmpl -libmad -lrdmacm -libumad -libverbs -ldl -lrt -lm -lpthread "
export MPI_CC=mpicc
export MPI_CXX=mpicxx
export ARMCI_NETWORK=OPENIB
export USE_MPI=y
export USE_MPIF=y
export USE_MPIF4=y
export MPI_F90=mpiifort
export FC=mpif90
export CC=mpicc


export NWCHEM_TOP=/opt/ZIP/nwchem-6.3.revision2-src.2013-10-17
cd $NWCHEM_TOP/src
export NWCHEM_TARGET=LINUX64
make clean
make 64_to_32
make nwchem_config
make |tee make.log

Forum Vet
I have suggested
BLASOPT="-L/app1/centos6.3/gnu/SCIlibs/lib -llapack -lf77blas -lcblas -latlas"
You seem to have set
export BLASOPT="/app1/centos6.3/gnu/SCIlibs/lib/libatlas.a"

Clicked A Few Times
Hi Edoapra,

I tried what you have given me. But unfortunately I was unable to compile with that as well.

When I did a recursive nm lookup, I found dlmach is available in static libraries, hence I tried with static linking. But the compilation did not go through

Clicked A Few Times
Hi Edoapra,

Finally I was able to compile successfully. I deleted the entire directory and extracted again from the source. Here is the script I used for compilation

  1. !/bin/bash
module load mvapich2_gnu

  1. OPTIONAL environment variables

export LARGE_FILES=TRUE
export USE_NOFSCHECK=TRUE
export LIB_DEFINES="-DDFLT_TOT_MEM=16777216"
export TCGRSH=/usr/local/bin/ssh
export USE_64TO32=yes
export MRCC_THEORY=TRUE


export HAS_BLAS=yes
export LAPACK_LIB="/app1/centos6.3/gnu/SCIlibs/lib/liblapack.a"
export BLASOPT="/app1/centos6.3/gnu/SCIlibs/lib/libatlas.a"

export USE_SCALAPACK=y
export SCALAPACK="/app1/centos6.3/gnu/SCIlibs/lib/libscalapack.a"
export SCALAPACK_SIZE=4

export NWCHEM_MODULES=all
export PYTHONHOME=/usr/
export PYTHONVERSION=2.6
export USE_PYTHON64=y
export PYTHONLIBTYPE=so
export NWCHEM_MODULES="all python"
export FOPTIMIZE=-O1


export BLASOPT="-L/app1/centos6.3/gnu/SCIlibs/lib -llapack -lf77blas -lcblas -latlas"

  1. MPICH
       export MPI_LOC=/app1/centos6.3/gnu/mvapich2-1.9  #location of mpich
export MPI_LIB=$MPI_LOC/lib
export MPI_INCLUDE=$MPI_LOC/include
export LIBMPI=" -lmpichf90 -Wl,-rpath -Wl,/app1/centos6.3/gnu/mvapich2-1.9/lib -lmpich -lopa -lmpl -libmad -lrdmacm -libumad -libverbs -ldl -lrt -lm -lpthread "
export MPI_CC=mpicc
export MPI_CXX=mpicxx
export USE_MPI=y
export USE_MPIF=y
export USE_MPIF4=y
export MPI_F90=mpiifort
export FC=mpif90
export CC=mpicc

export NWCHEM_TOP=/opt/ZIP/nwchem-6.3_gnu/
cd $NWCHEM_TOP/src
export NWCHEM_TARGET=LINUX64

make clean
make 64_to_32
make nwchem_config
make |tee make.log

Clicked A Few Times
Thanks a lot for all the Help extended


Forum >> NWChem's corner >> General Topics