Permalink
Browse files

Merge branch 'master' into fortran_interface

  • Loading branch information...
evaleev committed Jul 9, 2018
2 parents 8e770b5 + 669bb32 commit c7b540efe7d40e861a5e14b18d060f69ae1ef3de
Showing with 15,597 additions and 432 deletions.
  1. +14 −12 .travis.yml
  2. +14 −1 CHANGES
  3. +1 −1 Makefile
  4. +3 −3 bin/travisci_build_linux.sh
  5. +59 −33 configure.ac
  6. +7 −0 export/Makefile
  7. +18 −6 export/Makefile.tests.export
  8. +3 −3 include/libint2/atom.h
  9. +166 −123 include/libint2/basis.h.in
  10. +2 −2 include/libint2/boys.h
  11. +104 −0 include/libint2/cartesian.h
  12. +4 −4 include/libint2/cgshell_ordering.h
  13. +10 −6 include/libint2/cgshellinfo.h
  14. +34 −17 include/libint2/cxxapi.h
  15. +120 −19 include/libint2/engine.h
  16. +167 −72 include/libint2/engine.impl.h
  17. +7 −7 include/libint2/lcao/1body.h
  18. +5 −5 include/libint2/lcao/molden.h
  19. +26 −18 include/libint2/shell.h
  20. +9 −9 include/libint2/solidharmonics.h
  21. +7 −0 include/libint2/util/any.h
  22. +223 −28 include/libint2/util/generate_statics.nb
  23. +43 −0 include/libint2/util/small_vector.h
  24. +2 −2 include/libint2/util/vector_x86.h
  25. +0 −2 lib/autoconf/acx_check_cpp11.m4
  26. +301 −0 lib/autoconf/ax_boost_base.m4
  27. +1 −0 src/bin/libint/build_libint.cc
  28. +1 −1 src/bin/libint/comp_11_r1dotr1g12_11.h
  29. +1 −1 src/bin/libint/comp_11_r1dotr2g12_11.h
  30. +1 −1 src/bin/libint/comp_11_r2dotr2g12_11.h
  31. +1 −0 src/bin/libint/context.cc
  32. +1 −1 src/bin/libint/dg.h
  33. +1 −0 src/bin/libint/gauss.cc
  34. +1 −1 src/bin/libint/generic_rr.h
  35. +1 −1 src/bin/libint/hrr.h
  36. +1 −0 src/bin/libint/integral.h
  37. +1 −1 src/bin/libint/intset_to_ints.h
  38. +1 −1 src/bin/libint/itr_11_twoprep_11.h
  39. +2 −1 src/bin/libint/memory.cc
  40. +1 −0 src/bin/libint/quanta.h
  41. +41 −41 src/bin/libint/strategy.cc
  42. +1 −0 src/bin/libint/tactic.cc
  43. +1 −1 src/bin/libint/uncontract.h
  44. +1 −0 src/bin/libint/vrr_1_onep_1.h
  45. +3 −2 tests/eri/Makefile
  46. +6 −6 tests/hartree-fock/hartree-fock++.cc
  47. +91 −0 tests/unit/Makefile
  48. +13,287 −0 tests/unit/catch.hpp
  49. +32 −0 tests/unit/fixture.h
  50. +63 −0 tests/unit/test-1body.cc
  51. +102 −0 tests/unit/test-core.cc
  52. +567 −0 tests/unit/test-permute.cc
  53. +38 −0 tests/unit/test.cc
View
@@ -5,36 +5,38 @@ compiler:
- clang
- gcc
env:
- GCC_VERSION=4.9
- GCC_VERSION=5
- GCC_VERSION=6
# - GCC_VERSION=7
- GCC_VERSION=7
- GCC_VERSION=8
matrix:
exclude:
- compiler: clang
env: GCC_VERSION=4.9
- compiler: clang
env: GCC_VERSION=5
# - compiler: clang
# env: GCC_VERSION=6
- compiler: clang
env: GCC_VERSION=6
- compiler: clang
env: GCC_VERSION=7
sudo: false
addons:
apt:
sources:
- george-edison55-precise-backports
- ubuntu-toolchain-r-test
- llvm-toolchain-precise
- boost-latest
- llvm-toolchain-trusty-5.0
- llvm-toolchain-trusty-6.0
- llvm-toolchain-trusty
packages:
- g++-4.9
- g++-5
- g++-6
# - g++-7
- gfortran-4.9
- g++-7
- g++-8
- clang-6.0
- gfortran-5
- gfortran-6
# - gfortran-7
- clang-5.0
- gfortran-7
- gfortran-8
- libgmp-dev
- libeigen3-dev
- libboost1.55-dev
View
15 CHANGES
@@ -3,9 +3,22 @@
Following is a brief summary of changes made in each release of Libint.
- 2018-xx-yy: 2.4.3
- 2018-xx-yy: 2.5.0
- resolved issue 90
- resolved issue 91: fixed formatting errors in def2-sv(p)-c, def2-tzvp-c, and def2-tzvpp-c basis set definitions
- resolved issue 95
- minor fixes for C++17 (includes PR 96 HT https://github.com/mfherbst)
- [generated lib only] ensure system boost/preprocessor.hpp is more recent than 1.57; reverts to bundled boost is system boost is too old
- resolved issue 97: checks variadic macro support in boost.preprocessor for the libint compiler
- C++ API produces correct 2- and 3-center 2-e derivatives
- added minimal non-HF validation tests for C++ API (only 2-body Coulomb)
- removed the following deprecated features:
- libint2::init
- libint2::cleanup
- deprecated the following features:
- Engine::set_oper (use Engine::set)
- Engine::set_braket (use Engine::set)
- minor C++ API improvements
- 2017-11-21: 2.4.2
- fixed vector.h for use on non-x86 platforms
View
@@ -7,7 +7,7 @@ endif
-include $(TOPDIR)/src/lib/MakeVars
SUBDIRS = src
CHECKSUBDIRS = tests/eri tests/hartree-fock
CHECKSUBDIRS = tests/eri tests/unit tests/hartree-fock
CLEANSUBDIRS = $(SUBDIRS) $(CHECKSUBDIRS)
ALLSUBDIRS = $(CLEANSUBDIRS) doc $(CHECKSUBDIRS)
@@ -11,8 +11,8 @@ if [ "$CXX" = "g++" ]; then
else
# no OpenMP support in clang, will use C++11 threads
export OPENMPFLAGS=
export CC=/usr/bin/clang-5.0
export CXX=/usr/bin/clang++-5.0
export CC=/usr/bin/clang-6.0
export CXX=/usr/bin/clang++-6.0
export FC=/usr/bin/gfortran-$GCC_VERSION
# Boost 1.55 is too old, override Boost.PP detection of variadic macro support
export EXTRAFLAGS="-DBOOST_PP_VARIADICS=1"
@@ -34,7 +34,7 @@ cd export_build
tar -xvzf libint-*.tgz
rm -f libint-*.tgz
cd libint-*
./configure CPPFLAGS='-I/usr/include/eigen3' --enable-fortran
./configure CPPFLAGS='-I/usr/include/eigen3 -DLIBINT2_DISABLE_BOOST_CONTAINER_SMALL_VECTOR=1' --enable-fortran
make -j2
make check
# build F03 interface
View
@@ -1097,7 +1097,6 @@ if test "X$CXXGEN" = X; then
CXXGEN=$CXX
fi
AC_SUBST(CXXGEN)
AC_SUBST(CXXGENFLAGS)
# discard CXXFLAGS provided by the C++ detection macros
initial_CXXFLAGS="$CXXFLAGS"
@@ -1207,6 +1206,7 @@ AC_SUBST(EXTRAINCLUDE)
AC_SUBST(EXTRADEFINES)
AC_SUBST(CXXFLAGS)
AC_SUBST(CXXGENFLAGS)
AC_SUBST(LIBDIRS)
AC_SUBST(LD)
AC_SUBST(LDFLAGS)
@@ -1261,6 +1261,7 @@ fi
# to support FMA CXXGEN must be able to compile C++11
# NB -std=c++11 is not added to CXXGENFLAGS automatically!
ACX_CHECK_CPP11_CXXGEN
if test "X$libint_generate_gma" = "X1" -a "X$CXXGEN_SUPPORTS_CPP11" = "Xno"; then
AC_MSG_ERROR([CXXGEN must support C++11 to provide FMA support. Add -std=c++11 to CXXGENFLAGS.])
fi
@@ -1304,51 +1305,31 @@ AC_ARG_ENABLE(mpfr,
]
)
dnl ------------------ Check for shared_ptr -----------------------
dnl ------------------ Check for Boost library -----------------------
HAVE_SHARED_PTR=no
AC_MSG_CHECKING([for Boost::shared_ptr])
dnl Boost.Preprocessor requires 1.30 (which introduced MPL; Preprocessor was introduced in 1.29)
AX_BOOST_BASE([1.30],, [AC_MSG_ERROR([libint compiler needs Boost 1.30 or later, download from https://www.boost.org/users/download/ , unpack (no need to install), and add -I/path/to/boost to CPPFLAGS])])
AC_MSG_CHECKING([for variadic macro support in Boost.Preprocessor])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <boost/shared_ptr.hpp>
[[#include <boost/preprocessor.hpp>
#if not BOOST_PP_VARIADICS // no variadic macros? your compiler is out of date! (should not be possible since variadic macros are part of C++11)
# error "your compiler does not provide variadic macros (but does support C++11), something is seriously broken, please create an issue at https://github.com/evaleev/libint/issues"
#endif
]],
[[
boost::shared_ptr<int> a(new int);
boost::shared_ptr<int> b = a;
]]
)
],
[AC_MSG_RESULT([yes])
HAVE_SHARED_PTR=boost
AC_DEFINE(HAVE_SHARED_PTR_IN_BOOST)
],
[
AC_MSG_RESULT([no])
AC_MSG_ERROR([Boost.Preprocessor with variadic macro support is required. Download latest boost from https://www.boost.org/users/download/ , unpack (no need to install), and add -I/path/to/boost to CPPFLAGS])
]
)
if test "X$HAVE_SHARED_PTR" = "Xno"; then
AC_MSG_CHECKING([for std::shared_ptr])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <memory>
]],
[[
std::shared_ptr<int> a(new int);
std::shared_ptr<int> b = a;
]]
)
],
[AC_MSG_RESULT([yes])
HAVE_SHARED_PTR=std
],
[
AC_MSG_RESULT([no])
AC_MSG_ERROR([shared_ptr is required. Please download Boost from boost.org or use C++ compiler that supports shared_ptr.])
]
)
fi
AC_MSG_CHECKING([for Boost::mpl::for_each])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
@@ -1369,10 +1350,55 @@ AC_COMPILE_IFELSE(
],
[
AC_MSG_RESULT([no])
AC_MSG_ERROR([Boost::mpl is required. Please use the latest Boost library from boost.org and/or most standard-compliant C++ compiler.])
AC_MSG_ERROR([Boost::mpl is required. Download latest boost from https://www.boost.org/users/download/ , unpack (no need to install), and add -I/path/to/boost to CPPFLAGS])
]
)
dnl ------------------ Check for shared_ptr -----------------------
HAVE_SHARED_PTR=no
AC_MSG_CHECKING([for std::shared_ptr])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <memory>
]],
[[
std::shared_ptr<int> a(new int);
std::shared_ptr<int> b = a;
]]
)
],
[AC_MSG_RESULT([yes])
HAVE_SHARED_PTR=std
],
[
AC_MSG_RESULT([no])
]
)
if test "X$HAVE_SHARED_PTR" = "Xno"; then
AC_MSG_CHECKING([for Boost::shared_ptr])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <boost/shared_ptr.hpp>
]],
[[
boost::shared_ptr<int> a(new int);
boost::shared_ptr<int> b = a;
]]
)
],
[AC_MSG_RESULT([yes])
HAVE_SHARED_PTR=boost
AC_DEFINE(HAVE_SHARED_PTR_IN_BOOST)
],
[
AC_MSG_RESULT([no])
AC_MSG_ERROR([shared_ptr is required. Please download Boost from boost.org or use C++ compiler that supports std::shared_ptr.])
]
)
fi
dnl ------------------ Check for Eigen library -----------------------
ACX_CHECK_EIGEN
@@ -1382,7 +1408,7 @@ fi
dnl -- Checks for typedefs, structures, and compiler characteristics. --
AC_TYPE_SIZE_T
``
CPPFLAGS="$CPPFLAGS" CXX="$CXX" CXXFLAGS="$CXXFLAGS" \
LD="$LD" LDFLAGS="$LDFLAGS" LIBS="-lm $LIBS $FLIBS" \
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB"
View
@@ -81,6 +81,13 @@ exportdir::
-$(INSTALL) $(INSTALLLIBOPT) $(SRCTOPDIR)/tests/eri/test.cc $(TOPDIR)/$(EXPORTDIR)/tests/eri/test.cc
-$(INSTALL) $(INSTALLLIBOPT) $(SRCTOPDIR)/src/bin/test_eri/eri.h $(TOPDIR)/$(EXPORTDIR)/tests/eri/eri.h
-$(INSTALL) $(INSTALLLIBOPT) $(SRCTOPDIR)/src/bin/test_eri/prep_libint2.h $(TOPDIR)/$(EXPORTDIR)/tests/eri/prep_libint2.h
$(INSTALL) $(INSTALLDIROPT) $(TOPDIR)/$(EXPORTDIR)/tests/unit
-$(INSTALL) $(INSTALLLIBOPT) $(SRCTOPDIR)/tests/unit/catch.hpp $(TOPDIR)/$(EXPORTDIR)/tests/unit/catch.hpp
-$(INSTALL) $(INSTALLLIBOPT) $(SRCTOPDIR)/tests/unit/fixture.h $(TOPDIR)/$(EXPORTDIR)/tests/unit/fixture.h
-$(INSTALL) $(INSTALLLIBOPT) $(SRCTOPDIR)/tests/unit/test.cc $(TOPDIR)/$(EXPORTDIR)/tests/unit/test.cc
-$(INSTALL) $(INSTALLLIBOPT) $(SRCTOPDIR)/tests/unit/test-core.cc $(TOPDIR)/$(EXPORTDIR)/tests/unit/test-core.cc
-$(INSTALL) $(INSTALLLIBOPT) $(SRCTOPDIR)/tests/unit/test-permute.cc $(TOPDIR)/$(EXPORTDIR)/tests/unit/test-permute.cc
-$(INSTALL) $(INSTALLLIBOPT) $(SRCTOPDIR)/tests/unit/test-1body.cc $(TOPDIR)/$(EXPORTDIR)/tests/unit/test-1body.cc
$(INSTALL) $(INSTALLDIROPT) $(TOPDIR)/$(EXPORTDIR)/tests/hartree-fock
-$(INSTALL) $(INSTALLLIBOPT) $(SRCTOPDIR)/tests/hartree-fock/hartree-fock.cc $(TOPDIR)/$(EXPORTDIR)/tests/hartree-fock/hartree-fock.cc
-$(INSTALL) $(INSTALLLIBOPT) $(SRCTOPDIR)/tests/hartree-fock/hartree-fock++.cc $(TOPDIR)/$(EXPORTDIR)/tests/hartree-fock/hartree-fock++.cc
@@ -7,7 +7,7 @@ SRCDIR = ..
CPPFLAGS := -I../include -I../include/libint2 -Ieri -Ihartree-fock -DPREP_LIBINT2_SKIP_BOOST -DSRCDATADIR=\"$(SRCDIR)/lib/basis\" $(CPPFLAGS)
COMPUTE_LIB = -L../lib -lint2
check:: check1 check2 check3
check:: check1 check2 check3 check4
TEST1 = eri/test
check1:: $(TEST1)
@@ -16,8 +16,9 @@ check1:: $(TEST1)
$(TEST1): eri/test.o
$(LTLINK) $(CXX) $(LDFLAGS) $(COMPUTE_LIB) $(SYSLIBS) -o $@ $^
TEST2 = hartree-fock/hartree-fock
TEST3 = hartree-fock/hartree-fock++
TEST2 = unit/test
TEST3 = hartree-fock/hartree-fock
TEST4 = hartree-fock/hartree-fock++
check2::
check3::
@@ -29,9 +30,12 @@ ifeq ($(LIBINT_HAS_CXX11),yes)
ifeq ($(LIBINT_CONTRACTED_INTS),yes)
ifeq ($(LIBINT_SHELL_SET),1)
check2:: $(TEST2)
$^ hartree-fock/h2o.xyz | $(PYTHON) $^-validate.py
./$^
check3:: $(TEST3)
$^ hartree-fock/h2o.xyz | $(PYTHON) $^-validate.py
check4:: $(TEST4)
$^ hartree-fock/h2o_rotated.xyz | $(PYTHON) $^-validate.py $(SRCDIR)/MakeVars.features
endif
endif
@@ -40,16 +44,24 @@ check3:: $(TEST3)
endif
endif
$(TEST2): $(TEST2).o
CXXTEST2SRC = $(TEST2).cc $(TEST2)-core.cc $(TEST2)-permute.cc $(TEST2)-1body.cc
CXXTEST2OBJ = $(CXXTEST2SRC:%.cc=%.o)
CXXTEST2DEP = $(CXXTEST2SRC:%.cc=%.$(DEPSUF))
$(TEST2): $(CXXTEST2OBJ)
$(LTLINK) $(CXX) $(LDFLAGS) $(COMPUTE_LIB) $(SYSLIBS) -o $@ $^
$(TEST3): $(TEST3).o
$(LTLINK) $(CXX) $(LDFLAGS) $(COMPUTE_LIB) $(SYSLIBS) -o $@ $^
$(TEST4): $(TEST4).o
$(LTLINK) $(CXX) $(LDFLAGS) $(COMPUTE_LIB) $(SYSLIBS) -lpthread -o $@ $^
.PHONY: unpack_boost
$(TEST2).o :: unpack_boost
$(TEST3).o :: unpack_boost
$(TEST4).o :: unpack_boost
unpack_boost::
gunzip -c $(SRCDIR)/external/boost.tar.gz | tar -xf - -C $(TOPDIR)/include/libint2
@@ -58,7 +70,7 @@ clean:: targetclean
-rm -f */*.o */*.d
targetclean::
-rm -f $(TEST1) $(TEST2) $(TEST3)
-rm -f $(TEST1) $(TEST2) $(TEST3) $(TEST4)
distclean:: clean
View
@@ -74,7 +74,7 @@ namespace libint2 {
/// libint2::constants::codata_2010::bohr_to_angstrom
/// constant.
/// \return a std::vector of Atom objects
/// \throw std::runtime_error if cannot parse the contents of \c is
/// \throw std::logic_error if cannot parse the contents of \c is
inline std::vector<Atom> read_dotxyz(
std::istream& is,
const double bohr_to_angstrom = constants::codata_2010::bohr_to_angstrom) {
@@ -92,7 +92,7 @@ namespace libint2 {
// rest of lines are atoms
std::vector<Atom> atoms(natom);
for (auto i = 0; i < natom; i++) {
for (size_t i = 0; i < natom; i++) {
// read line
std::string line;
std::getline(is, line);
@@ -114,7 +114,7 @@ namespace libint2 {
if (Z == -1) {
std::ostringstream oss;
oss << "read_dotxyz: element symbol \"" << element_symbol << "\" is not recognized" << std::endl;
throw std::runtime_error(oss.str().c_str());
throw std::logic_error(oss.str().c_str());
}
atoms[i].atomic_number = Z;
Oops, something went wrong.

0 comments on commit c7b540e

Please sign in to comment.