Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compilation problem for libint2 interface to Quax #1

Open
binghuang2018 opened this issue Jul 26, 2021 · 3 comments
Open

compilation problem for libint2 interface to Quax #1

binghuang2018 opened this issue Jul 26, 2021 · 3 comments

Comments

@binghuang2018
Copy link

binghuang2018 commented Jul 26, 2021

Hi,

I followed exactly what's told in the github page of Quax for installation, with the only exception of support for a larger angular momentum (=4), i.e., while exporting libint2, I used

 ../configure --prefix=/home/bing/src/libint/build/quax --with-max-am=4 --with-opt-am=0 --enable-1body=4 --enable-eri=4 --with-multipole-max-order=0 --enable-eri3=no --enable-eri2=no --enable-g12=no --enable-g12dkh=no --with-pic --enable-static --enable-single-evaltype --enable-generic-code --disable-unrolling

Whie compiling the libint2 interface to Quax, I encounter the following error:

(quax) bing@li:~/src/Quax/quax/external_integrals$ make
g++ libint_interface.o -o libint_interface.cpython-37m-x86_64-linux-gnu.so -O3 -fPIC -mcmodel=large -shared -std=c++11 -I /home/bing/miniconda3/envs/quax/opt/libint/2.7.0-beta.6-ninja-lmax4-deriv4/include -I /home/bing/miniconda3/envs/quax/opt/libint/2.7.0-beta.6-ninja-lmax4-deriv4/include/libint2 -I /home/bing/miniconda3/envs/quax/include/eigen3 -I /home/bing/miniconda3/envs/quax/include/python3.7m -I /home/bing/miniconda3/envs/quax/lib/python3.7/site-packages/pybind11/include -I /home/bing/miniconda3/envs/quax/include -L /home/bing/miniconda3/envs/quax/opt/libint/2.7.0-beta.6-ninja-lmax4-deriv4/lib -lint2 -L /home/bing/miniconda3/envs/quax/lib -lhdf5_cpp -lhdf5 -lpthread -Wl,-rpath,"/home/bing/miniconda3/envs/quax/lib"
/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o: in function `_init':
(.init+0xb): relocation truncated to fit: R_X86_64_REX_GOTPCRELX against undefined symbol `__gmon_start__'
libint_interface.o: in function `finalize()':
libint_interface.cc:(.text+0x3): relocation truncated to fit: R_X86_64_REX_GOTPCRELX against symbol `libint2::detail::managed_singleton<libint2::detail::__initializer>::instance_' defined in .bss._ZN7libint26detail17managed_singletonINS0_13__initializerEE9instance_E[_ZN7libint26detail17managed_singletonINS0_13__initializerEE9instance_E] section in libint_interface.o
libint_interface.cc:(.text+0x27): relocation truncated to fit: R_X86_64_REX_GOTPCRELX against symbol `libint2::detail::verbose_accessor()::value' defined in .bss._ZZN7libint26detail16verbose_accessorEvE5value[_ZZN7libint26detail16verbose_accessorEvE5value] section in libint_interface.o
libint_interface.cc:(.text+0x34): relocation truncated to fit: R_X86_64_REX_GOTPCRELX against symbol `std::clog@@GLIBCXX_3.4' defined in .bss section in /home/bing/miniconda3/envs/quax/lib/libstdc++.so
libint_interface.cc:(.text+0x3b): relocation truncated to fit: R_X86_64_REX_GOTPCRELX against symbol `libint2::detail::verbose_stream_accessor()::value' defined in .data.rel._ZZN7libint26detail23verbose_stream_accessorEvE5value[_ZZN7libint26detail23verbose_stream_accessorEvE5value] section in libint_interface.o
libint_interface.o: in function `libint2::os_core_ints::delta_gm_eval<double>::operator()(double*, double, double, int) const [clone .isra.249]':
libint_interface.cc:(.text+0x60): relocation truncated to fit: R_X86_64_PC32 against `.LC6'
libint_interface.cc:(.text+0x8c): relocation truncated to fit: R_X86_64_PC32 against `.LC7'
libint_interface.o: in function `void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char const*>(char const*, char const*, std::forward_iterator_tag) [clone .isra.693]':
libint_interface.cc:(.text+0x23b): relocation truncated to fit: R_X86_64_PC32 against `.LC10'
libint_interface.o: in function `void libint2::GaussianGmEval<double, 0>::eval<double>(double*, double, double, unsigned long, std::vector<std::pair<double, double>, std::allocator<std::pair<double, double> > > const&, void*) [clone .constprop.1404]':
libint_interface.cc:(.text+0x32d): relocation truncated to fit: R_X86_64_PC32 against `.LC15'
libint_interface.cc:(.text+0x35e): relocation truncated to fit: R_X86_64_PC32 against `.LC15'
libint_interface.cc:(.text+0x3c1): additional relocation overflows omitted from the output
libint_interface.cpython-37m-x86_64-linux-gnu.so: PC-relative offset overflow in GOT PLT entry for `libint2_need_memory_3emultipole1'
collect2: error: ld returned 1 exit status
make: *** [makefile:47: libint_interface.cpython-37m-x86_64-linux-gnu.so] Error 1

The central error message is PC-relative offset overflow in GOT PLT entry, which seems to be caused by the lack of support of large library file produced by installing libint2 (the resulting libint2.a file is of size >3GB). And by setting -mcmodel=large as option of g++ while compiling the interface does not solve the problem. Any idea to fix this issue?

Best,
Bing

@adabbott
Copy link
Collaborator

Hi @binghaung2018, unfortunately it seems that the Libint interface under these conditions (4th order derivatives up to g-basis functions) is simply too large to compile using g++. This is not an issue exclusive to Quax; I believe even a simple C++ code which imports such a large library will fail to compile. There may be some workaround with compiler tricks/ alternative compilers, but I do not have expertise in that area. I have successfully used Libint and Quax with 4th derivatives and f-functions (max angular momentum 3)... I think the g-functions just makes the library too large. Some possible solutions:

  1. Use the much slower Quax integrals for cases in which you need g-functions
  2. Consult the Libint devs to see if it is possible to reduce the Libint library size without decreasing angular momentum, deriv order
  3. Rewrite a new Quax interface to some alternative integrals library which does not have these issues (difficult)

What do you think?

@binghuang2018
Copy link
Author

binghuang2018 commented Jul 27, 2021

Hi, @adabbott, thanks for your reply! For speed, there seems to be only one viable solution: compile Libint & Libint-Quax-interface all together! Yet another approach is to compile different contributions (i.e., deriv4(i,j|1/r_12|k,l), part 1: i,j,k,l \in [S,P,D], part2: i,j,k \in [S,P,D], l \in [F,G], ...) into different library files. Of course, the latter is not trivial. Do you agree?

@ndattani
Copy link

"simply too large to compile using g++"

I love quantum chemistry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants