Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.22...4.2)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake
${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
Expand Down
52 changes: 33 additions & 19 deletions INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,29 @@ In order to compile DFTB+, you need the following software components:

* C++ compiler (when built with ELSI/PEXSI or ChIMES support)

* CMake (version 3.16 or newer)
* CMake (version 3.22 or newer)

* GNU make

* LAPACK/BLAS libraries (or compatible equivalents)

* Python (version >= 3.2) for the source preprocessor
* Python (version >= 3.7) for the source preprocessor


Fortran compiler
----------------

The following Fortran compilers are known to build DFTB+ correctly:

* GNU >= 12.2
* GNU >= 13.2

* Intel >= 2021.5

* NAG >= 7.2 (when built without OpenMP support)

Older versions of the compilers above are likely to fail due to missing Fortran
features and/or compiler bugs. Compilers by other vendors may work, but have not
been tested extensively (see also `Tested build environments
Older versions of the compilers above may work but are neither tested nor
supported. Similarly, compilers by other vendors may work, but have not been
tested extensively (see also `Tested build environments
<#tested-build-environments>`_ and `Testing DFTB+ <#testing-dftb>`_).


Expand All @@ -52,11 +52,10 @@ Additionally there are optional requirements for some DFTB+ features:
* ScaLAPACK (version 2.0 or later) and a Fortran aware MPI framework, if you
want to build the MPI-parallelised version of the code.

* In addition to ScaLAPACK, for MPI parallel builds it is recommended
to use the `ELSI <https://wordpress.elsi-interchange.org/>`_ library
for large scale systems (versions 2.6.x – 2.11.x of the library,
with partial support for 2.5.0). If ELSI was compiled with PEXSI
included, you will also need a C++ compiler.
* In addition to ScaLAPACK, for MPI parallel builds it is recommended to use the
`ELSI <https://gitlab.com/elsi_project/elsi_interface/>`_ library for large
scale systems. If ELSI was compiled with PEXSI included, you will also need a
C++ compiler.

* The ARPACK-ng library if using the excited state DFTB functionality. For
MPI-parallel builds, the parallel version of ARPACK-ng (containing also
Expand All @@ -69,11 +68,26 @@ Additionally there are optional requirements for some DFTB+ features:
is controlled at runtime by the `MAGMA_NUM_GPUS` shell variable
(the usual default is 1).

* The `PLUMED2 <https://github.com/plumed/plumed2>`_ library for
* The `PLUMED2 <https://github.com/plumed/plumed2/>`_ library for
metadynamics simulations. If you build DFTB+ with MPI, the linked
PLUMED library must also be MPI-aware (and must have been built with
the same MPI-framework as DFTB+).

* The `TBLite <https://github.com/tblite/tblite/>`_ library for carrying out
simulations using xTB-type Hamiltonians.

* The `simple-dftd3 <https://github.com/dftd3/simple-dftd3/>`_ library for
D3-type dispersion.

* The `many-body dispersion <https://github.com/libmbd/libmbd/>`_ library for
taking many-body dispersions into account.

* The `ChIMES calculator <https://github.com/rk-lindsey/chimes_calculator/>`_
library for using Chebishev-polynomial based many-body repulsive interactions.

* The `libNEGF <https://github.com/libnegf/libnegf/>`_ library for carrying out
non-equilibrium Green's function based transport calculations.


External library requirements
-----------------------------
Expand All @@ -97,7 +111,7 @@ Requirements for testing DFTB+
In order to execute the code tests and validate them against precalculated
results, you will additionally need:

* Python (version >= 3.2) with NumPy
* Python (version >= 3.7) with NumPy

* The Slater-Koster data used in the tests (see below)

Expand All @@ -111,10 +125,6 @@ following architectures:
+---------------+----------------------+-------------+------------------+-----+
| Architecture | Compiler | MPI | Ext. libraries |Notes|
+===============+======================+=============+==================+=====+
| x86_64 / | GNU Fortran/C 12.2 | OpenMPI 4.1 | OpenBlas 0.3.21, | |
| Linux | | | ScaLAPACK 2.2, | |
| | | | ELSI 2.9 | |
+---------------+----------------------+-------------+------------------+-----+
| x86_64 / | GNU Fortran/C 13.2 | OpenMPI 5.0 | OpenBlas 0.3.25, | |
| Linux | | | ScaLAPACK 2.2, | |
| | | | ELSI 2.9 | |
Expand All @@ -123,14 +133,18 @@ following architectures:
| Linux | | | ScaLAPACK 2.2, | |
| | | | ELSI 2.11 | |
+---------------+----------------------+-------------+------------------+-----+
| x86_64 / | GNU Fortran/C 15.2 | OpenMPI 5.0 | OpenBlas 0.3.30, | |
| Linux | | | ScaLAPACK 2.2, | |
| | | | ELSI 2.12 | |
+---------------+----------------------+-------------+------------------+-----+
| x86_64 / | Intel Fortran/C | IntelMPI | MKL 2022.0, | |
| Linux | 2022.0 | 2021.5 | ELSI 2.8 | |
+---------------+----------------------+-------------+------------------+-----+
| x86_64 / | Intel Fortran/C | IntelMPI | MKL 2024.2, | |
| Linux | 2024.2 | 2021.14 | ELSI 2.11 | |
+---------------+----------------------+-------------+------------------+-----+
| x86_64 / | Intel Fortran/C | IntelMPI | MKL 2025.0, | |
| Linux | 2025.0 | 2021.14 | ELSI 2.11 | |
| x86_64 / | Intel Fortran/C | IntelMPI | MKL 2025.3, | |
| Linux | 2025.3 | 2021.17 | ELSI 2.12 | |
+---------------+----------------------+-------------+------------------+-----+
| x86_64 / | NAG Fortran 7.2 | MPICH 4.2 | OpenBlas 0.3.26 | [1] |
| Linux | GNU C 13.2 | | ScaLAPACK 2.2 | |
Expand Down
5 changes: 1 addition & 4 deletions cmake/DftbPlusUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,7 @@ function (dftbp_ensure_config_consistency)
endif()

# Check minimal compiler versions
# set(fortran_minimal_versions "GNU;12.2" "Intel;20.2" "IntelLLVM;2024.2" "NAG;7.2")
# Note: Intel new numbering system used in 'oneapi' is yyyy.v but the old system used xx.v
# The conversion OLD->NEW should be yyyy.v = 2001 + xx.v
set(fortran_minimal_versions "GNU;12.2" "Intel;2021.5" "IntelLLVM;2024.2" "NAG;7.2")
set(fortran_minimal_versions "GNU;13.2" "Intel;2021.5" "IntelLLVM;2024.2" "NAG;7.2")
dftbp_check_minimal_compiler_version("Fortran" "${fortran_minimal_versions}")

# Note: The consistency check below will / can not be executed in multi-config mode
Expand Down
18 changes: 10 additions & 8 deletions doc/dftb+/manual/dftbp.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1438,14 +1438,16 @@ \subsection{Density Functional based Tight Binding}
before proceeding to subsequent stages of the calculation (forces, analysis,
etc.).

\item[\is{RecomputeAfterDensity}] When set to \is{Yes} the electrostatic potentials
is updated with the newly computed DM and atomic charges. This is done in order to
make the electrostatic energy consistent and forces variational.
It can be set to \is{No} in transport calculations to avoid an unnecessary
invocation of the Poisson solver, when energy and forces are not relevant.
It should be set to \is{No} when the user would like to perform a fixed-charge
calculation with charges initialized from an external file. In this case
set \is{MaxSCCIterations=1} and \is{ReadInitialCharges=Yes}.
\item[\is{RecomputeAfterDensity}] When set to \is{Yes} the
electrostatic potentials is updated with the newly computed DM and
atomic charges. This is done in order to make the electrostatic
energy consistent and forces variational. It can be set to \is{No}
in transport calculations to avoid an unnecessary invocation of the
Poisson solver, when energy and forces are not relevant. It should
also be set to \is{No} when the user would like to perform a
fixed-charge calculation with charges that are initialized from an
external file. In this case also set \is{MaxSCCIterations=1} and
\is{ReadInitialCharges=Yes}.

\item[\is{EwaldParameter}] Sets the dimensionless parameter $\alpha$
in the Ewald electrostatic summation for periodic calculations. This
Expand Down
6 changes: 3 additions & 3 deletions src/dftbp/dftbplus/inputdata.F90
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,9 @@ module dftbp_dftbplus_inputdata
type(TReksInp) :: reksInp

!> Whether Scc should be updated with the output charges (obtained after diagonalization)
!> Could be set to .false. to prevent costly recalculations (e.g. when using Poisson-solver)
!> It can also be set to .false. in case of fixed-charge calculations
!> (e.g. when setting MaxSCCIterations=1; ReadInitialCharges=Yes)
!! Could be set to .false. to prevent costly recalculations (e.g. when using Poisson-solver)
!! It can also be set to .false. in case of fixed-charge calculations
!! (e.g. when setting MaxSCCIterations=1; ReadInitialCharges=Yes)
logical :: updateSccAfterDiag = .true.

!> Write cavity information as COSMO file
Expand Down
25 changes: 10 additions & 15 deletions src/dftbp/dftbplus/oldcompat.F90
Original file line number Diff line number Diff line change
Expand Up @@ -941,43 +941,38 @@ subroutine convert_13_14(root)

end subroutine convert_13_14

!> Converts input from version 14 to 15. (Version 15 August 2026)
!> Converts input from version 14 to 15. (Version 18 February 2026)
subroutine convert_14_15(root)

!> Root tag of the HSD-tree
type(fnode), pointer :: root

type(fnode), pointer :: ch1, ch2, par, hamil, dummy
logical :: tVal, tPoisson=.false.
logical :: isRecomputed

! Move RecomputeAfterDensity to the Hamiltonian block.
! The normal default is RecomputeAfterDensity=.true.
! Check if Poisson block is present. If NOT RecomputeAfterDensity will take the new default.
! Check if Poisson block is present. If NOT RecomputeAfterDensity will take the new default.
call getDescendant(root, "Hamiltonian/DFTB/Electrostatics/Poisson", ch1, parent=par)
if (associated(ch1)) then
tPoisson = .true.
end if
if (tPoisson) then
if (associated(ch1)) then
call getDescendant(root, "Hamiltonian/DFTB/Electrostatics/Poisson/RecomputeAfterDensity", &
& ch1, parent=par)
if (associated(ch1)) then
call getChildValue(par, "RecomputeAfterDensity", tVal)
call detailedWarning(ch1, "Keyword Moved to Hamiltonian {}.")
call getChildValue(par, "RecomputeAfterDensity", isRecomputed)
call detailedWarning(ch1, "Keyword Moved to Hamiltonian {} block.")
dummy => removeChild(par, ch1)
call destroyNode(ch1)
else
tVal = .false.
isRecomputed = .false.
end if
! Check if the tag is already present and issue an error.
call getDescendant(root, "Hamiltonian/DFTB/RecomputeAfterDensity", ch1)
if (associated(ch1)) then
call detailedError(ch1, "RecomputeAfterDensity already present.")
end if
if (associated(ch1)) call detailedError(ch1, "RecomputeAfterDensity is already present.")
call getDescendant(root, "Hamiltonian/DFTB", hamil)
call setChildValue(hamil, "RecomputeAfterDensity", tVal, child=ch2)
call setChildValue(hamil, "RecomputeAfterDensity", isRecomputed, child=ch2)
call setUnprocessed(ch2)
end if

end subroutine convert_14_15


Expand Down
2 changes: 2 additions & 0 deletions src/dftbp/dftbplus/parser.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3281,6 +3281,8 @@ subroutine readSccOptions(node, ctrl, geo)

call getChildValue(node, "RecomputeAfterDensity", ctrl%updateSccAfterDiag, .true.)

call getChildValue(node, "RecomputeAfterDensity", ctrl%updateSccAfterDiag, .true.)

end subroutine readSccOptions


Expand Down
Loading