Linking Problems


Clicked A Few Times
Dear Community,
i have linking problems on my Linux64 workstation (gcc,mpich,gfortran)
I get lots of undefined references to pbeginf_ nodeid_ setdbg_ ... and so on
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src//lib/LINUX64/libpeigs.a(mxsubs.o): In function `mxinit_':
mxsubs.F:(.text+0x1e0): undefined reference to `tcgtime_'
mxsubs.F:(.text+0x1e7): undefined reference to `nodeid_'
mxsubs.F:(.text+0x1f1): undefined reference to `nnodes_'
mxsubs.F:(.text+0x211): undefined reference to `nodeid_'
mxsubs.F:(.text+0x21b): undefined reference to `nnodes_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src//lib/LINUX64/libpeigs.a(mxsubs.o): In function `mxsync_':
mxsubs.F:(.text+0x272): undefined reference to `synch_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src//lib/LINUX64/libpeigs.a(mxsubs.o): In function `mxbcst_':
mxsubs.F:(.text+0x320): undefined reference to `rcv_'
mxsubs.F:(.text+0x3c6): undefined reference to `snd_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src//lib/LINUX64/libpeigs.a(mxsubs.o): In function `mxclock_':
mxsubs.F:(.text+0x133): undefined reference to `tcgtime_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src//lib/LINUX64/libpeigs.a(mxsubs.o): In function `mxtick_':
mxsubs.F:(.text+0x243): undefined reference to `mtime_'



i guess this is related to the tcgmsg library... but ... how come? i wanted to build upon mpich. Unfortunately i do not have any further idea how to proceed. Any help is greatly appreciated. My environment is set to:

export MPI_INCLUDE=/opt/mpich//include
export LIBMPI="-L/opt/mpich/ch-p4/lib64 -lmpichf90 -lmpich -lpthread -lrt -lmpich -lfmpich "
export NWCHEM_TOP=/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/
export MPI_LIB=/opt/mpich/ch-p4/lib64/
export USE_MPI=y
export USE_MPIF=y
export USE_MPIF4=y
export TCGRSH=/usr/bin/ssh
export NWCHEM_MODULES=all
export MPI_LOC=/opt/mpich/ch-p4/
export FC=gfortran
export LARGE_FILES=yes
export CC=gcc
export NWCHEM_TARGET=LINUX64

Thanks in advance
Alex

Forum Vet
CoolEsza,
could you please post the full link line (e.g. gfortran -fdefault-integer-8 -Wextra -Wuninitialized -g ...)
and the beginning of the link error message?
Thanks, Edo

Clicked A Few Times
Dear Edo,
thanks a lot for helping me:
the first lines, where the error occurrs are:
 gfortran -fdefault-integer-8 -Wextra -Wuninitialized  -g -O   -I.  -I/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src//src/include -I/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src//src/tools/install/include -DEXT_INT -DLINUX -DLINUX64 -DGFORTRAN -DCHKUNDFLW -DGCC4 -DPARALLEL_DIAG -DCOMPILATION_DATE="'`date +%a_%b_%d_%H:%M:%S_%Y`'" -DCOMPILATION_DIR="'/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/'" -DNWCHEM_BRANCH="'6.1.1'"  -c -o nwchem.o nwchem.F
gfortran -fdefault-integer-8 -Wextra -Wuninitialized  -g -O   -I.  -I/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src//src/include -I/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src//src/tools/install/include -DEXT_INT -DLINUX -DLINUX64 -DGFORTRAN -DCHKUNDFLW -DGCC4 -DPARALLEL_DIAG -DCOMPILATION_DATE="'`date +%a_%b_%d_%H:%M:%S_%Y`'" -DCOMPILATION_DIR="'/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/'" -DNWCHEM_BRANCH="'6.1.1'"  -c -o stubs.o stubs.F
gfortran   -L/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src//lib/LINUX64 -L/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src//src/tools/install/lib  -o /home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src//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 -lcafe -lspace -lanalyze -lqhop -lpfft -ldplot -ldrdy -lvscf -lqmmm -lqmd -letrans -lpspw -ltce -lbq -lcons -lperfm -ldntmc -lccca -lnwcutil -lga -lpeigs -lperfm -lcons -lbq -lnwcutil -llapack  -lblas   -L/opt/mpich/ch-p4/lib64/ -L/opt/mpich/ch-p4/lib64 -lmpichf90 -lmpich -lpthread -lrt -lmpich -lfmpich    
nwchem.o: In function `nwchem':
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/src/nwchem.F:66: undefined reference to `pbeginf_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/src/nwchem.F:81: undefined reference to `nodeid_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/src/nwchem.F:244: undefined reference to `setdbg_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/src/nwchem.F:246: undefined reference to `setdbg_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/src/nwchem.F:327: undefined reference to `pend_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src//lib/LINUX64/libnwctask.a(input_mem.o): In function `input_mem_size_':
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/src/input/input_mem.F:31: undefined reference to `nodeid_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/src/input/input_mem.F:52: undefined reference to `mitob_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/src/input/input_mem.F:52: undefined reference to `brdcst_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/src/input/input_mem.F:53: undefined reference to `mitob_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/src/input/input_mem.F:53: undefined reference to `brdcst_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/src/input/input_mem.F:54: undefined reference to `mitob_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/src/input/input_mem.F:54: undefined reference to `brdcst_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/src/input/input_mem.F:55: undefined reference to `mitob_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/src/input/input_mem.F:55: undefined reference to `brdcst_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src//lib/LINUX64/libnwctask.a(task_bsse.o): In function `bsse_create_geom_':
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/src/task/task_bsse.F:735: undefined reference to `nodeid_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src//lib/LINUX64/libnwctask.a(task_bsse.o): In function `bsse_gradient_':
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/src/task/task_bsse.F:1053: undefined reference to `nodeid_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/src/task/task_bsse.F:1275: undefined reference to `nodeid_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src//lib/LINUX64/libnwctask.a(task_bsse.o): In function `bsse_hessian_':
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/src/task/task_bsse.F:1372: undefined reference to `nodeid_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/src/task/task_bsse.F:1456: undefined reference to `nodeid_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src//lib/LINUX64/libnwctask.a(task_bsse.o):/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/src/task/task_bsse.F:1513: more undefined references to `nodeid_' follow
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src//lib/LINUX64/libnwctask.a(task_save_state.o): In function `task_restore_state_':
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/src/task/task_save_state.F:378: undefined reference to `mitob_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src//lib/LINUX64/libccsd.a(cputime.o): In function `cputime_':
cputime.F:(.text+0x7): undefined reference to `tcgtime_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src//lib/LINUX64/libccsd.a(ccsd_driver.o): In function `ccsd_driver_':
ccsd_driver.F:(.text+0x978): undefined reference to `tcgtime_'
ccsd_driver.F:(.text+0x9bb): undefined reference to `tcgtime_'
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src//lib/LINUX64/libccsd.a(aoccsd2.o): In function `aoccsd_':


I have put the make.log onto my online-storage: the link is
http://www.adrive.com/public/5YNkcz/make.log (md5:aa9e245380a87ae7687d073a1cae30c4)

Thanks
Alex

Clicked A Few Times
Okay... i made it work. The problem was the ga library. Unfortunately there was a pre-installed ga library which obviously did not fit the nwchem compilation. Moreover the linker got "-L/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/src/tools/install/lib64 -lga ?, that did not exist. But having a ga library installed i did not recognize the following which occurrs without that library.

gfortran   -L/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src//lib/LINUX64 -L/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src//src/tools/install/lib  -o /home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src//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 -lcafe -lspace -lanalyze -lqhop -lpfft -ldplot -ldrdy -lvscf -lqmmm -lqmd -letrans -lpspw -ltce -lbq -lcons -lperfm -ldntmc -lccca -lnwcutil -lga -lpeigs -lperfm -lcons -lbq -lnwcutil -llapack  -lblas   -L/opt/mpich/ch-p4/lib64/ -lmpich -lpthread -lrt
/usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/bin/ld: cannot find -lga
collect2: ld returned 1 exit status



The following workaround helped :
1. I uninstalled the pre-installed ga library
2. i compiled the whole package up to the point where the linker did not find -lga
3. i copied
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/src/tools/install/lib64
to 
/home/kuleszaa/PROGRAMS/NWCHEM6.1.1/nwchem-6.1.1-src/src/tools/install/lib
4. make clean
5. make >& make.log &
et voila
I guess there is a much more elegant way .. but im quite happy now. Thanks again for help.
Best regards
Alex

Just Got Here
What is lnwctask?
Tell me, how to install lnwctask? I am facing the problem to make link of NWCHEM>

Forum Vet
Quote:Vikas Nayak Feb 8th 4:09 am
Tell me, how to install lnwctask? I am facing the problem to make link of NWCHEM>


The link command of NWChem contains the -lnwctask argument that refers to the libwctask.a library that should have been built in the
$NWCHEM_TOP/lib/LINUX64 directory

Could you provide us more information about your failure?

Edo


Forum >> NWChem's corner >> Compiling NWChem