MRChemSoft / mrchem

MultiResolution Chemistry
GNU Lesser General Public License v3.0
28 stars 21 forks source link

Broken when mrcpp uses OpenMPI: ld: error: undefined symbol: mrcpp::SharedMemory::SharedMemory(int, int) #438

Open yurivict opened 1 year ago

yurivict commented 1 year ago
===>  Building for mrchem-1.1.0
[  5% 2/20] cd /disk-samsung/freebsd-ports/science/mrchem/work/.build/python && /usr/local/bin/cmake -E copy /disk-samsung/freebsd-ports/science/mrchem/work/mrchem-1.1.0/python/mrchem/*.py /disk-samsung/freebsd-ports/science/mrchem/work/.build/lib/python/mrchem && /usr/local/bin/cmake -E copy_directory /disk-samsung/freebsd-ports/science/mrchem/work/mrchem-1.1.0/python/mrchem/input_parser /disk-samsung/freebsd-ports/science/mrchem/work/.build/lib/python/mrchem/input_parser
[ 10% 2/20] cd /disk-samsung/freebsd-ports/science/mrchem/work/mrchem-1.1.0/cmake/custom && /usr/local/bin/cmake -DINPUT_DIR=/disk-samsung/freebsd-ports/science/mrchem/work/mrchem-1.1.0 -DTARGET_DIR=/disk-samsung/freebsd-ports/science/mrchem/work/.build -DCMAKE_SYSTEM=FreeBSD-13.1-STABLE -DCMAKE_SYSTEM_PROCESSOR=amd64 -DCMAKE_GENERATOR=Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=/usr/local/libexec/ccache/c++ -DCMAKE_CXX_COMPILER_VERSION=14.0.5 -DMRCHEM_VERSION=1.1.0 -DMW_FILTER_SOURCE_DIR= -DMW_FILTER_INSTALL_DIR= -P /disk-samsung/freebsd-ports/science/mrchem/work/mrchem-1.1.0/cmake/custom/binary-info.cmake
-- MRChem version: 1.1.0
-- Git branch: main
-- Git last commit hash: 1ec80a60fdee95b94049-dirty
-- Git last commit author: Yuri Victorovich
-- Git last commit date: Mon Nov 14 07:59:01 2022 -0800
[ 16% 3/18] cd /disk-samsung/freebsd-ports/science/mrchem/work/.build && /usr/local/bin/cmake -E touch_nocreate /disk-samsung/freebsd-ports/science/mrchem/work/mrchem-1.1.0/version.h.in
[ 22% 9/18] : && /usr/local/libexec/ccache/c++ -O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer -march=native -Wall -Wno-padded -Wno-c++98-compat -Wno-c++11-compat -Wno-unknown-pragmas -Woverloaded-virtual -Wwrite-strings -fcolor-diagnostics -O3 -DNDEBUG -L/usr/local/lib -lmrcpp -fstack-protector-strong    -Wl,-rpath=-Wl,-rpath=/usr/local/lib/gcc11 -Wl,-rpath -Wl,/usr/local/mpi/openmpi/lib -Wl,--enable-new-dtags -pthread src/CMakeFiles/mrchem.dir/driver.cpp.o src/CMakeFiles/mrchem.dir/parallel.cpp.o src/CMakeFiles/mrchem.dir/mrenv.cpp.o src/CMakeFiles/mrchem.dir/analyticfunctions/HydrogenFunction.cpp.o src/CMakeFiles/mrchem.dir/analyticfunctions/NuclearFunction.cpp.o src/CMakeFiles/mrchem.dir/analyticfunctions/NuclearGradientFunction.cpp.o src/CMakeFiles/mrchem.dir/analyticfunctions/CUBEfunction.cpp.o src/CMakeFiles/mrchem.dir/chemistry/chemistry_utils.cpp.o src/CMakeFiles/mrchem.dir/chemistry/PeriodicTable.cpp.o src/CMakeFiles/mrchem.dir/chemistry/Molecule.cpp.o src/CMakeFiles/mrchem.dir/chemistry/PhysicalConstants.cpp.o src/CMakeFiles/mrchem.dir/environment/Cavity.cpp.o src/CMakeFiles/mrchem.dir/environment/Permittivity.cpp.o src/CMakeFiles/mrchem.dir/environment/SCRF.cpp.o src/CMakeFiles/mrchem.dir/mrdft/Factory.cpp.o src/CMakeFiles/mrchem.dir/mrdft/MRDFT.cpp.o src/CMakeFiles/mrchem.dir/mrdft/Functional.cpp.o src/CMakeFiles/mrchem.dir/mrdft/LDA.cpp.o src/CMakeFiles/mrchem.dir/mrdft/SpinLDA.cpp.o src/CMakeFiles/mrchem.dir/mrdft/GGA.cpp.o src/CMakeFiles/mrchem.dir/mrdft/SpinGGA.cpp.o src/CMakeFiles/mrchem.dir/mrdft/xc_utils.cpp.o src/CMakeFiles/mrchem.dir/qmfunctions/QMFunction.cpp.o src/CMakeFiles/mrchem.dir/qmfunctions/Orbital.cpp.o src/CMakeFiles/mrchem.dir/qmfunctions/OrbitalIterator.cpp.o src/CMakeFiles/mrchem.dir/qmfunctions/Density.cpp.o src/CMakeFiles/mrchem.dir/qmfunctions/qmfunction_utils.cpp.o src/CMakeFiles/mrchem.dir/qmfunctions/orbital_utils.cpp.o src/CMakeFiles/mrchem.dir/qmfunctions/density_utils.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/QMDerivative.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/QMIdentity.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/QMPotential.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/QMSpin.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/qmoperator_utils.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/one_electron/NuclearOperator.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/one_electron/ZoraOperator.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/two_electron/CoulombPotential.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/two_electron/CoulombPotentialD1.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/two_electron/CoulombPotentialD2.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/two_electron/ExchangePotential.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/two_electron/ExchangePotentialD1.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/two_electron/ExchangePotentialD2.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/two_electron/FockBuilder.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/two_electron/XCPotential.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/two_electron/XCPotentialD1.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/two_electron/XCPotentialD2.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/two_electron/ReactionPotential.cpp.o src/CMakeFiles/mrchem.dir/scf_solver/Accelerator.cpp.o src/CMakeFiles/mrchem.dir/scf_solver/GroundStateSolver.cpp.o src/CMakeFiles/mrchem.dir/scf_solver/HelmholtzVector.cpp.o src/CMakeFiles/mrchem.dir/scf_solver/KAIN.cpp.o src/CMakeFiles/mrchem.dir/scf_solver/LinearResponseSolver.cpp.o src/CMakeFiles/mrchem.dir/scf_solver/SCFSolver.cpp.o src/CMakeFiles/mrchem.dir/tensor/RankZeroOperator.cpp.o src/CMakeFiles/mrchem.dir/tensor/RankOneOperator.cpp.o src/CMakeFiles/mrchem.dir/tensor/RankTwoOperator.cpp.o src/CMakeFiles/mrchem.dir/tensor/tensor_utils.cpp.o src/CMakeFiles/mrchem.dir/utils/print_utils.cpp.o src/CMakeFiles/mrchem.dir/utils/math_utils.cpp.o src/CMakeFiles/mrchem.dir/utils/NonlinearMaximizer.cpp.o src/CMakeFiles/mrchem.dir/utils/RRMaximizer.cpp.o src/CMakeFiles/mrchem.dir/utils/Bank.cpp.o src/CMakeFiles/mrchem.dir/utils/gto_utils/AOBasis.cpp.o src/CMakeFiles/mrchem.dir/utils/gto_utils/AOContraction.cpp.o src/CMakeFiles/mrchem.dir/utils/gto_utils/Intgrl.cpp.o src/CMakeFiles/mrchem.dir/utils/gto_utils/OrbitalExp.cpp.o src/CMakeFiles/mrchem.dir/initial_guess/chk.cpp.o src/CMakeFiles/mrchem.dir/initial_guess/core.cpp.o src/CMakeFiles/mrchem.dir/initial_guess/gto.cpp.o src/CMakeFiles/mrchem.dir/initial_guess/mw.cpp.o src/CMakeFiles/mrchem.dir/initial_guess/sad.cpp.o src/CMakeFiles/mrchem.dir/initial_guess/cube.cpp.o pilot/CMakeFiles/mrchem-pilot.x.dir/mrchem.cpp.o -o bin/mrchem-pilot.x  -Wl,-rpath,/usr/local/mpi/openmpi/lib  /usr/local/lib/libxcfun.so.2  -lc++  -lm  -lgcc  -lgcc_s  -lc  -lgcc  -lgcc_s  -lc  /usr/local/lib/libmrcpp.so.1  /usr/local/mpi/openmpi/lib/libmpi_cxx.so  /usr/local/mpi/openmpi/lib/libmpi.so && :
FAILED: bin/mrchem-pilot.x 
: && /usr/local/libexec/ccache/c++ -O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer -march=native -Wall -Wno-padded -Wno-c++98-compat -Wno-c++11-compat -Wno-unknown-pragmas -Woverloaded-virtual -Wwrite-strings -fcolor-diagnostics -O3 -DNDEBUG -L/usr/local/lib -lmrcpp -fstack-protector-strong    -Wl,-rpath=-Wl,-rpath=/usr/local/lib/gcc11 -Wl,-rpath -Wl,/usr/local/mpi/openmpi/lib -Wl,--enable-new-dtags -pthread src/CMakeFiles/mrchem.dir/driver.cpp.o src/CMakeFiles/mrchem.dir/parallel.cpp.o src/CMakeFiles/mrchem.dir/mrenv.cpp.o src/CMakeFiles/mrchem.dir/analyticfunctions/HydrogenFunction.cpp.o src/CMakeFiles/mrchem.dir/analyticfunctions/NuclearFunction.cpp.o src/CMakeFiles/mrchem.dir/analyticfunctions/NuclearGradientFunction.cpp.o src/CMakeFiles/mrchem.dir/analyticfunctions/CUBEfunction.cpp.o src/CMakeFiles/mrchem.dir/chemistry/chemistry_utils.cpp.o src/CMakeFiles/mrchem.dir/chemistry/PeriodicTable.cpp.o src/CMakeFiles/mrchem.dir/chemistry/Molecule.cpp.o src/CMakeFiles/mrchem.dir/chemistry/PhysicalConstants.cpp.o src/CMakeFiles/mrchem.dir/environment/Cavity.cpp.o src/CMakeFiles/mrchem.dir/environment/Permittivity.cpp.o src/CMakeFiles/mrchem.dir/environment/SCRF.cpp.o src/CMakeFiles/mrchem.dir/mrdft/Factory.cpp.o src/CMakeFiles/mrchem.dir/mrdft/MRDFT.cpp.o src/CMakeFiles/mrchem.dir/mrdft/Functional.cpp.o src/CMakeFiles/mrchem.dir/mrdft/LDA.cpp.o src/CMakeFiles/mrchem.dir/mrdft/SpinLDA.cpp.o src/CMakeFiles/mrchem.dir/mrdft/GGA.cpp.o src/CMakeFiles/mrchem.dir/mrdft/SpinGGA.cpp.o src/CMakeFiles/mrchem.dir/mrdft/xc_utils.cpp.o src/CMakeFiles/mrchem.dir/qmfunctions/QMFunction.cpp.o src/CMakeFiles/mrchem.dir/qmfunctions/Orbital.cpp.o src/CMakeFiles/mrchem.dir/qmfunctions/OrbitalIterator.cpp.o src/CMakeFiles/mrchem.dir/qmfunctions/Density.cpp.o src/CMakeFiles/mrchem.dir/qmfunctions/qmfunction_utils.cpp.o src/CMakeFiles/mrchem.dir/qmfunctions/orbital_utils.cpp.o src/CMakeFiles/mrchem.dir/qmfunctions/density_utils.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/QMDerivative.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/QMIdentity.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/QMPotential.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/QMSpin.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/qmoperator_utils.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/one_electron/NuclearOperator.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/one_electron/ZoraOperator.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/two_electron/CoulombPotential.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/two_electron/CoulombPotentialD1.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/two_electron/CoulombPotentialD2.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/two_electron/ExchangePotential.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/two_electron/ExchangePotentialD1.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/two_electron/ExchangePotentialD2.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/two_electron/FockBuilder.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/two_electron/XCPotential.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/two_electron/XCPotentialD1.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/two_electron/XCPotentialD2.cpp.o src/CMakeFiles/mrchem.dir/qmoperators/two_electron/ReactionPotential.cpp.o src/CMakeFiles/mrchem.dir/scf_solver/Accelerator.cpp.o src/CMakeFiles/mrchem.dir/scf_solver/GroundStateSolver.cpp.o src/CMakeFiles/mrchem.dir/scf_solver/HelmholtzVector.cpp.o src/CMakeFiles/mrchem.dir/scf_solver/KAIN.cpp.o src/CMakeFiles/mrchem.dir/scf_solver/LinearResponseSolver.cpp.o src/CMakeFiles/mrchem.dir/scf_solver/SCFSolver.cpp.o src/CMakeFiles/mrchem.dir/tensor/RankZeroOperator.cpp.o src/CMakeFiles/mrchem.dir/tensor/RankOneOperator.cpp.o src/CMakeFiles/mrchem.dir/tensor/RankTwoOperator.cpp.o src/CMakeFiles/mrchem.dir/tensor/tensor_utils.cpp.o src/CMakeFiles/mrchem.dir/utils/print_utils.cpp.o src/CMakeFiles/mrchem.dir/utils/math_utils.cpp.o src/CMakeFiles/mrchem.dir/utils/NonlinearMaximizer.cpp.o src/CMakeFiles/mrchem.dir/utils/RRMaximizer.cpp.o src/CMakeFiles/mrchem.dir/utils/Bank.cpp.o src/CMakeFiles/mrchem.dir/utils/gto_utils/AOBasis.cpp.o src/CMakeFiles/mrchem.dir/utils/gto_utils/AOContraction.cpp.o src/CMakeFiles/mrchem.dir/utils/gto_utils/Intgrl.cpp.o src/CMakeFiles/mrchem.dir/utils/gto_utils/OrbitalExp.cpp.o src/CMakeFiles/mrchem.dir/initial_guess/chk.cpp.o src/CMakeFiles/mrchem.dir/initial_guess/core.cpp.o src/CMakeFiles/mrchem.dir/initial_guess/gto.cpp.o src/CMakeFiles/mrchem.dir/initial_guess/mw.cpp.o src/CMakeFiles/mrchem.dir/initial_guess/sad.cpp.o src/CMakeFiles/mrchem.dir/initial_guess/cube.cpp.o pilot/CMakeFiles/mrchem-pilot.x.dir/mrchem.cpp.o -o bin/mrchem-pilot.x  -Wl,-rpath,/usr/local/mpi/openmpi/lib  /usr/local/lib/libxcfun.so.2  -lc++  -lm  -lgcc  -lgcc_s  -lc  -lgcc  -lgcc_s  -lc  /usr/local/lib/libmrcpp.so.1  /usr/local/mpi/openmpi/lib/libmpi_cxx.so  /usr/local/mpi/openmpi/lib/libmpi.so && :
ld: error: undefined symbol: mrcpp::SharedMemory::SharedMemory(int, int)
>>> referenced by QMFunction.cpp
>>>               src/CMakeFiles/mrchem.dir/qmfunctions/QMFunction.cpp.o:(mrchem::ComplexFunction::ComplexFunction(bool))
>>> referenced by QMFunction.cpp
>>>               src/CMakeFiles/mrchem.dir/qmfunctions/QMFunction.cpp.o:(mrchem::ComplexFunction::ComplexFunction(bool))
c++: error: linker command failed with exit code 1 (use -v to see invocation)

libmrcpp.so doesn't define mrcpp::SharedMemory::SharedMemory(int, int) - it is missing in the source code both in mrcpp-1.4.1 and in its current revision. OpenMPI is used if this matters.

Version: 1.1.0 mrcpp-1.4.1 clang-14 FreeBSD 13.1

stigrj commented 1 year ago

Hi Yuri, how did you provide mrcpp in this case? Did you compile it separately first and link it manually to mrchem, or was it fetched and compiled automatically when you tried to build mrchem?