# This is the DFTB+ fork used in the mobile app PHREEQC plus
## Changes in this fork
- added the stamp defining the release (formatout.F90)
- IMPORTANT: dftb+ binaries linked with libopenblas.a do not work in x86 devices - it is recommended to use liblapack.a and libblas.a
## Compilation - serial version
`bash
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/libblas.a/and/liblapack.a/
$ export PATH=$PATH:/path/to/include
$ export CFLAGS="-fPIC"
$ export CXXFLAGS="-fPIC"
$ export FFLAGS="-fPIC"
$ export LDFLAGS="-fPIC"
$ export CC=/path/to/your/cross-compiler
$ export CXX=/path/to/your/cross-compiler
$ export FC=/path/to/your/cross-compiler
$ cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install -DWITH_MPI=FALSE -DWITH_OMP=FALSE -DWITH_ARPACK=TRUE -DWITH_PLUMED=FALSE -DWITH_SOCKETS=FALSE -DWITH_GPU=FALSE -DWITH_MAGMA=FALSE -DWITH_POISSON=FALSE -DARPACK_LIBRARY=/path/to/libarpack.a -DWITH_TBLITE=TRUE -DWITH_MBD=TRUE -DWITH_TRANSPORT=FALSE -DWITH_SDFTD3=TRUE -DWITH_API=TRUE -DWITH_CHIMES=TRUE
open link.txt files and if they contain libblas.a in front of liblapack.a, change their order; for shared objects (*.so) delete -static manually to avoid linking error
$ make install
`
## Compilation - parallel version
`bash
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/libblas.a/and/liblapack.a/
$ export PATH=$PATH:/path/to/include
$ export CFLAGS="-pie -fPIC"
$ export CXXFLAGS="-pie -fPIC"
$ export FFLAGS="-pie -fPIC"
$ export LDFLAGS="-static -pie -fPIC"
$ export CC=/path/to/your/cross-compiler
$ export CXX=/path/to/your/cross-compiler
$ export FC=/path/to/your/cross-compiler
$ cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install -DWITH_MPI=FALSE -DWITH_OMP=TRUE -DWITH_ARPACK=TRUE -DWITH_PLUMED=FALSE -DWITH_SOCKETS=FALSE -DWITH_GPU=FALSE -DWITH_MAGMA=FALSE -DWITH_POISSON=FALSE -DARPACK_LIBRARY=/path/to/libarpack.a -DWITH_TBLITE=TRUE -DWITH_MBD=TRUE -DWITH_TRANSPORT=FALSE -DWITH_SDFTD3=TRUE -DWITH_API=TRUE -DWITH_CHIMES=TRUE
open link.txt files and if they contain libblas.a in front of liblapack.a, change their order; for shared objects (*.so) delete -static manually to avoid linking error ; substitute /path/libgomp.so for -lgomp and /path/libdl.so for -ldl
$ make install
`
# ORIGINAL DESCRIPTION:
DFTB+ is a software package for carrying out fast quantum mechanical atomistic calculations based on the Density Functional Tight Binding method. The most recent features are described in the (open access) DFTB+ paper.
DFTB+ can be either used as a standalone program or integrated into other software packages as a library.
The preferred way of obtaining DFTB+ is to install it via the conda package
management framework using Miniconda or Anaconda. Make sure to add/enable the
conda-forge
channel in order to be able to access DFTB+, and ensure that
the conda-forge
channel is the first repository to be searched for
packages. (Please consult the conda documentation for how to set-up your conda
environment.)
We recommend the use of the mamba installer, as we have experienced dependency resolution problems with the original conda installer in the past:
conda install -n base mamba
We provide several build variants, choose the one suiting your needs. For example, by issuing
mamba install 'dftbplus=*=nompi_*'
or
mamba install 'dftbplus=*=mpi_mpich_*'
or
mamba install 'dftbplus=*=mpi_openmpi_*'
to get the last stable release of DFTB+ with, respectively, serial (OpenMP-threaded) build or with MPI-parallelized build using either the MPICH or the Open MPI framework.
A non-MPI (OpenMP-threaded) distribution of the latest stable release can be found on the stable release page.
Note: This section describes the building with default settings (offering only a subset of all possible features in DFTB+) in a typical Linux environment. For more detailed information on the build customization and the build process, consult the detailed building instructions in INSTALL.rst.
Download the source code from the stable release page.
You need CMake (>= 3.16) to build DFTB+. If your environment offers no CMake or
only an older one, you can easily install the latest CMake via Python's pip
command:
pip install cmake
Start CMake by passing your compilers as environment variables (FC
and
CC
), and the location where the code should be installed and the build
directory (_build
) as options:
FC=gfortran CC=gcc cmake -DCMAKE_INSTALL_PREFIX=$HOME/opt/dftb+ -B _build .
If the configuration was successful, start the build with:
cmake --build _build -- -j
After successful build, you should test the code. First download the files needed for the test
./utils/get_opt_externals slakos ./utils/get_opt_externals gbsa
or
./utils/get_opt_externals ALL
and then run the tests with
pushd _build; ctest -j; popd
If the tests were successful, install the package with
cmake --install _build
For further details see the detailed building instructions.
In order to carry out calculations with DFTB+, you need according parameterisations (a.k.a. Slater-Koster files). You can download them from dftb.org.
Consult following resources for documentation:
- Step-by-step instructions with selected examples (DFTB+ Recipes)
- Reference manual describing all features (DFTB+ Manual)
When publishing results obtained with DFTB+, please cite following works:
- DFTB+, a software package for efficient approximate density functional theory based atomistic simulations; J. Chem. Phys. 152, 124101 (2020)
- Reference publications of the Slater-Koster parameterization sets you used. (See dftb.org for the references.)
- Methodological papers relevant to your calculations (e.g. excited states, electron-transport, third order DFTB etc.). References to these can be found in the DFTB+ manual.
New features, bug fixes, documentation, tutorial examples and code testing is welcome in the DFTB+ developer community!
The project is hosted on github. Please check CONTRIBUTING.rst and the DFTB+ developers guide for guide lines.
We are looking forward to your pull request!
DFTB+ is released under the GNU Lesser General Public License. See the included LICENSE file for the detailed licensing conditions.