Skip to content

Commit

Permalink
Add --disable-libint option and make possible to build without libint
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandrogallo committed Nov 18, 2022
1 parent 03540e3 commit 0696c9b
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 11 deletions.
26 changes: 21 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,24 @@ AC_ARG_WITH(libint,
LIBINT_LD_LIBRARY_PATH="`readlink -f $withval`/lib";
LIBS="${LIBS} -L${LIBINT_LD_LIBRARY_PATH} -lint2"
BUILD_LIBINT=NO],
[BUILD_LIBINT=YES
external_ldflags_add "libint/lib/libint2.a"
external_cppflags_add "libint/include/"
EXTERNAL_DEPENDENCIES="libint ${EXTERNAL_DEPENDENCIES}"])
[BUILD_LIBINT=YES])

AC_ARG_ENABLE([libint],
[AS_HELP_STRING([--disable-libint],
[Don't enable libint if it is not going to be used])],
[DISABLE_LIBINT=yes
BUILD_LIBINT=NO],
[DISABLE_LIBINT=no
AC_DEFINE([HAVE_LIBINT],
[1],
[Wether libint is used])])

# Do this here after --disable-libint has been processed
if test x$BUILD_LIBINT = xYES; then
EXTERNAL_DEPENDENCIES="libint ${EXTERNAL_DEPENDENCIES}"
external_ldflags_add "libint/lib/libint2.a"
external_cppflags_add "libint/include/"
fi

dnl EIGEN WITH OPTION
AC_ARG_WITH(eigen,
Expand Down Expand Up @@ -253,17 +267,19 @@ dnl -----------------------------------------------------------------------
dnl CHECK LIBINT
dnl -----------------------------------------------------------------------
AM_CONDITIONAL([WITH_BUILD_LIBINT], [test x${BUILD_LIBINT} = xYES])
AM_CONDITIONAL([DISABLE_LIBINT], [test x${DISABLE_LIBINT} = xyes])
LIBINT_MAX_AM=4
AC_ARG_VAR([LIBINT_MAX_AM],
[Maximum angular momentum for libint. Default: 4],)
if test xNO = x${BUILD_LIBINT}; then
if test xNO = x${BUILD_LIBINT} && test x${DISABLE_LIBINT} = xno; then
CPPFLAGS="$CPPFLAGS -I${LIBINT_CPATH}"
#LDFLAGS="$LDFLAGS -L${LIBINT_LD_LIBRARY_PATH} -lint2"
AC_CHECK_HEADER([libint2.h],
[],
[AC_MSG_ERROR([no libint2.hpp header found in $CPPFLAGS])])
fi


dnl -----------------------------------------------------------------------
dnl CHECK EIGEN
dnl -----------------------------------------------------------------------
Expand Down
40 changes: 38 additions & 2 deletions docs/manual.org
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#+macro: sisi4s =SiSi4S=
#+macro: libint [[https://github.com/evaleev/libint][libint]]

* Introduction

Expand Down Expand Up @@ -53,9 +54,44 @@ in which case you can test the following



** TODO Libint
** Libint

We use the {{{libint}}} library
for some algorithms such as molecular Hartree-Fock.

Our build system is able to compile the library on itself.
Notable dependencies of {{{libint}}}
are =libboost= and =libgmp=.

On systems similar to ubuntu these packages should be available
under package identifiers similar to

- =libgmp3-dev=
- =libboost1.71-all-dev=

Please refer to {{{libint}}}'s website
for further information.

*** Using an already compiled version

If you want to reuse an already compiled verison of {{{libint}}}
you can give the path to the configure script such as

#+begin_src shell :eval no
./configure --with-libint=/absolute/path/to/your/libint
#+end_src

*** Disabling libint

If you don't want to use [[https://github.com/evaleev/libint][libint]] since it takes
a long time to build and it requires =libboost=,
you can disable the algorithms that use it with the
=configure= flag

#+begin_src shell :eval no
./configure --disable-libint
#+end_src

- =BOOST_ROOT=

** TODO CTF

Expand Down
8 changes: 4 additions & 4 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,14 @@ sisi4s_SOURCES = \
./algorithms/Nop.cxx \
./algorithms/PQRSCoulombIntegralsToVertex.cxx

## FOR LIBINT2
sisi4s_SOURCES += \
if DISABLE_LIBINT
else
sisi4s_SOURCES += \
./algorithms/HartreeFockFromGaussian.cxx \
./algorithms/OneBodyFromGaussian.cxx \
./algorithms/NuclearRepulsionEnergy.cxx \
./algorithms/CoulombIntegralsFromGaussian.cxx
endif

sisi4s_CPPFLAGS = $(EXTERNAL_CPPFLAGS)
sisi4s_LDADD = $(EXTERNAL_LDFLAGS)
Expand All @@ -116,10 +118,8 @@ sisi4s_LDADD = $(EXTERNAL_LDFLAGS)
## ./algorithms/UPerturbativeTriples.cxx \
## ./algorithms/DoublesAmplitudesFromVertex.cxx \
## ./algorithms/ComplexTensorSum.cxx \
## ./algorithms/TensorContraction.cxx \
## ./algorithms/ApproximateParticleHoleCoulombVertex.cxx \
## ./algorithms/PerturbativeTriples.cxx \
## ./algorithms/CoulombVertexDecomposition.cxx \
## ./algorithms/ParticleHoleCoulombVertexDecomposition.cxx \
Expand Down

0 comments on commit 0696c9b

Please sign in to comment.