please help with linking nwchem.... undefined reference...

22 views
Skip to first unread message

Miro

unread,
Nov 20, 2025, 5:21:09 AM (13 days ago) Nov 20
to NWChem Forum
Hello,

would you please help me with setting proper libraries for NWChem linking ?

I have "-lutil" among linking libraries, but it is not accepted...

ls /usr/lib64/libutil
libutil-2.17.so  libutil.so       libutil.so.1

.
.
.
ifort -i8 -align -fpp -Qoption,fpp,-w0 -qno-openmp -fimf-arch-consistency=true -finline-limit=250 -O2 -g -fp-model source     -L/zfs/scratch/HybriLITWorkshop2025/milias/software/nwchem/cloned/nwchem_master/lib/LINUX64 -L/zfs/scratch/HybriLITWorkshop2025/milias/software/nwchem/cloned/nwchem_master/src/tools/install/lib   -o /zfs/scratch/HybriLITWorkshop2025/milias/software/nwchem/cloned/nwchem_master/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 -lsolvation -lnwints -lprepar -lnwmd -lnwpw -lofpw -lpaw -lpspw -lband -lnwpwlib -lcafe -lspace -lanalyze -lqhop -lpfft -ldplot -lnwpython -ldrdy -lvscf -lqmmm -lqmd -letrans -lpspw -ltce -lbq -lmm -lcons -lperfm -ldntmc -lccca -ldimqm -lfcidump -lgwmol -lbsemol -lnwcutil -lga -larmci  -lperfm  -lpeigs_comm -lcons -lbq -lnwcutil -lelpa -qmkl -lmkl_scalapack_ilp64 -lmkl_blacs_intelmpi_ilp64 -lpthread -lm -ldl -lutil  -l64to32 -L/cvmfs/hybrilit.jinr.ru/sw/slc7_x86-64/intel/oneapi/mkl/latest/lib/intel64 -lmkl_intel_ilp64 -lmkl_core -lmkl_sequential -lmkl_core -liomp5 -lpthread -lm -lutil -L/cvmfs/hybrilit.jinr.ru/sw/slc7_x86-64/intel/oneapi/mkl/latest/lib/intel64 -lmkl_intel_ilp64 -lmkl_core -lmkl_sequential -lmkl_core -liomp5 -lpthread -lm -lutil -lcomex -lmpifort -lmpi -lrt -lpthread -ldl -mkl -lpthread -lm -lrt -lpthread -lpthread -lnwcutil -L/cvmfs/hybrilit.jinr.ru/sw/slc7_x86-64/Python/v3.10.13/lib/python3.10/config-3.10-x86_64-linux-gnu -lpython3.10 -lcrypt -lpthread -ldl  -lutil -lm -lm   -L"/cvmfs/hybrilit.jinr.ru/sw/slc7_x86-64/intel/oneapi/mpi/latest/lib/release" -L"/cvmfs/hybrilit.jinr.ru/sw/slc7_x86-64/intel/oneapi/mpi/latest/lib" -lmpifort -lmpi -lrt -lpthread -ldl
ifort: command line remark #10412: option '-mkl' is deprecated and will be removed in a future release. Please use the replacement option '-qmkl'
/cvmfs/hybrilit.jinr.ru/sw/slc7_x86-64/Python/v3.10.13/lib/python3.10/config-3.10-x86_64-linux-gnu/libpython3.10.a(posixmodule.o): In function `os_openpty_impl':
/root/zuev/Python-3.10.13/./Modules/posixmodule.c:7259: undefined reference to `openpty'
/cvmfs/hybrilit.jinr.ru/sw/slc7_x86-64/Python/v3.10.13/lib/python3.10/config-3.10-x86_64-linux-gnu/libpython3.10.a(posixmodule.o): In function `os_forkpty_impl':
/root/zuev/Python-3.10.13/./Modules/posixmodule.c:7360: undefined reference to `forkpty'
make: *** [link] Error 1

Edoardo Aprà

unread,
Nov 20, 2025, 5:36:17 AM (13 days ago) Nov 20
to NWChem Forum
My advice is to first keep it simple, and then try more complex build options.
Therefore, I would suggest you to first try without the python module and by using MKL sequential libraries (most of the NWChem modules do not benefit from linear algebra threading anyhow).
Under these conditions, the MKL Advisor website does not suggest any libutil linking

SCALAPACK_LIB="-L${MKLROOT}/lib/intel64 -lmkl_scalapack_ilp64 -lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -lmkl_blacs_intelmpi_ilp64 -lpthread -lm -ldl"

Once you get this simpler build setup working, you could try to include the python module.

Miro

unread,
Nov 20, 2025, 5:12:36 PM (12 days ago) Nov 20
to NWChem Forum
Dear Edoardo,

thanks for your hints.

I removed python from nwchem modules (keeping only NWCHEM_MODULES="all" ), fixed the linking libraries and got proper "nwchem" executable.

The issue is with the python module on our supercomputer...The remedy for undefined references by python should be the libutil.so library. Maybe I should extend LD_LIBRARY_PATH to contain /usr/lib64/libutil.so and add -lutil  ...

Miro

----------
ifort -i8 -align -fpp -Qoption,fpp,-w0 -qno-openmp -fimf-arch-consistency=true -finline-limit=250 -O2 -g -fp-model source     -L/zf
s/scratch/HybriLITWorkshop2025/milias/software/nwchem/packaged/nwchem-7.3.1/lib/LINUX64 -L/zfs/scratch/HybriLITWorkshop2025/milias/
software/nwchem/packaged/nwchem-7.3.1/src/tools/install/lib   -o /zfs/scratch/HybriLITWorkshop2025/milias/software/nwchem/packaged/
nwchem-7.3.1/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 -lsolvation -lnwints -lprepar -l
nwmd -lnwpw -lofpw -lpaw -lpspw -lband -lnwpwlib -lcafe -lspace -lanalyze -lqhop -lpfft -ldplot -lnwpython -ldrdy -lvscf -lqmmm -lq
md -letrans -lpspw -ltce -lbq -lmm -lcons -lperfm -ldntmc -lccca -ldimqm -lfcidump -lgwmol -lbsemol -lnwcutil -lga -larmci  -lperfm
  -lpeigs_comm -lcons -lbq -lnwcutil -lelpa -L/cvmfs/hybrilit.jinr.ru/sw/slc7_x86-64/intel/oneapi/mkl/latest/lib/intel64 -lmkl_scal
apack_ilp64 -lmkl_intel_ilp64 -lmkl_core -lmkl_sequential -lmkl_blacs_intelmpi_ilp64 -lpthread -lm -ldl  -l64to32 -L/cvmfs/hybrilit

.jinr.ru/sw/slc7_x86-64/intel/oneapi/mkl/latest/lib/intel64 -lmkl_intel_ilp64 -lmkl_core -lmkl_sequential -lmkl_core -liomp5 -lpthr
ead -lm -L/cvmfs/hybrilit.jinr.ru/sw/slc7_x86-64/intel/oneapi/mkl/latest/lib/intel64 -lmkl_intel_ilp64 -lmkl_core -lmkl_sequential
-lmkl_core -liomp5 -lpthread -lm -lcomex -lmpifort -lmpi -lrt -lpthread -ldl -lmkl_intel_ilp64 -lmkl_core -lmkl_sequential -lmkl_co
re -liomp5 -lpthread -lm -lrt -lpthread -lpthread -lnwcutil -L/cvmfs/hybrilit.jinr.ru/sw/slc7_x86-64/Python/v3.10.13/lib/python3.10

/config-3.10-x86_64-linux-gnu -lpython3.10 -lcrypt -lpthread -ldl  -lutil -lm -lm   -L"/cvmfs/hybrilit.jinr.ru/sw/slc7_x86-64/intel
/oneapi/mpi/latest/lib/release" -L"/cvmfs/hybrilit.jinr.ru/sw/slc7_x86-64/intel/oneapi/mpi/latest/lib" -lmpifort -lmpi -lrt -lpthre
ad -ldl
Reply all
Reply to author
Forward
0 new messages