Coder Social home page Coder Social logo

evaleev / libint Goto Github PK

View Code? Open in Web Editor NEW
218.0 25.0 97.0 62.22 MB

Libint: high-performance library for computing Gaussian integrals in quantum mechanics

License: Other

Makefile 0.08% Shell 0.73% Perl 0.03% C++ 91.36% C 0.05% Python 0.05% M4 0.13% Mathematica 7.43% Fortran 0.06% CMake 0.08%

libint's Introduction

Libint - a library for the evaluation of molecular integrals of many-body operators over Gaussian functions

See the wiki for the installation and usage instructions.

Copyright (C) 2004-2024 Edward F. Valeev

libint's People

Contributors

adabbott avatar ajaypanyala avatar asadchev avatar bmwiedemann avatar calewis avatar certik avatar e-kwsm avatar evaleev avatar francesco-bosia avatar jdullea avatar jdwhitfield avatar jfermann avatar jonathonmisiewicz avatar justusc avatar kshitij-05 avatar ktns avatar loriab avatar mbanck-ntap avatar mclement1 avatar mehdichinoune avatar mfherbst avatar pchong90 avatar pseewald avatar roman-ellerbrock avatar samslattery avatar susilehtola avatar swillow avatar tjira avatar wavefunction91 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libint's Issues

Hartree-Fock++ convergence issues.

hartreefock++ has developed convergence issues the last know working commit was c1be4f6, but it is likely that the change is actually much much farther along.

For example the following file has a very hard time converging in an aug-cc-pvdz basis.

15

O       99.814000000   100.835000000   101.232000000
H       99.329200000    99.976800000   101.063000000
H       99.151600000   101.561000000   101.414000000
O       98.804000000    98.512200000    97.758100000
H       99.782100000    98.646900000    97.916700000
H       98.421800000    99.326500000    97.321300000
O       98.070300000    98.516900000   100.438000000
H       97.172800000    98.878600000   100.690000000
H       98.194000000    98.592200000    99.448100000
O      102.360000000   101.551000000    99.964500000
H      102.675000000   102.370000000   100.444000000
H      101.556000000   101.180000000   100.430000000
O      101.665000000    98.316100000    98.319400000
H      101.904000000    99.233800000    98.002000000
H      102.224000000    97.640900000    97.837700000

The current code converges to
Hartree-Fock energy = -380.204496584440 after 79 iterations, but in the process goes as low as -407.002840370861 and as high as -350.927524169782

The old code converges to
Hartree-Fock energy = -380.204496984182 after 16 iterations.

The issue seems to be related to the 2 electron integrals but it is hard to be sure without further testing.

Hartree-Fock++ converges to wrong energy for larger basis sets

For the following xyz
8 188.621123397337 190.550533770518 191.30075504197
1 187.704984172148 188.928770810416 190.981391326919
1 187.369368812425 191.922474936952 191.644685196641

hartree-fock++ converges to the following values with the following basis sets.

cc-pvdz -76.020385367543
aug-cc-pvdz -76.035015648180
cc-pvtz -87.255745561062
aug-cc-pvtz -152.712575114366
cc-pvqz -427.273920252570
cc-pv5z -2991.435934147652
def2-tzvp -77.611423526074
def2-qzvp -479.029879230563

Also here is the output from the cc-pv5z job

$ ./hartree-fock++ ~/libint_densities/water_clusters/002.xyz cc-pv5z
Will read geometry from /hyades/home/valeev/calewis/libint_densities/water_clusters/002.xyz
Will scale over 1 C++11 threads
Nuclear repulsion energy = 8.79298854522529
Will read basis set from /hyades/home/valeev/calewis/software/libint/tests/hartree-fock/../../lib/basis/cc-pv5z.g94
8 188.621123397337 190.550533770518 191.30075504197
1 187.704984172148 188.928770810416 190.981391326919
1 187.369368812425 191.922474936952 191.644685196641
basis rank = 201
Will read basis set from /hyades/home/valeev/calewis/software/libint/tests/hartree-fock/../../lib/basis/sto-3g.g94
projecting SOAD into AO basis ... done (1.829091491 s)
computing Schwartz bound prerequisites ... done (0.131248579 s)
compute_2body_fock:precision = 1e-07
TwoBodyEngine::precision = 2.22044604925031e-16
of integrals = 215970169

Iter E(HF) D(E)/E RMS([F,D])/nn Time(s)
01 -2991.389882424771 1.000000000000e+00 7.527681083732e-06 20.66235
== started incremental fock build
compute_2body_fock:precision = 7.52768108373245e-10
TwoBodyEngine::precision = 2.22044604925031e-16
of integrals = 215908544
02 -2991.435890869857 1.533497840823e-05 1.660383669979e-08 20.75870
== reset incremental fock build
compute_2body_fock:precision = 1.66038366997947e-12
TwoBodyEngine::precision = 2.22044604925031e-16
of integrals = 216384475
03 -2991.435933307456 1.414478696626e-08 2.792366839652e-10 20.73737
== reset incremental fock build
compute_2body_fock:precision = 2.79236683965171e-14
TwoBodyEngine::precision = 2.22044604925031e-16
of integrals = 216387520
04 -2991.435933818724 1.704096295176e-10 4.323184290633e-13 20.68506
== reset incremental fock build
compute_2body_fock:precision = 2.22044604925031e-16
TwoBodyEngine::precision = 2.22044604925031e-16
of integrals = 216387864
05 -2991.435934148219 1.098232609177e-10 1.673630237642e-13 20.68622
compute_2body_fock:precision = 2.22044604925031e-16
TwoBodyEngine::precision = 2.22044604925031e-16
of integrals = 215705295
06 -2991.435934147652 1.887057509417e-13 3.691146721761e-14 20.69161
** edipole = -1880.49806098835 -1904.08104029936 -1912.63352187691
** equadrupole = -353652.1125397 -358060.748529734 -359670.022198591 -362592.269863676 -364186.499345319 -365836.719111278
** Hartree-Fock energy = -2991.435934147652

--with-cxxgen-optflags appears to not be picked up by configure.

The commit is 9acc121 in the group software directory on NewRiver.

When using the following configure command:

$SOURCE_DIR/configure --prefix=$INSTALL_DIR CXX=${GCC_BIN}/g++ CXXFLAGS='-O1 -std=c++11' --with-cxxgen="icpc -gcc-name=${GCC_DIR}/bin/g++" --with-cxxgen-optflags='--std=c++11 -O1 -xHOST' LDFLAGS=-L${SOFTWARE}/gnu/lib CPPFLAGS="-I${SOFTWARE}/gnu/include -I${SOFTWARE}/boost/1.59.0/include -I${SOFTWARE}/eigen/3.2.5" '--with-max-am=6' '--with-opt-am=3' --enable-eri=0 --enable-eri3=0 --enable-eri2=0 --enable-1body=0 --enable-fma --disable-static --enable-shared

The following warning is obtained in the output. This warning goes away if CXXGENFLAGS is used instead of --with-cxxgen-optflags

configure: WARNING: C++ optimization options are not given! For optimum performance give CXXGENFLAGS or use --with-cxxgen-optflags configure option

Make Export Failure

As of fbcbb46, I obtain the followng error when attempting to export the Libint build

$ make export
...
/home/dbwy/git_repo/libint/build_gcc_libint/export/../config.status --config > ../libint-2.1.0-beta2/compiler.config
config.status: error: unrecognized option: --config
Try `/home/dbwy/git_repo/libint/build_gcc_libint/export/../config.status --help' for more information.

The compilation completes successfully. I configured with the following
$HOME/git_repo/libint/configure
--enable-eri=1
--with-max-am=7
--with-opt-am=4
--disable-unrolling
--enable-generic-code
--enable-contracted-ints
--with-incdirs=-I/usr/include/eigen3
--with-cxx=/home/dbwy/gcc-4.9.2/bin/g++
--with-cxx-optflags="-std=c++11 -O3 -mavx -march=native"
--with-cxxgen-optflags="-std=c++11 -O3 -mavx -march=native"

libint2::OneBodyEngine d function error

The OneBodyEngine seems to have an error in the building of (d | Operator | d) functions. Computing the overlap matrix for 1 d function at the origin with Using code which calls the OneBodyEngine, run on 1 d function at the origin with

Shell:( O={0,0,0}
{l=2,sph=0}
1.057 1

The library returns an overlap matrix:

   1.0000        0        0   0.3333        0   0.3333
        0   0.3333        0        0        0        0
        0        0   0.3333        0        0        0
   0.3333        0        0   1.0000        0   0.3333
        0        0        0        0   0.3333        0
   0.3333        0        0   0.3333        0   1.0000

Which I have compared to the same matrix in Q-Chem (I should note here that the ordering of the components is different, but that this doesn't affect the conclusion):

   1.0000        0        0   0.3333        0   0.3333
        0   1.0000        0        0        0        0
        0        0   1.0000        0        0        0
   0.3333        0        0   1.0000        0   0.3333
        0        0        0        0   1.0000        0
   0.3333        0        0   0.3333        0   1.0000

In order to avoid potential errors in how I call the code I compiled tests/hartree-fock/hartree-fock.cc using the same library. The only edits I made were to change to using the aug-cc-pVDZ basis. When this is run with the core hamiltonian guess for water one obtains an energy of -98.200180292854 Hartrees on the second cycle which is clearly not variational. I believe this is due to the error in the one electron integrals.

I compiled the library with
./configure --enable-eri=0 --with-max-am=4 --with-opt-am=4 --disable-unrolling --enable-generic-code --enable-contracted-ints

And am using icc --version
icc (ICC) 15.0.0 20140716
Copyright (C) 1985-2014 Intel Corporation. All rights reserved.

Segfault in OneBodyEngine when computing overlap integral

This might due to the previous commit.

backtrace:

error: libMADworld.0.dylib debug map object file '/Users/ChongPeng/Workspace/Development/build/tiledarray_build/external/build/madness/src/madness/world/.libs/libMADworld_la-world.o' has changed (actual time is 0x567064b3, debug map time is 0x5669d32e) since this executable was linked, file will be ignored
error: libMADworld.0.dylib debug map object file '/Users/ChongPeng/Workspace/Development/build/tiledarray_build/external/build/madness/src/madness/world/.libs/libMADworld_la-worldgop.o' has changed (actual time is 0x567064b9, debug map time is 0x5669d331) since this executable was linked, file will be ignored
* thread #1: tid = 0x23f605, 0x00007fff95ab1d4e libsystem_platform.dylib`_platform_bzero$VARIANT$Merom + 94, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x20)
  * frame #0: 0x00007fff95ab1d4e libsystem_platform.dylib`_platform_bzero$VARIANT$Merom + 94
    frame #1: 0x000000010019952d ccsd`void libint2::solidharmonics::transform_last<double>(n1=1, l=2, src=0x0000000103e030b0, tgt=0x0000000000000000) + 125 at solidharmonics.h:375
    frame #2: 0x00000001001df32c ccsd`void libint2::solidharmonics::tform_cols<double>(nrow=1, l_col=2, source_blk=0x0000000103e030b0, target_blk=0x0000000000000000) + 44 at solidharmonics.h:500
    frame #3: 0x00000001001dde39 ccsd`libint2::OneBodyEngine::compute(this=0x0000000105f9f900, s1=0x0000000106001000, s2=0x0000000103e02b20) + 4729 at engine.h:420
    frame #4: 0x00000001001dca35 ccsd`mpqc::integrals::detail::shell_set(e=0x0000000105f9f900, s0=0x0000000106001000, s1=0x0000000103e02b20) + 37 at task_integral_kernels.h:51
    frame #5: 0x00000001001dc622 ccsd`TiledArray::Tensor<double, Eigen::aligned_allocator<double> > mpqc::integrals::detail::integral_kernel<libint2::OneBodyEngine>(eng=0x0000000105f9f900, rng=0x00007fff5fbfb630, shell_ptrs=array<const std::__1::vector<libint2::Shell, std::__1::allocator<libint2::Shell> > *, 2> @ 0x00007fff5fbfb378, (null)=0x0000000103e0b668) + 1234 at task_integral_kernels.h:138
    frame #6: 0x00000001001dc0ea ccsd`mpqc::integrals::IntegralBuilder<2ul, libint2::OneBodyEngine, mpqc::integrals::TensorPassThrough>::integrals(this=0x0000000103e02da8, idx=size=2, range=Range @ 0x00007fff5fbfb630) + 394 at integral_builder.h:88
    frame #7: 0x00000001001dbd2d ccsd`_ZZN4mpqc9integrals16sparse_integralsIN7libint213OneBodyEngineELm2ENS0_17TensorPassThroughEEEN10TiledArray5ArrayIdXT0_EDTclclsr3stdE7declvalIT1_EEclL_ZNSt3__17declvalINS5_6TensorIdN5Eigen17aligned_allocatorIdEEEEEENS8_20add_rvalue_referenceIT_E4typeEvEEEENS5_12SparsePolicyEEERN7madness5WorldENS8_10shared_ptrINS0_10EnginePoolISG_EEEERKNS8_5arrayINS_5basis5BasisEXT0_EEENSP_INS0_8ScreenerEEES7_ENKUlxNS8_6vectorImNS8_9allocatorImEEEENS5_5RangeEPNSA_IfNSC_IfEEEEPSE_E_clExS14_S15_S18_S19_(this=0x00007fff5fbfb800, ord=1, idx=size=2, rng=<unavailable>, tile_norms_ptr=0x00007fff5fbfbd78, out_tile=0x0000000103e0b5e0) + 109 at task_integrals.h:174
    frame #8: 0x00000001001dbc50 ccsd`_ZN7madness6detail12run_functionIZN4mpqc9integrals16sparse_integralsIN7libint213OneBodyEngineELm2ENS3_17TensorPassThroughEEEN10TiledArray5ArrayIdXT0_EDTclclsr3stdE7declvalIT1_EEclL_ZNSt3__17declvalINS8_6TensorIdN5Eigen17aligned_allocatorIdEEEEEENSB_20add_rvalue_referenceIT_E4typeEvEEEENS8_12SparsePolicyEEERNS_5WorldENSB_10shared_ptrINS3_10EnginePoolISJ_EEEERKNSB_5arrayINS2_5basis5BasisEXT0_EEENSR_INS3_8ScreenerEEESA_EUlxNSB_6vectorImNSB_9allocatorImEEEENS8_5RangeEPNSD_IfNSF_IfEEEEPSH_E_NS0_9ArgHolderImEENS1D_IS16_EENS1D_IS17_EENS1D_IS1A_EENS1D_IS1B_EEEENSB_9enable_ifIXsr3std7is_voidINS0_9result_ofISJ_vE4typeEEE5valueEvE4typeERNS_6FutureIvEESJ_RT0_RSA_RT2_RT3_RT4_RKS1Q_S22_S22_S22_(result=0x0000000105fa2be0, fn=mpqc::integrals::(anonymous class) @ 0x00007fff5fbfb800, a1=0x0000000105fa2bf8, a2=0x0000000105fa2c00, a3=0x0000000105fa2c18, a4=0x0000000105fa2c38, a5=0x0000000105fa2c40, (null)=0x0000000105fa2c48, (null)=0x0000000105fa2c49, (null)=0x0000000105fa2c4a, (null)=0x0000000105fa2c4b) + 272 at taskfn.h:270
    frame #9: 0x00000001001db866 ccsd`_ZN7madness6TaskFnIZN4mpqc9integrals16sparse_integralsIN7libint213OneBodyEngineELm2ENS2_17TensorPassThroughEEEN10TiledArray5ArrayIdXT0_EDTclclsr3stdE7declvalIT1_EEclL_ZNSt3__17declvalINS7_6TensorIdN5Eigen17aligned_allocatorIdEEEEEENSA_20add_rvalue_referenceIT_E4typeEvEEEENS7_12SparsePolicyEEERNS_5WorldENSA_10shared_ptrINS2_10EnginePoolISI_EEEERKNSA_5arrayINS1_5basis5BasisEXT0_EEENSQ_INS2_8ScreenerEEES9_EUlxNSA_6vectorImNSA_9allocatorImEEEENS7_5RangeEPNSC_IfNSE_IfEEEEPSG_E_mS15_S16_S19_S1A_vvvvE7executeEv(this=0x0000000105fa2b40) + 214 at taskfn.h:614
    frame #10: 0x00000001033cbd83 libtbb.dylib`tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::local_wait_for_all(tbb::task&, tbb::task*) + 1237
    frame #11: 0x000000010331823e libMADworld.0.dylib`tbb::task::wait_for_all() + 62
    frame #12: 0x000000010331a2b4 libMADworld.0.dylib`madness::ThreadPool::run_task() + 164
    frame #13: 0x000000010333f955 libMADworld.0.dylib`void madness::ThreadPool::await<madness::WorldTaskQueue::ProbeAllDone>(madness::WorldTaskQueue::ProbeAllDone const&, bool) + 101
    frame #14: 0x000000010333f3fa libMADworld.0.dylib`madness::WorldTaskQueue::fence() + 58
    frame #15: 0x000000010333edc3 libMADworld.0.dylib`madness::WorldGopInterface::fence() + 483
    frame #16: 0x000000010002bddc ccsd`_ZN4mpqc9integrals16sparse_integralsIN7libint213OneBodyEngineELm2ENS0_17TensorPassThroughEEEN10TiledArray5ArrayIdXT0_EDTclclsr3stdE7declvalIT1_EEclL_ZNSt3__17declvalINS5_6TensorIdN5Eigen17aligned_allocatorIdEEEEEENS8_20add_rvalue_referenceIT_E4typeEvEEEENS5_12SparsePolicyEEERN7madness5WorldENS8_10shared_ptrINS0_10EnginePoolISG_EEEERKNS8_5arrayINS_5basis5BasisEXT0_EEENSP_INS0_8ScreenerEEES7_(world=0x0000000103a012d0, shr_pool=nullptr, bases=0x00007fff5fbfd9f8, screen=nullptr, op=TensorPassThrough @ 0x00007fff5fbfbe20) + 1804 at task_integrals.h:196
    frame #17: 0x0000000100012839 ccsd`try_main(argc=2, argv=0x00007fff5fbfeed8, world=0x0000000103a012d0) + 8937 at ccsd.cpp:322
    frame #18: 0x0000000100015ea0 ccsd`main(argc=2, argv=0x00007fff5fbfeed8) + 64 at ccsd.cpp:487
    frame #19: 0x00007fff9b9765ad libdyld.dylib`start + 1
    frame #20: 0x00007fff9b9765ad libdyld.dylib`start + 1

The function that gives segfault:

frame #1: 0x000000010019952d ccsd`void libint2::solidharmonics::transform_last<double>(n1=1, l=2, src=0x0000000103e030b0, tgt=0x0000000000000000) + 125 at solidharmonics.h:375
   372  
   373        const auto nc = (l+1)*(l+2)/2;
   374        const auto n = 2*l+1;
-> 375        memset(tgt,0,n1*n*sizeof(Real));
   376  
   377        // loop over shg
   378        for(size_t s=0; s!=n; ++s) {

in here, tgt is a null pointer

(lldb) p tgt
(double *) $0 = 0x0000000000000000

this is due to the fact that the scratch2_ member in OneNodyEngine is initialized as null pointer from function reset_scratch

      void reset_scratch() {
        const auto ncart_max = (lmax_+1)*(lmax_+2)/2;
        const auto target_shellset_size = nshellsets() * ncart_max * ncart_max;
        // need to be able to hold 2 sets of target shellsets: the worst case occurs when dealing with
        // 1-body Coulomb ints derivatives ... have 2+natom derivative sets that are stored in scratch
        // then need to transform to solids. To avoid copying back and forth make sure that there is enough
        // room to transform all ints and save them in correct order in single pass
        const auto need_extra_large_scratch = stack_size_ < target_shellset_size;
        scratch_.resize(need_extra_large_scratch ? 2*target_shellset_size : target_shellset_size);
        scratch2_ = need_extra_large_scratch ? &scratch_[target_shellset_size] : primdata_[0].stack;
      }

in the debugger, it shows that

ncart_max = 10
target_shellset_size = 100
need_extra_large_scratch = false

the member in OneBodyEngine has the following value

type_ = overlap
primdata_  = std::vector<(anonymous struct)>
stack_size_ = 140734799793760
lmax_ = 3
hard_lmax_ = 1
deriv_order_ = 0

in the constructor of the engine

max_nprim = 8
max_l = 3
deriv_order = 0

I notice that, in function initialize(), reset_scratch() is called before stack_size_is set, but in reset_scratch() stack_size_ is used for comparison. Is this the problem?

let me know if I need to provide more information

Renormalization of Shells is incorrect

I've just recently bumped the libint changeset in liresearchgroup/chronusq, and the shell renormalization not longer gives the correct result. When I updated the changeset, it would no longer compile as the libint2::Shell::renorm() function has been made private (I was previously calling it explicitly). As I remembered that we (@evaleev) had spoken about this (and that @evaleev mentioned that one does not need to call this explicitly anymore), I removed the call, and compilation went smoothly. I then ran the unit tests, and every single one failed. I've narrowed it down to (at least) the renormalization of the shells:

O/STO-3G
Unnormalized Contraction Coefficients for 1S: 0.15432987 0.53532814 0.4446354
Normalized Contraction Coefficients (old) 1S: 4.251943 4.112294 1.281623
Normalized Contraction Coefficients (new) 1S: 14.112938 3.8055732 0.445048

H2O/STO-3G SCF (old) -74.9420798968
H2O/STO-3G SCF (new) -36.8001562256 (it's not half, just close)

Is there something that needs to be done viz renormalization even now?

Undefined reference to init and cleanup of emultipole(1,2)

This problem only manifests without the -fpermissive flag (mysteriously slips by with -fpermissive). The following functions are said to have an undefined reference

libint2_cleanup_2emultipole
libint2_cleanup_1emultipole
libint2_init_1emultipole
libint2_init_2emultipole

Possibility of moving definitions of certain functions and static member data to API CXX?

In the latest changeset, I've run into issues with multiple definitions of certain functions and Engine member data, namely:

libint2::rank(libint2::Operator)
libint2::detail::init_compute2_ptrs()
libint2::Engine::compute2_ptrs_
libint2::Engine::skip_core_ints

I've been able to fix the first two via making them inline, and the last two via removal of the definition post declaration of the Engine struct (i.e. moved to definition within the constructors, but that's really hacky...). Would it be possible to add a CXX file for the API to alleviate these problems? Or declaration of the last two as non static? I can find work arounds if not

FMA issue

This is a two part issue, I will issue a pull request to fix the second part.

The question is
Using an Intel Haswell-E cpu, when I run configure I get a message at the top saying that no FMA instructions will be used. It says "Will not generate FMA instructions"

But then when trying to compile there is a compiler error in vector_x86.h when libint tries to compile code wrapped by the FMA header guard.

Is configure wrong about what it is doing, or is this the expected behavior?

The error is due to vector_x86.h missing the intrinsics header that contains the mm_fmadd_pd instruction. I will issue a pull request soon which includes the proper header along with a few other changes.

Wiki: using modern CPlusPlus interface, typo

The "create basis set" section exemple of the wiki (https//github.com/evaleev/libint/wiki/using-modern-CPlusPlus--interface) don't work out of the box for me.
I have replaced read_dotxyz(input_file)ย by libint2::read_dotxyz for fixing the issue.

Copy operator for OneBodyEngine false assert

Attempt to copy OneBodyEngine fails on assert

...include/libint2/engine.h:334: void libint2::OneBodyEngine::initialize(): Assertion `false' failed.

Code snippet:
for(auto i = 1; i < nThreads; i++) engines[i] = engines[0];

Code that runs serially (i.e. nThreads.eq.1) throws no errors, only when I try to copy the configured OneBodyEngine (engines[0]).

make build idiot-proof

alcfwl139:git jhammond$ cat 0001-make-build-more-clean.patch 
From 60002e36c89e296fbfd6a160260a2271adfb777c Mon Sep 17 00:00:00 2001
From: Jeff Hammond <[email protected]>
Date: Tue, 26 Nov 2013 20:45:19 -0600
Subject: [PATCH] make build more clean

1. INSTAL still references Mercurial and SourceForge.  I replaced the
former with Git and added a pointer to Github.

2. Some people do not read INSTALL before they try to build because they
usually know how to bootstrap and well-designed library.  Many codes,
e.g. MPICH, provide autogen.sh that does the appropriate autoconf setup.
Since this library doesn't autoreconf like many others, this is useful.

---
 INSTALL    | 3 ++-
 autogen.sh | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)
 create mode 100755 autogen.sh

diff --git a/INSTALL b/INSTALL
index e0f458be..943821dc 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,7 +1,8 @@
 For more complete instructions please refer to https://sourceforge.net/p/libint/home
+and https://github.com/evaleev/libint

 The installation procedure for the impatient and/or experts:
-0) only if obtained the compiler source via Mercurial:
+0) only if obtained the compiler source via Git:
    aclocal -I lib/autoconf; autoconf
 1) create a directory for object files:
    mkdir ../build; cd ../build
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 00000000..a418a630
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+aclocal -I lib/autoconf
+autoconf
-- 
1.8.4.3

Multiple instances of OneBodyEngine member functions

Upon link, the following functions are said to have multiple definitions

libint2::OneBodyEngine::nparams() const
libint2::OneBodyEngine::nopers() const
libint2::OneBodyEngine::compute_primdata(Libint_t&, libint2::Shell const&, libint2::Shell const&, unsigned long, unsigned long, unsigned long)

duplicate symbols

A simple example illustrating the problem:

a.h

#include <libint2.h>
#include <libint2/cxxapi.h>
class a {
  public:
    libint2::Shell ahsell;
    void do_stuff();
    //....
};

a.cpp

#include "a.h"
void a::do_stuff()
{
//AN IMPLEMENTATION
}

fixed_file.cpp

 #include "a.h"
//MORE THINGS
int main() {
    return 0;
}

In this example, I am only able to modify a.cpp and a.h but fixed file is auto-generated to #include a.h
When I attempt to link the object files from fixed_file.cpp and a.cpp I get:

icpc -std=c++0x -Iinclude/libint2/ -Iinclude/ -Llib/ -lint2 -c a.cpp
icpc -std=c++0x -Iinclude/libint2/ -Iinclude/ -Llib/ -lint2 -c fixed_file.cpp
icpc -bundle -undefined dynamic_lookup -Wl,-headerpad_max_install_names -std=c++0x -o super.so fixed_file.o a.o
duplicate symbol __ZN7libint27cleanupEv in:
fixed_file.o
a.o
duplicate symbol __ZN7libint2lsERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEERKNS_5ShellE in:
fixed_file.o
a.o
duplicate symbol __ZN7libint24initEv in:
fixed_file.o
a.o
ld: 3 duplicate symbols for architecture x86_64
make: *** [all] Error 1

The three offending symbols are from include/libint2/shells.h and include/libint2/cxxapi.h

To fix this (I'm not sure if this is the fix you will find most appropriate) I just made the three functions inlined functions. I can make a patch if you need one although it seems a bit of a waste of time.

Extra interfaces for engine compute.

Disclaimer

If this is already possible then sorry, I didn't see an option for this in my brief glance at the engine interface.

Motivation

Implementing Schwarz screening for three center integrals requires computation of both 4 center integrals and three center integrals.

The three center integrals themselves are going to use an engine where compute only takes 3 shells.

eng3.compute(sh0, sh1, sh2)

For better engine reuse the Schwarz estimates should be computed with the same engine, but that is not currently possible (to my knowledge) because the engine checks the number of shells on input so the following fails.

// Compute 4 center estimate
eng3.compute(sh0, sh1, sh0, sh1)

A different function which avoids the checking of compute could be implemented so that experts can reuse an engine with a non-default number of shells by manually specifying where the unit shells appear.

BasisSets should be installed

Currently the user has to define SRCDATADIR so that the basis set can be found, I think it would be much easier if they were installed in some way that this becomes a non-issue.

Libint basis install

I am trying to install compile and install libint using commit b89d440, after pulling I ran the following commands

aclocal -Ilib/autoconf
autoconf
cd build_dir
reconfigure

make install

I then get the following error at the very end of the install process

/usr/bin/install -c -m 0644 ./lib/basis/*
/libint/install/dir/share/libint/2.1.0-beta/basis
install: ./lib/basis/: No such file or directory make: **
[install_data] Error 71

I looked at the MakeRules.export line 23 and it seems like it should call $SCRDIR/lib/basis/* but for some reason it is looking for the basis set files in the build dir and they are not there.

Build fails to configure with gcc 4.9.2

...
[libint] checking gmpxx.h usability... yes
[libint] checking gmpxx.h presence... yes
[libint] checking for gmpxx.h... yes
[libint] checking if GMP C++ library is usable... no
[libint] configure: error: cannot link against GMP C++ library. Please get the latest GMP with support for C++. It can be obtained at gmplib.org .

The config.log says:

configure:6514: g++ -o conftest  -O2  -std=c++11 -I/local/certik/bld/autoconf/syuobdyszfxn/include -I/local/certik/bld/automake/jjtcusj34hdq/include -I/local/certik/bld/gmp/vzmznaezaap7/include -I/local/certik/bld/patchelf/eokqj5ouftcf/include -L/local/certik/bld/autoconf/syuobdyszfxn/lib -Wl,-rpath=/local/certik/bld/autoconf/syuobdyszfxn/lib -L/local/certik/bld/automake/jjtcusj34hdq/lib -Wl,-rpath=/local/certik/bld/automake/jjtcusj34hdq/lib -L/local/certik/bld/gmp/vzmznaezaap7/lib -Wl,-rpath=/local/certik/bld/gmp/vzmznaezaap7/lib -L/local/certik/bld/patchelf/eokqj5ouftcf/lib -Wl,-rpath=/local/certik/bld/patchelf/eokqj5ouftcf/lib conftest.cpp -lgmpxx -lgmp  >&5
In file included from /local/certik/bld/gmp/vzmznaezaap7/include/gmp.h:51:0,
                 from /local/certik/bld/gmp/vzmznaezaap7/include/gmpxx.h:33,
                 from conftest.cpp:57:
/local/certik/bld/gcc/vfnflgljyg4l/include/c++/4.9.2/cstddef:51:11: error: '::max_align_t' has not been declared
   using ::max_align_t;
           ^

That's a well known error (https://gcc.gnu.org/gcc-4.9/porting_to.html) and the solution is to put <cstddef> before <gmpxx.h>.

util/compressed_pair.h install

It looks like compressed_pair.h is not being installed with make install.

include/libint2/engine.h:39:42: fatal error: libint2/util/compressed_pair.h: No such file or directory
 #include <libint2/util/compressed_pair.h>

excessive library size

  • need to refine unrolling rules for derivative targets (clearly, angular momentum alone without # of targets is not enough)
  • need to add missing generic implementations

example: library configured with
'--enable-eri=2' '--enable-1body=2' --with-max-am=5 --with-opt-am=3 --disable-unrolling --enable-generic-code '--enable-fma'
is ~2.8 GB, with ~1.1 GB taken by multipole compute relation:

[Eduards-MacBook-Pro:libint/tmp/libint] evaleev% find . -name "CR_*CartesianMultipole*" -ls | awk '{total += $7} END {print total}'
1079450685

and 1.2 GB taken by deriv gaussian compute relation:

[Eduards-MacBook-Pro:libint/tmp/libint] evaleev% find . -name "CR_DerivGauss*" -ls | awk '{total += $7} END {print total}'
1181971078

libint + Boost 1.57 + intel icc/icpc

I've tried to compile libint 2.0.5 with Boost 1.57, GMP 6.0.0a and icc/ipc 15.0.1 and got this error:

./vrr_11_r12kg12_11.h(75): error: more than one instance of constructor "libint2::GenOper<Descr>::GenOper [with Descr=libint2::R12_k_G12_Descr]" matches the argument list:
            function "libint2::GenOper<Descr>::GenOper(Descr) [with Descr=libint2::R12_k_G12_Descr]"
            function "libint2::GenOper<Descr>::GenOper(const boost::shared_ptr<libint2::GenOper<Descr>> &) [with Descr=libint2::R12_k_G12_Descr]"
            function "libint2::GenOper<Descr>::GenOper(const boost::shared_ptr<libint2::OperSet> &) [with Descr=libint2::R12_k_G12_Descr]"
            function "libint2::GenOper<Descr>::GenOper(const boost::shared_ptr<libint2::ConstructablePolymorphically> &) [with Descr=libint2::R12_k_G12_Descr]"
            argument types are: (const int)
          const R12kG12 oK(K);
                           ^
          detected during:
            instantiation of "boost::shared_ptr<RRImpl> libint2::GenericRecurrenceRelation<RRImpl, F, Target>::Instance(const boost::shared_ptr<Target> &, unsigned int) [with RRImpl=libint2::VRR_11_R12kG12_11<libint2::CGShell, 0, (FunctionPosition={FunctionPosition})0>, F=libint2::CGShell, Target=libint2::GenIntegralSet_11_11<libint2::CGShell, libint2::R12kG12, libint2::mType>]" at line 279 of "strategy.cc"
            instantiation of "bool libint2::apply_strategy_transform<RRType>::_visit_cgf(const boost::shared_ptr<libint2::DirectedGraph> &, const boost::shared_ptr<RRType::TargetType> &, const boost::shared_ptr<libint2::Tactic> &, boost::shared_ptr<libint2::RecurrenceRelation> &, libint2::Tactic::rr_stack &) [with RRType=libint2::VRR_a_11_R12kG12_11_sh]" at line 249 of "strategy.cc"
            instantiation of "bool libint2::apply_strategy_transform<RRType>::visit(const boost::shared_ptr<libint2::DirectedGraph> &, const boost::shared_ptr<RRType::TargetType> &, const boost::shared_ptr<libint2::Tactic> &, boost::shared_ptr<libint2::RecurrenceRelation> &, libint2::Tactic::rr_stack &) [with RRType=libint2::VRR_a_11_R12kG12_11_sh]" at line 340 of "strategy.cc"
            instantiation of "void libint2::apply_strategy<IntType>::operator()(const Visitor &) [with IntType=libint2::R12kG12_11_11_sq, Visitor=libint2::apply_strategy_transform<libint2::VRR_a_11_R12kG12_11_sh>]" at line 78 of "/home/opt/easybuild/software/Boost/1.57.0-intel-2015a-Python-2.7.9/include/boost/mpl/for_each.hpp"
            instantiation of "void boost::mpl::aux::for_each_impl<false>::execute(Iterator *, LastIterator *, TransformFunc *, F) [with Iterator=boost::mpl::l_iter<boost::mpl::list2<libint2::VRR_a_11_R12kG12_11_sh, libint2::VRR_c_11_R12kG12_11_sh>>, LastIterator=boost::mpl::l_iter<boost::mpl::l_end>, TransformFunc=libint2::apply_strategy_transform<boost::mpl::_1>, F=libint2::apply_strategy<libint2::R12kG12_11_11_sq>]" at line 82 of
                      "/home/opt/easybuild/software/Boost/1.57.0-intel-2015a-Python-2.7.9/include/boost/mpl/for_each.hpp"
            [ 4 instantiation contexts not shown ]
            instantiation of "void libint2::match_first_inttype::operator()(const Visitor &) [with Visitor=libint2::match_first_inttype_transform<libint2::R12kG12_11_11_sq>]" at line 78 of "/home/opt/easybuild/software/Boost/1.57.0-intel-2015a-Python-2.7.9/include/boost/mpl/for_each.hpp"
            instantiation of "void boost::mpl::aux::for_each_impl<false>::execute(Iterator *, LastIterator *, TransformFunc *, F) [with Iterator=boost::mpl::l_iter<boost::mpl::list12<libint2::R12kG12_11_11_sq, libint2::R12kG12_11_11_int, libint2::R12kR12lG12_11_11_sq, libint2::R12kR12lG12_11_11_int, libint2::TiG12_11_11_sq, libint2::TiG12_11_11_int, libint2::G12TiG12_11_11_sq, libint2::G12TiG12_11_11_int, libint2::DivG12prime_xTx_11_11_sq, libint2::DivG12prime_xTx_11_11_int,
                      libint2::DummySymmIntegral_11_11_sq, libint2::DummySymmIntegral_11_11_int>>, LastIterator=boost::mpl::l_iter<boost::mpl::l_end>, TransformFunc=libint2::match_first_inttype_transform<boost::mpl::_1>, F=libint2::match_first_inttype]" at line 82 of "/home/opt/easybuild/software/Boost/1.57.0-intel-2015a-Python-2.7.9/include/boost/mpl/for_each.hpp"
            instantiation of "void boost::mpl::aux::for_each_impl<false>::execute(Iterator *, LastIterator *, TransformFunc *, F) [with Iterator=boost::mpl::l_iter<boost::mpl::list13<libint2::TwoPRep_11_11_int, libint2::R12kG12_11_11_sq, libint2::R12kG12_11_11_int, libint2::R12kR12lG12_11_11_sq, libint2::R12kR12lG12_11_11_int, libint2::TiG12_11_11_sq, libint2::TiG12_11_11_int, libint2::G12TiG12_11_11_sq, libint2::G12TiG12_11_11_int, libint2::DivG12prime_xTx_11_11_sq,
                      libint2::DivG12prime_xTx_11_11_int, libint2::DummySymmIntegral_11_11_sq, libint2::DummySymmIntegral_11_11_int>>, LastIterator=boost::mpl::l_iter<boost::mpl::l_end>, TransformFunc=libint2::match_first_inttype_transform<boost::mpl::_1>, F=libint2::match_first_inttype]" at line 82 of "/home/opt/easybuild/software/Boost/1.57.0-intel-2015a-Python-2.7.9/include/boost/mpl/for_each.hpp"
            instantiation of "void boost::mpl::aux::for_each_impl<false>::execute(Iterator *, LastIterator *, TransformFunc *, F) [with Iterator=boost::mpl::l_iter<boost::mpl::list14<libint2::TwoPRep_11_11_sq, libint2::TwoPRep_11_11_int, libint2::R12kG12_11_11_sq, libint2::R12kG12_11_11_int, libint2::R12kR12lG12_11_11_sq, libint2::R12kR12lG12_11_11_int, libint2::TiG12_11_11_sq, libint2::TiG12_11_11_int, libint2::G12TiG12_11_11_sq, libint2::G12TiG12_11_11_int, libint2::DivG12prime_xTx_11_11_sq,
                      libint2::DivG12prime_xTx_11_11_int, libint2::DummySymmIntegral_11_11_sq, libint2::DummySymmIntegral_11_11_int>>, LastIterator=boost::mpl::l_iter<boost::mpl::l_end>, TransformFunc=libint2::match_first_inttype_transform<boost::mpl::_1>, F=libint2::match_first_inttype]" at line 105 of "/home/opt/easybuild/software/Boost/1.57.0-intel-2015a-Python-2.7.9/include/boost/mpl/for_each.hpp"
            instantiation of "void boost::mpl::for_each(F, Sequence *, TransformOp *) [with Sequence=libint2::MasterIntegralTypeList, TransformOp=libint2::match_first_inttype_transform<boost::mpl::_1>, F=libint2::match_first_inttype &]" at line 492 of "strategy.cc"

make[3]: *** No rule to make target `/Users/jhammond/Work/LIBINT/github/build-gcc/src/lib/libint/../../../src/bin/libint/build_libint', needed by `tmp/libint/libint2_params.h'. Stop.

It seems that using --prefix breaks the LIBINT build :-(

And to be clear, the fix here is to not use --prefix, but that makes me sad panda because I refuse to install anything I build from source in /usr or /usr/local.

Jeffs-MacBook-Air:github jhammond$ ./autogen.sh 
Jeffs-MacBook-Air:github jhammond$ rm -rf build-gcc
Jeffs-MacBook-Air:github jhammond$ mkdir build-gcc
Jeffs-MacBook-Air:github jhammond$ cd build-gcc/
Jeffs-MacBook-Air:build-gcc jhammond$ ../configure CXX=g++-4.8 CC=gcc-4.8 --prefix=$HOME/Work/LIBINT/install-gcc && make -j4 install
checking build system type... x86_64-apple-darwin13.3.0
checking host system type... x86_64-apple-darwin13.3.0
checking target system type... x86_64-apple-darwin13.3.0
Using standard ordering of cartesian Gaussians
Will generate standard shell quartet sets
Will generate composite evaluators for multiple integral types
Will generate single evaluator type
Will not generate FMA instructions
Will copy integrals to the buffer
FLOP counter will not be supported
Will not support contracted integrals
checking whether make sets $(MAKE)... yes
checking whether ln -s works... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++-4.8 accepts -g... yes
checking how to run the C++ preprocessor... g++-4.8 -E
checking for ar... ar
checking for perl... perl
checking for gnutar... no
checking for tar... tar
checking for doxygen... no
checking for pdflatex... /usr/texbin/pdflatex
checking for pslatex... /usr/texbin/pslatex
checking for dvips... /usr/texbin/dvips
checking for latex... /usr/texbin/latex
checking for latex2html... no
checking for bibtex... /usr/texbin/bibtex
configure: WARNING: C++ optimization options are not given! For optimum performance give CXXGENFLAGS or use --with-cxxgen-optflags configure option
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for stdint.h... (cached) yes
checking for posix_memalign... yes
checking for C++11 features: auto ... yes (with -std=c++0x)
checking for C++11 features: lambda ... yes
checking for shared_ptr... yes
checking for std::make_shared and std::allocate_shared... yes
checking for type traits... yes
checking for array... yes
checking gmpxx.h usability... yes
checking gmpxx.h presence... yes
checking for gmpxx.h... yes
checking if GMP C++ library is usable... yes
checking for Boost::shared_ptr... yes
checking for Boost::mpl::for_each... yes
checking for size_t... yes
checking how to print strings... printf
checking for gcc... gcc-4.8
checking whether we are using the GNU C compiler... yes
checking whether gcc-4.8 accepts -g... yes
checking for gcc-4.8 option to accept ISO C89... none needed
checking for a sed that does not truncate output... /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc-4.8... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm
checking the name lister (/usr/bin/nm) interface... BSD nm
checking the maximum length of command line arguments... 196608
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-apple-darwin13.3.0 file names to x86_64-apple-darwin13.3.0 format... func_convert_file_noop
checking how to convert x86_64-apple-darwin13.3.0 file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... no
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking command to parse /usr/bin/nm output from gcc-4.8 object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc-4.8 supports -fno-rtti -fno-exceptions... no
checking for gcc-4.8 option to produce PIC... -fno-common -DPIC
checking if gcc-4.8 PIC flag -fno-common -DPIC works... yes
checking if gcc-4.8 static flag -static works... no
checking if gcc-4.8 supports -c -o file.o... yes
checking if gcc-4.8 supports -c -o file.o... (cached) yes
checking whether the gcc-4.8 linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin13.3.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++-4.8 -E
checking for ld used by g++-4.8... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking whether the g++-4.8 linker (/usr/bin/ld) supports shared libraries... yes
checking for g++-4.8 option to produce PIC... -fno-common -DPIC
checking if g++-4.8 PIC flag -fno-common -DPIC works... yes
checking if g++-4.8 static flag -static works... no
checking if g++-4.8 supports -c -o file.o... yes
checking if g++-4.8 supports -c -o file.o... (cached) yes
checking whether the g++-4.8 linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin13.3.0 dyld
checking how to hardcode library paths into programs... immediate
Writing ./doc/classdoc/Makefile
Writing ./doc/Makefile
Writing ./doc/progman/Makefile
Writing ./export/Makefile
Writing ./Makefile
Writing ./src/bin/libint/Makefile
Writing ./src/bin/Makefile
Writing ./src/bin/profile/Makefile
Writing ./src/bin/test_eri/Makefile
Writing ./src/lib/libint/Makefile
Writing ./src/lib/Makefile
Writing ./src/Makefile
Writing ./tests/bagel/Makefile
Writing ./tests/eri/Makefile
Writing ./tests/rysq/Makefile
configure: creating ./config.status
config.status: creating src/bin/test_eri/test_eri.pl
config.status: creating src/bin/test_eri/time_eri.pl
config.status: creating src/bin/test_eri/run_time_eri.pl
config.status: creating src/bin/test_eri/stdtests.pl
config.status: creating src/bin/test_eri/run_timing_suite.pl
config.status: creating src/bin/MakeVars
config.status: creating src/lib/MakeVars
config.status: creating src/lib/MakeRules
config.status: creating doc/MakeVars
config.status: creating doc/MakeRules
config.status: creating doc/progman/macros.tex
config.status: creating doc/classdoc/doxygen.cfg
config.status: creating src/bin/libint/cgshell_ordering.h
config.status: creating libint2.pc
config.status: creating include/libint2_config.h
config.status: executing libtool commands
/usr/bin/install -c -d -m 0755 /Users/jhammond/Work/LIBINT/install-gcc/lib/pkgconfig
/usr/bin/install -c -m 0644 ./libint2.pc /Users/jhammond/Work/LIBINT/install-gcc/lib/pkgconfig
for dir in src; \
      do \
        (cd ${dir} && /Applications/Xcode.app/Contents/Developer/usr/bin/make "DODEPEND=no" install) || exit 1; \
      done
for dir in bin lib; \
      do \
        (cd ${dir} && /Applications/Xcode.app/Contents/Developer/usr/bin/make  install) || exit 1; \
      done
for dir in libint; \
      do \
        (cd ${dir} && /Applications/Xcode.app/Contents/Developer/usr/bin/make  install) || exit 1; \
      done
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/test.cc | sed 's/^test.o/test.o test.d/g' > test.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/build_libint.cc | sed 's/^build_libint.o/build_libint.o build_libint.d/g' > build_libint.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/comp_deriv_gauss.cc | sed 's/^comp_deriv_gauss.o/comp_deriv_gauss.o comp_deriv_gauss.d/g' > comp_deriv_gauss.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/buildtest.cc | sed 's/^buildtest.o/buildtest.o buildtest.d/g' > buildtest.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/purgeable.cc | sed 's/^purgeable.o/purgeable.o purgeable.d/g' > purgeable.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/util.cc | sed 's/^util.o/util.o util.d/g' > util.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/extract.cc | sed 's/^extract.o/extract.o extract.d/g' > extract.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/task.cc | sed 's/^task.o/task.o task.d/g' > task.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/drtree.cc | sed 's/^drtree.o/drtree.o drtree.d/g' > drtree.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/graph_registry.cc | sed 's/^graph_registry.o/graph_registry.o graph_registry.d/g' > graph_registry.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/algebra.cc | sed 's/^algebra.o/algebra.o algebra.d/g' > algebra.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/class_registry.cc | sed 's/^class_registry.o/class_registry.o class_registry.d/g' > class_registry.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/iface.cc | sed 's/^iface.o/iface.o iface.d/g' > iface.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/code.cc | sed 's/^code.o/code.o code.d/g' > code.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/dims.cc | sed 's/^dims.o/dims.o dims.d/g' > dims.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/codeblock.cc | sed 's/^codeblock.o/codeblock.o codeblock.d/g' > codeblock.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/tactic.cc | sed 's/^tactic.o/tactic.o tactic.d/g' > tactic.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/memory.cc | sed 's/^memory.o/memory.o memory.d/g' > memory.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/context.cc | sed 's/^context.o/context.o context.d/g' > context.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/prefactors.cc | sed 's/^prefactors.o/prefactors.o prefactors.d/g' > prefactors.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/flop.cc | sed 's/^flop.o/flop.o flop.d/g' > flop.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/policy_spec.cc | sed 's/^policy_spec.o/policy_spec.o policy_spec.d/g' > policy_spec.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/strategy.cc | sed 's/^strategy.o/strategy.o strategy.d/g' > strategy.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/policy.cc | sed 's/^policy.o/policy.o policy.d/g' > policy.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/iter.cc | sed 's/^iter.o/iter.o iter.d/g' > iter.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/oper.cc | sed 's/^oper.o/oper.o oper.d/g' > oper.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/gauss.cc | sed 's/^gauss.o/gauss.o gauss.d/g' > gauss.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/dgarc.cc | sed 's/^dgarc.o/dgarc.o dgarc.d/g' > dgarc.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/dgvertex.cc | sed 's/^dgvertex.o/dgvertex.o dgvertex.d/g' > dgvertex.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/dg.cc | sed 's/^dg.o/dg.o dg.d/g' > dg.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/rr.cc | sed 's/^rr.o/rr.o rr.d/g' > rr.d
g++-4.8 -M -c -DHAVE_CONFIG_H  -I../../../src/bin -I../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../include -I/Users/jhammond/Work/LIBINT/github/src/bin/libint/../../../src/bin  -O2  -std=c++11 -I. -I/Users/jhammond/Work/LIBINT/github/src/bin/libint /Users/jhammond/Work/LIBINT/github/src/bin/libint/default_params.cc | sed 's/^default_params.o/default_params.o default_params.d/g' > default_params.d
/usr/bin/install -c -d -m 0755 /Users/jhammond/Work/LIBINT/install-gcc/include/libint2
/usr/bin/install -c -m 0644 /Users/jhammond/Work/LIBINT/github/src/bin/libint/cgshellinfo.h cgshell_ordering.h /Users/jhammond/Work/LIBINT/install-gcc/include/libint2
for dir in libint; \
      do \
        (cd ${dir} && /Applications/Xcode.app/Contents/Developer/usr/bin/make  install) || exit 1; \
      done
make[3]: *** No rule to make target `/Users/jhammond/Work/LIBINT/github/build-gcc/src/lib/libint/../../../src/bin/libint/build_libint', needed by `tmp/libint/libint2_params.h'.  Stop.
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [install] Error 1
make[1]: *** [install] Error 1
make: *** [install] Error 1

Multiple definitions upon link

Hi! I found the following multiple definitions upon link:

engine.impl.h(line 95): default_params(const Operator& oper);
engine.impl.h(line 690): unsigned int Engine::nparams() const;
engine.impl.h(line 700): unsigned int Engine::nopers() const;
engine.impl.h(line 764): any Engine::make_core_eval_pack(Operator oper) const.

Segmentation fault from build_libint

moved from https://sourceforge.net/p/libint/tickets/4/

summary

A fresh build with gcc 4.5.2 from Macports, configured by
../libint4/configure CXXFLAGS='-std=c++0x' --with-eri-max-am=7 --enable-g12=0 --with-g12-max-am=7
failed with segmentation fault at
DirectedGraph::print_def(): a RR making GenIntegralSet: < l(0) k(1) | TwoPRep | i(0) k(1) > ^ { {0} }
DirectedGraph::print_def(): a RR making GenIntegralSet: < k(0) k(1) | TwoPRep | k(0) k(1) > ^ { {0} }
building GenIntegralSet: < s(0) s(1) | T1_g12 | s(0) s(1) > ^ { {0} }
building GenIntegralSet: < s(0) s(1) | T2_g12 | s(0) s(1) > ^ { {0} }
/bin/sh: line 1: 81067 Segmentation fault /Users/shiozaki/packages/libint4_obj/src/lib/libint/../../../src/bin/libint/build_libint
make[3]: *** [tmp/libint/libint2_params.h] Error 139
make[2]: *** [default] Error 1
make[1]: *** [default] Error 1
make: *** [default] Error 1

note

There is a comment in src/bin/libint/dg.cc stating that remove_trivial_arithmetics() seems to be broken when working with [Ti,G12]. See far below.
Debugging info
I compiled again with debugging option (--enable-debug and CXXFLAGS="-g -std=c++0x"), it also failed at the same place. Attaching build_libint to debugger gives:

{shiozaki@pro libint4_obj}$ gdb /Users/shiozaki/packages/libint4_obj/src/lib/libint/../../../src/bin/libint/build_libint

โ€ฆ

(gdb) where
#0 0x00000001000185ce in shared_ptr (this=0x7fff5fbfdce0) at shared_ptr.hpp:169
#1 0x000000010004cbb6 in libint2::DGArc::dest (this=0x100) at dgarc.h:24
#2 0x00000001000426a5 in libint2::DirectedGraph::remove_trivial_arithmetics (this=0x102e93710) at /Users/shiozaki/packages/libint4/src/bin/libint/dg.cc:653
#3 0x0000000100041856 in libint2::DirectedGraph::optimize_rr_out (this=0x102e93710, context=@0x7fff5fbfeb30) at /Users/shiozaki/packages/libint4/src/bin/libint/dg.cc:470
#4 0x0000000100012378 in libint2::GenerateCode (dg=@0x7fff5fbfeb60, context=@0x7fff5fbfeb30, cparams=@0x7fff5fbfef90, strat=@0x7fff5fbfeb50, tactic=@0x7fff5fbfeb40, memman=@0x7fff5fbfeb20, decl_filenames=@0x7fff5fbfe9f0, def_filenames=@0x7fff5fbfe9a0, prefix=@0x7fff5fbfeaf0, label=@0x7fff5fbfeae0, have_parent=false) at buildtest.h:226
#5 0x0000000100016bfb in build_R12kG12_2b_2k (os=@0x100dae140, cparams=@0x7fff5fbfef90, iface=@0x7fff5fbfef70) at /Users/shiozaki/packages/libint4/src/bin/libint/build_libint.cc:804
#6 0x00000001000139bc in try_main (argc=1, argv=0x7fff5fbff230) at /Users/shiozaki/packages/libint4/src/bin/libint/build_libint.cc:273
#7 0x0000000100012be1 in main (argc=1, argv=0x7fff5fbff230) at /Users/shiozaki/packages/libint4/src/bin/libint/build_libint.cc:78

(gdb) list

164 // The object pointed to is deleted when the last shared_ptr pointing to it

165 // is destroyed or reset.

166 //

167

168 template class shared_ptr

169 {

170 private:

171

172 // Borland 5.5.1 specific workaround

173 typedef shared_ptr this_type;

(gdb) up
#1 0x000000010004cbb6 in libint2::DGArc::dest (this=0x100) at dgarc.h:24

24 SafePtr dest() const { return dest_; }

(gdb) list

19 public:

20 DGArc(const SafePtr& orig, const SafePtr& dest);

21 virtual ~DGArc() {}

22
23 SafePtr orig() const { return orig_; }

24 SafePtr dest() const { return dest_; }

25
26 /// Print out the arc

27 virtual void print(std::ostream& os) const =0;

28

(gdb) up
#2 0x00000001000426a5 in libint2::DirectedGraph::remove_trivial_arithmetics (this=0x102e93710) at /Users/shiozaki/packages/libint4/src/bin/libint/dg.cc:653

653 SafePtr right = (*a)->dest();

(gdb) list

648 if (oper_cast) {

649

650 typedef DGVertex::ArcSetType::const_iterator aciter;

651 aciter a = oper_cast->first_exit_arc();

652 SafePtr left = (*a)->dest(); ++a;

653 SafePtr right = (*a)->dest();

654
655 // 1.0 * x = x

656 if (left->equiv(prefactors.N_i[1])) {

657 const bool success = remove_vertex_at((vptr),right);

(gdb) up
#3 0x0000000100041856 in libint2::DirectedGraph::optimize_rr_out (this=0x102e93710, context=@0x7fff5fbfeb30) at /Users/shiozaki/packages/libint4/src/bin/libint/dg.cc:470

470 remove_trivial_arithmetics();

(gdb) list

465 DirectedGraph::optimize_rr_out(const SafePtr& context)

466 {

467 replace_rr_with_expr();

468 // TODO remove_trivial_arithmetics() seems to be broken when working with [Ti,G12], fix!

469 #if 1

470 remove_trivial_arithmetics();

471 #endif

472 handle_trivial_nodes(context);

473 remove_disconnected_vertices();

474 find_subtrees();

libint2::shell::ncontr() question

Currently in libint2::shell ncontr() returns contr.size(), I think this is an error and it should actually return alpha.size() or contr[0].coeff.size(). I wanted to double check before changing it though.

assigning to 'value_type' (aka 'const double *') from incompatible type 'libint2::simd::VectorAVXDouble *'

I have never had problems using this great library, until recently I wanted to compile it with AVX support. Whenever I specify --with-real-type=libint2::simd::VectorAVXDouble in the configuration of the actual compilation (no matter if I specified it for the generation of the compiler too), I end up with an engine.h and engine.impl.h which error in the compilation of my actual program, which may be as simple as:

include <libint2.hpp>
int main() {
  return 0;
}

I am also specifying -mavx to my compiler in all compilation steps and have tried intel, gnu, and clang compiler. The latter gives the most elaborate error description: There appear more than 20 errors all related to conversions from VectorAVXDouble to double. E.g.

libint2_binaries/include/libint2/engine.h:673:37: error: const_cast from 'libint2::simd::VectorAVXDouble **' to 'const real_t **' (aka 'const double **') is not allowed
    set_targets_ = (&targets_[0] != const_cast<const real_t**>(primdata_[0].targets));

Any idea what I might be doing wrong? Am I missing any further flags that have to be specified for consistency?

Any help and/or ideas are very much appreciated!

derivative 1-body ints broken

It would be nice to have it, but if i can get what I need with the pre- C++11 api.

For the pre- C++11 api:
I am trying to set up libint with 1-body derivatives. However I am find the following error:

working on _3emultipole_G_S ... done
working on _3emultipole_G_P ... done
working on _3emultipole_G_D ... done
working on _3emultipole_G_F ... done
working on _3emultipole_G_G ... done
working on _overlapderiv1_S_S ... /bin/sh: line 1: 80125 Segmentation fault: 11 /Users/luke/devel/build/libint_gamess_build/src/lib/libint/../../../src/bin/libint/build_libint
make[3]: *** [tmp/libint/libint2_params.h] Error 139
make[2]: *** [default] Error 1
make[1]: *** [default] Error 1
make: *** [default] Error 1

I configured with this:
../libint_gamess/configure --enable-eri=1 --with-1body-max-am=4 --enable-1body=1 --with-max-am=4 --with-cartgauss-ordering=gamess --with-incdirs=-I/opt/local/include --with-libdirs=-L/opt/local/lib --with-cxx-optflags=-O2 --with-cxx=g++ --prefix=/Users/luke/devel/install/libint_gamess

Everything works fine with I turn off the 1-body derivatives.

Thanks,
Luke

Nan returned from compute when using cc-pv5z-ri

The engine is the two body two center engine.

The call looks like

auto unit = Shell::unit();
auto ptr = eng.compute(s0, unit, s1, unit);

The shells are
s0 =
Shell:( O={-1.3269582278103,-0.105938530313005,0.0187881522386705}
{l=0,sph=0}
488.561 74.062640090216

s1 =
Shell:( O={-1.3269582278103,-0.105938530313005,0.0187881522386705}
{l=6,sph=1}
3.26123 37.6580802979677

The values pointed two by the returned pointer are.
nan nan nan nan 0 0 1.38777878078145e-17 3.42113882891801e-49 nan nan nan nan nan

Exported library for 2.1.0

Contrary to beta2, there is no readily-usable end-user library tarball provided for 2.1.0 final, only the compiler as a git tag tarball.

[trivial] Typo in --enable-eri2 help text

The AC_ARG_ENABLE(eri2[...] has --enable=eri3 as help text, which should be --enable-eri2 I guess:

AC_ARG_ENABLE(eri2,
[  --enable-eri3=N         Compile with support for up to N-th derivatives of 2-center electron repulsion integrals],

Complation Error

When compiling there is no OneBodyEngine in namespace libint.
Error is:
scf.cc:40:36: error: no member named 'OneBodyEngine' in namespace 'libint2'
libint2::OneBodyEngine::type t,

Segmentation Fault on OSX/clang++ for L > 1

I've recently compiled the latest change set of Libint on OSX with clang++ and ran into a problem with segmentation full whenever I hit basis functions with L > 1.

% clang++ --version
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0
Thread model: posix

and libint configure

#!/bin/sh
$PWD/configure \
--enable-eri=1 \
--with-max-am=7 \
--with-opt-am=4 \
--disable-unrolling \
--enable-generic-code \
--enable-contracted-ints \
--with-cxx=clang++ \
--with-cxx-optflags="-std=c++11 -O3" \
--with-cxxgen-optflags="-std=c++11 -O3" \
--prefix=$PWD/..

The code that seg faults is thus:

RealMatrix genSpx(BasisSet obs1, BasisSet obs2){
  if(obs1.size() != obs2.size()) {
    cout << "genSpx cannot take two basis sets of different size" << endl;
    std::exit(1);
  }
  RealMatrix S(obs1.size(),obs2.size());
  auto shell2bf = obs1.shell2bf();

  libint2::OneBodyEngine engine(libint2::OneBodyEngine::overlap,
    obs1.max_nprim(),obs1.max_l(),0);

  cout << obs1.size() << "," << obs2.size() << endl;
  for(auto iSh = 0; iSh < obs1.size(); iSh++)
  for(auto jSh = 0; jSh < obs2.size(); jSh++){
    auto s1 = shell2bf[iSh];
    auto s2 = shell2bf[jSh];
    auto n1 = obs1[iSh].size();
    auto n2 = obs2[jSh].size();
    cout << iSh << "," << jSh << endl;
    cout << s1 << "," << s2 << endl;
    cout << n1 << "," << n2 << endl;
    const auto *buff = engine.compute(obs1[iSh],obs2[jSh]);
    RealConstMap sMap(buff,n1,n2);
    cout << "sMap" << endl << sMap << endl << endl;
//    S.block(s1,s2,n1,n2) = sMap;
  }

  return S;
};

and the output is

Will read basis set from /Volumes/Gaussian/dbwy/Documents/Projects/libint/../share/libint/2.1.0-beta2/basis/cc-pvdz.g94
Will read basis set from /Volumes/Gaussian/dbwy/Documents/Projects/libint/../share/libint/2.1.0-beta2/basis/cc-pvdz.g94
24,24
0,0
0,0
1,1
sMap
1

0,1
0,1
1,1
sMap
-0.2157

0,2
0,2
1,1
sMap
0.19014

0,3
0,3
1,3
Segmentation fault

I've tried this with obs1 and obs1 in the ovelap call with the exact same problem. The point of this code is to compute the overlap of basis sets at different geometries, but it fails for the "vanilla" usage as well (passing only obs1 into the compute function)

Problem with 2- and 3-center derivatives

When generating Libint with the compiler, the struct Libint_t in libint2_types.h doesn't always contain the right number of aB_s___0__s___1___TwoPRep_s___0__s___1___Ab__up* fields. The index at the end of the field name is expected to run from 0 to LIBINT_MAX_AM_4 + max(INCLUDE_ERI, INCLUDE_ERI2, INCLUDE_ERI3). Instead, the fields are present only up to LIBINT_MAX_AM_4 + INCLUDE_ERI, which causes problems if INCLUDE_ERI2 > INCLUDE_ERI or INCLUDE_ERI3 > INCLUDE_ERI.
The config parameters we were using were ../libint/configure '--with-cxx=g++ -std=c++0x' '--with-cxx-optflags=-O2 -fPIC' '--enable-eri=1' '--enable-eri2=3' '--enable-eri3=1' '--with-max-am=5' '--with-opt-am=4' '--disable-unrolling' '--enable-generic-code' '--enable-contracted-ints' '--with-pic'. As a workaround, we increased --enable-eri to 3, which solved the problem, but increased compilation time considerably.

Segmentation fault on minimal code snippet for L > 1

I have recently updated my libint to the latest change set and currently receiving a segmentation fault on the following minimal code snippet for L > 1 (GCC 5.3.1)

  libint2::initialize();
  std::vector<libint2::Shell> shells;
  // O STO-3G
  shells.push_back(libint2::Shell{
      {130.7093200,23.8088610,6.4436083},
      {{0,true,{0.15432897,0.53532814,0.44463454}}},
      {{0,0,0}}
      }   
    );  
  shells.push_back(libint2::Shell{
      {5.0331513,1.1695961,0.3803890},
      {{0,true,{-0.09996723,0.39951283,0.70011547}}},
      {{0,0,0}}
      }   
    );  
  shells.push_back(libint2::Shell{
      {5.0331513,1.1695961,0.3803890},
      {{1,true,{0.15591627,0.60768372,0.39195739}}},
      {{0,0,0}}
      }   
    );  


  libint2::Engine engine(libint2::Operator::overlap,3,1,0);
  const auto& buff = engine.results();

  for(auto iShell : shells)
  for(auto jShell : shells){
    std::cout << jShell << std::endl;
    engine.compute(iShell,jShell);
  }

  libint2::finalize();
  return 0;

With output


Shell:( O={0,0,0}
   {l=0,sph=1}
  130.709 4.25194
  23.8089 4.11229
  6.44361 1.28162

Shell:( O={0,0,0}
   {l=0,sph=1}
  5.03315 -0.239413
  1.1696 0.320234
  0.380389 0.241686

Shell:( O={0,0,0}
   {l=1,sph=1}
  5.03315 1.67545
  1.1696 1.05357
  0.380389 0.166903

Segmentation fault (core dumped)

I had originally thought that this was the same as #48, but I've definitely initialized the libint env at the first line. I'm sure that it's something small that I'm just missing viz the examples in tests/, but I can't seem to find it if it's there.

Compilation error

I have had an error when compiling the latest libint source. I am using the intel compilers (I should mention that I see this error when using gnu compilers as well) on NERSC's Cori machine. I see the following output

I am attempting to compile libint's latest code from github on a Nersc machine. I am using the intel compilers (I also have tried the gnu compilers and I see the same failure that follows). I see the following output

**
....
generating code for OSVRRP1InBra_aB_l__0__p__1___TwoPRep_s__0__s__1___Ab__up_0 target=< l(0) p(1) | TwoPRep | s(0) s(1) > ^ { {6} }
generating code for OSVRRP0InBra_aB_l__0__s__1___TwoPRep_s__0__s__1___Ab__up_0 target=< l(0) s(1) | TwoPRep | s(0) s(1) > ^ { {6} }
Compilation finished. Goodbye.
echo "Last time library source was generated:\c" > source
date >> source
cd src; make TO_TOPDIR=../../.. TOPDIR=/global/homes/m/mcbennet/local/src/libint-build/src/lib/libint/../../.. SRCDIR=/global/homes/m/mcbennet/local/src/libint-2.1.0/src/lib/libint
CXX _aB_G__0__D__1___TwoPRep_S__0__D__1___Ab__up_0.lo
make[4]: Entering directory /global/u1/m/mcbennet/local/src/libint-build/src/lib/libint/tmp/libint' icpc: error #10236: File not found: 'yes' make[4]: *** [_aB_G__0__D__1___TwoPRep_S__0__D__1___Ab__up_0.lo] Error 1 make[4]: Leaving directory/global/u1/m/mcbennet/local/src/libint-build/src/lib/libint/tmp/libint'
make[3]: *** [../../../lib/libint2.la] Error 2
make[3]: Leaving directory /global/u1/m/mcbennet/local/src/libint-build/src/lib/libint' make[2]: *** [default] Error 1 make[2]: Leaving directory/global/u1/m/mcbennet/local/src/libint-build/src/lib'
make[1]: *** [default] Error 1
make[1]: Leaving directory `/global/u1/m/mcbennet/local/src/libint-build/src'
make: *** [default] Error 1

**

I have attached the config.log file (under filename config_log.txt) and also my workflow was as follows

module load boost
module load gmp
module load eigen3
module load autoconf/2.69
git clone https://github.com/evaleev/libint.git
cd libint
./autogen.sh
mkdir ../libint-build
cd ../libint-build
./libint/configure ...
make

config_log.txt

Multiple definitions of OneBodyEngine default_params

As of 8d4751a
Multiple definitions of several parameters upon link:

libint2::OneBodyEngine::operator_traits<(libint2::OneBodyEngine::operator_type)2>::default_params' libint2::OneBodyEngine::operator_traits<(libint2::OneBodyEngine::operator_type)3>::default_params'
`libint2::OneBodyEngine::operator_traits<(libint2::OneBodyEngine::operator_type)4>::default_params'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.