nwchemgit / nwchem

NWChem: Open Source High-Performance Computational Chemistry
http://nwchemgit.github.io
Other
481 stars 160 forks source link

Compile error: /usr/bin/ld: cannot find -lga /usr/bin/ld: cannot find -larmci /usr/bin/ld: cannot find -lcomex #979

Closed davidcb98 closed 4 days ago

davidcb98 commented 5 days ago

Hi,

I'm triying to compile nwchem with MPI5 and gcc13.2.0. Here my command:

wget https://github.com/nwchemgit/nwchem/releases/download/v7.2.2-release/nwchem-7.2.2-release.revision-74936fb9-srconly.2023-11-03.tar.bz2
tar xvfj nwchem-7.2.2-release.revision-74936fb9-src.2023-11-03.tar.bz2

cd nwchem-7.2.2

export NWCHEM_TOP=/mnt/home/soft/nwchem/originals/7.2.2/nwchem-7.2.2
export NWCHEM_TARGET=LINUX64
export USE_MPI=y
export USE_MPIF=y
export DEST=/mnt/home/soft/nwchem/programs/x86_64/nwchem-7.2.2_mpi5
export USE_INTERNALBLAS=y
export NWCHEM_MODULES=all
export FORCE_MPI_ENV=y

cd $NWCHEM_TOP/src
make nwchem_config
make | tee make.log 2>&1

But I've got this error:

/mnt/home/soft/nwchem/originals/7.2.2/nwchem-7.2.2/lib/LINUX64/lib64to32.a
make[2]: Leaving directory '/mnt/home/soft/nwchem/originals/7.2.2/nwchem-7.2.2/src/64to32blas'
make[1]: Leaving directory '/mnt/home/soft/nwchem/originals/7.2.2/nwchem-7.2.2/src/64to32blas'
make nwchem.o stubs.o
make[1]: Entering directory '/mnt/home/soft/nwchem/originals/7.2.2/nwchem-7.2.2/src'
/mnt/home/soft/gcc21/programs/x86_64/gcc-13.2.0/bin/gfortran -m64 -ffast-math  -Wuninitialized -fno-aggressive-loop-optimizations -std=legacy -fdefault-integer-8 -fno-tree-dominator-opts  -g -fno-aggressive-loop-optimizations -fno-tree-dominator-opts  -g -O0 -fno-aggressive-loop-optimizations    -I. -I/mnt/home/soft/openmpi/programs/openmpi_5.0.2_gcc13.2.0_bc/include -I/mnt/home/soft/nwchem/originals/7.2.2/nwchem-7.2.2/src/include -I/mnt/home/soft/nwchem/originals/7.2.2/nwchem-7.2.2/src/tools/install/include -DGFORTRAN -DCHKUNDFLW -DGCC4 -DGCC46 -DEXT_INT -DLINUX -DLINUX64 -DPARALLEL_DIAG -DBLAS_NOTHREADS -DCOMPILATION_DATE="'`date +%a_%b_%d_%H:%M:%S_%Y`'" -DCOMPILATION_DIR="'/mnt/home/soft/nwchem/originals/7.2.2/nwchem-7.2.2'" -DNWCHEM_BRANCH="'7.2.2'"  -c -o nwchem.o nwchem.F
/mnt/home/soft/gcc21/programs/x86_64/gcc-13.2.0/bin/gfortran -m64 -ffast-math  -Wuninitialized -fno-aggressive-loop-optimizations -std=legacy -fdefault-integer-8 -fno-tree-dominator-opts  -g -fno-aggressive-loop-optimizations -fno-tree-dominator-opts  -g -O0 -fno-aggressive-loop-optimizations    -I. -I/mnt/home/soft/openmpi/programs/openmpi_5.0.2_gcc13.2.0_bc/include -I/mnt/home/soft/nwchem/originals/7.2.2/nwchem-7.2.2/src/include -I/mnt/home/soft/nwchem/originals/7.2.2/nwchem-7.2.2/src/tools/install/include -DGFORTRAN -DCHKUNDFLW -DGCC4 -DGCC46 -DEXT_INT -DLINUX -DLINUX64 -DPARALLEL_DIAG -DBLAS_NOTHREADS -DCOMPILATION_DATE="'`date +%a_%b_%d_%H:%M:%S_%Y`'" -DCOMPILATION_DIR="'/mnt/home/soft/nwchem/originals/7.2.2/nwchem-7.2.2'" -DNWCHEM_BRANCH="'7.2.2'"  -c -o stubs.o stubs.F
make[1]: Leaving directory '/mnt/home/soft/nwchem/originals/7.2.2/nwchem-7.2.2/src'
/mnt/home/soft/gcc21/programs/x86_64/gcc-13.2.0/bin/gfortran   -L/mnt/home/soft/nwchem/originals/7.2.2/nwchem-7.2.2/lib/LINUX64 -L/mnt/home/soft/nwchem/originals/7.2.2/nwchem-7.2.2/src/tools/install/lib  -o /mnt/home/soft/nwchem/originals/7.2.2/nwchem-7.2.2/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 -ldrdy -lvscf -lqmmm -lqmd -letrans -lpspw -ltce -lbq -lmm -lcons -lperfm -ldntmc -lccca -ldimqm -lfcidump -lgwmol -lnwcutil -lga -larmci -lpeigs -lperfm -lcons -lbq -lnwcutil    -l64to32 -lnwclapack  -lnwcblas   -L/mnt/home/soft/openmpi/programs/openmpi_5.0.2_gcc13.2.0_bc/lib64 -L/mnt/home/soft/openmpi/programs/openmpi_5.0.2_gcc13.2.0_bc/lib64 -lmpi_mpifh -lmpi    -lcomex -lmpi_mpifh -lmpi -lrt -lm -lpthread   
/usr/bin/ld: cannot find -lga
/usr/bin/ld: cannot find -larmci
/usr/bin/ld: cannot find -lcomex
collect2: error: ld returned 1 exit status
make: *** [GNUmakefile:35: all] Error 1

Does anyone have any idea what is going wrong?

Greetings, David

jeffhammond commented 5 days ago

Don't set FORCE_MPI_ENV=y. That requires you set things manually and know what you're doing. If you don't set it, NWChem will figure it out.

edoapra commented 5 days ago

I second @jeffhammond 's suggestion. However, you need to have the location of mpif90 in your $PATH environment variable. https://nwchemgit.github.io/Compiling-NWChem.html#automatic-detection-of-mpi-variables-with-mpif90 This could be the commands you need to execute if using bash

unset FORCE_MPI_ENV
export PATH=/mnt/home/soft/openmpi/programs/openmpi_5.0.2_gcc13.2.0_bc/bin:$PATH
edoapra commented 4 days ago

Please report your installation problems to the NWChem user group. https://groups.google.com/g/nwchem-forum

davidcb98 commented 3 days ago

Good morning,

with the changes you are telling me about, it still gives the same failure: /usr/bin/ld: cannot find -lga /usr/bin/ld: cannot find -larmci /usr/bin/ld: cannot find -lcomex

Looking for these libraries I see that they are generated by the compilation itself in the path: $NWCHEM_TOP/src/tools/install/lib64/

So what I did was, waiting for make to fail, add this new path to the LD_LIBRARY_PATH:

export LD_LIBRARY_PATH=$NWCHEM_TOP/src/tools/install/lib64/:$LD_LIBRARY_PATH

and rerun make. It compiled without errors. Now my users will let me know if it works fine.

Best regards, David

edoapra commented 3 days ago

@davidcb98 if you want to continue this issue, you would need to provide details about your compilation (linux flavor, compilers, $NWCHEM_TOP/src/tools/build/config.log, etc ...). If you are reluctant to do that, I suggest you to use the users' group, instead.