Open loriab opened 2 years ago
Ok, the error above can be fixed for the tests with LIBINT2_CONSTEXPR_STATICS=1
. But then specifically for the hartree-fock++ test, the compiled cxx lib only suceeds for Linux with conda gcc (which by default adds in extra flags -fvisibility-inlines-hidden -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /psi/toolchainconda/envs/nol2bare/include
). It fails for Linux with ubuntu gcc10, for Linux with Intel compilers, for Mac always (Apple clang and conda clang), and for Windows always (clang-cl), with the error below. I suspect some visibility attribute needs to be set on the engine header fns or in engine.cpp. A case where it worked, the enforce_params_type
showed up in the int2-cxx lib as a W
(weak) symbol, whereas a case that it didn't, it was present as a T
(text) symbol.
13: [2/2] Linking CXX executable tests/hf++-libint2
13: FAILED: tests/hf++-libint2
13: : && /Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -O3 -DNDEBUG -isysroot /Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -mmacosx-version-min=12.7 -Wl,-search_paths_first -Wl,-headerpad_max_install_names tests/CMakeFiles/hf++-libint2.dir/hartree-fock/hartree-fock++.cc.o -o tests/hf++-libint2 -Wl,-rpath,/Users/runner/work/libint/libint/build/compiler/build/src/lib/libint/library-prefix/src/library-build libint2-cxx.dylib libint2.dylib && :
13: Undefined symbols for architecture x86_64:
13: "libint2::any libint2::Engine::enforce_params_type<std::__1::vector<std::__1::pair<double, double>, std::__1::allocator<std::__1::pair<double, double> > > >(libint2::Operator, std::__1::vector<std::__1::pair<double, double>, std::__1::allocator<std::__1::pair<double, double> > > const&, bool)", referenced from:
13: libint2::Engine::Engine<std::__1::vector<std::__1::pair<double, double>, std::__1::allocator<std::__1::pair<double, double> > > >(libint2::Operator, unsigned long, int, int, double, std::__1::vector<std::__1::pair<double, double>, std::__1::allocator<std::__1::pair<double, double> > >, libint2::BraKet, libint2::ScreeningMethod) in hartree-fock++.cc.o
13: "libint2::any libint2::Engine::enforce_params_type<double>(libint2::Operator, double const&, bool)", referenced from:
13: libint2::Engine::Engine<double>(libint2::Operator, unsigned long, int, int, double, double, libint2::BraKet, libint2::ScreeningMethod) in hartree-fock++.cc.o
13: ld: symbol(s) not found for architecture x86_64
13: clang: error: linker command failed with exit code 1 (use -v to see invocation)
13: ninja: build stopped: subcommand failed.
12/13 Test #13: libint2/hf++/build ...............***Failed 24.23 sec
test 14
Start 14: libint2/hf++/run
Failed test dependencies: libint2/hf++/build
13/13 Test #14: libint2/hf++/run .................***Not Run 0.00 sec
The following tests passed:
libint2/eritest/build
libint2/hf/build
libint2/unit/build
libint2/eritest/run0
libint2/eritest/run1
libint2/eritest/run2
libint2/eritest/run3
libint2/eritest/run4
libint2/unit/run
libint2/unit/sho=gaussian/run
libint2/hf/run
85% tests passed, 2 tests failed out of 13
Total Test time (real) = 47.78 sec
The following tests FAILED:
13 - libint2/hf++/build (Failed)
14 - libint2/hf++/run (Not Run)
13: [2/2] Linking CXX executable tests/hf++-libint2
13: FAILED: tests/hf++-libint2
13: : && /usr/bin/g++-10 -g tests/CMakeFiles/hf++-libint2.dir/hartree-fock/hartree-fock++.cc.o -o tests/hf++-libint2 libint2-cxx.a libint2.a -lpthread && :
13: /usr/bin/ld: tests/CMakeFiles/hf++-libint2.dir/hartree-fock/hartree-fock++.cc.o: in function `libint2::Engine::Engine<std::vector<std::pair<double, double>, std::allocator<std::pair<double, double> > > >(libint2::Operator, unsigned long, int, int, double, std::vector<std::pair<double, double>, std::allocator<std::pair<double, double> > >, libint2::BraKet, libint2::ScreeningMethod)':
13: /home/runner/work/libint/libint/build/compiler/build/src/lib/libint/library-prefix/src/library/include/libint2/engine.h:518: undefined reference to `libint2::any libint2::Engine::enforce_params_type<std::vector<std::pair<double, double>, std::allocator<std::pair<double, double> > > >(libint2::Operator, std::vector<std::pair<double, double>, std::allocator<std::pair<double, double> > > const&, bool)'
13: /usr/bin/ld: tests/CMakeFiles/hf++-libint2.dir/hartree-fock/hartree-fock++.cc.o: in function `libint2::Engine::Engine<double>(libint2::Operator, unsigned long, int, int, double, double, libint2::BraKet, libint2::ScreeningMethod)':
13: /home/runner/work/libint/libint/build/compiler/build/src/lib/libint/library-prefix/src/library/include/libint2/engine.h:518: undefined reference to `libint2::any libint2::Engine::enforce_params_type<double>(libint2::Operator, double const&, bool)'
13: collect2: error: ld returned 1 exit status
13: ninja: build stopped: subcommand failed.
6/17 Test #13: libint2/hf++/build ...............***Failed 18.07 sec
...
The following tests FAILED:
13 - libint2/hf++/build (Failed)
14 - libint2/hf++/run (Not Run)
I haven't investigated much (nor, clearly, worked out the defines), but there may be some header inclusions not quite working for the compiled c++11 interface. Is this in use downstream in its current form? (Note: this refers to #233; feature not present in master.)