Skip to content

Commit

Permalink
misc. and install notes
Browse files Browse the repository at this point in the history
  • Loading branch information
loriab committed Oct 12, 2023
1 parent 667bf42 commit 0934428
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
40 changes: 40 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
### Run-Time Compatibility

Functions are provided to check the library configuration and solid harmonics orderings at runtime:

Note: As of v2.8.0 (libtool-based), the configuration_accessor() function will return `(nyi)` by default.
Packagers are encouraged to patch a generated configuration string into file `configuration.cc` to
imitate future cmake-based behavior.

```
libint2::initialize();
printf("SHGShell: %d\n", libint2::solid_harmonics_ordering());
libint2::set_solid_harmonics_ordering(libint2::SHGShellOrdering_Gaussian);
printf("SHGShell: %d\n", libint2::solid_harmonics_ordering());
printf("Configuration: %s\n", libint2::configuration_accessor().c_str());
libint2::finalize();
```
```
SHGShell: 1
SHGShell: 2
Configuration: eri_c4_d0_l2;eri_c4_d0_l3;sss;...
```

For the C library, a similar function is available:

```
printf("CMake Configuration (C) : %s\n", configuration_accessor());
```
```
CMake Configuration (C) : eri_c4_d0_l2;eri_c4_d0_l3;sss;...
```

If you have a built libint2 library whose history you don't know, a command like this on Linux can provide the same information:

```
strings -n80 /a/random/L2/lying/around/libint2.so
```
```
eri_c2_d0_l2;eri_c2_d0_l3;eri_c2_d1_l2;eri_c3_d0_l2;eri_c3_d0_l3;eri_c3_d1_l2;eri_c4_d0_l2;eri_c4_d1_l2;impure_sh;onebody_d0_l2;onebody_d0_l3;onebody_d1_l2;sss
```

3 changes: 3 additions & 0 deletions include/libint2/numeric.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <limits>
#include <sstream>
#include <type_traits>
#include <cmath>

#if LIBINT_HAS_MPFR
# include <cstddef>
Expand Down Expand Up @@ -56,10 +57,12 @@
mpf_clear(x_to_a);
return result;
}
#ifndef _MSC_VER
/// this is needed to avoid ambiguity in pow(2.0, 2) ... the above pow competes with standard double pow(double, double)
inline double pow(double x, int a) {
return std::pow(x, static_cast<double>(a));
}
#endif
/// implement erf for mpf_class using MPFR ... I do not claim to know what issues the rounding presents here
inline mpf_class erf(mpf_class x) {
const auto prec = x.get_prec();
Expand Down

0 comments on commit 0934428

Please sign in to comment.