xtb
xtb copied to clipboard
Integrate tblite library for evaluating xTB Hamiltonians
- [x] enable optional build with tblite
- [x] support as feature in meson (default: auto-detect)
- [x] support as option CMake (default: off?)
- [x] provide calculator implementation
- [x] basic single point calculator
- [x] allow selection of method or parameter file
- ~~allow creation of solvation models~~ (separate PR)
- ~~provide info printout from parametrization~~ (separate PR)
- [ ] regression tests
- [x] documentation about new option
Closes #514
This is mostly complete, in case anyone is interested in helping to get it merged let me know.
Ready for review.
I cannot compile a static version of this anymore with the latest intel compiler (using -static -OpenMP linking flags). However, some trial and error let me narrow this down to the ifcore
library, which is probably used by one of the subprojects (json_fortran?). Adding an explicit -lifcoremt
to the linker flags fixes this for me.
A way to fix this via the meson build system would be to add an ifcoremt library dependency to tblite.
lib_deps += fc.find_library('ifcoremt')
somewhere here https://github.com/tblite/tblite/blob/fa115545f7a6ba8e3f0e62df5cdace8781f4d309/config/meson.build#L143-L145
But this probably needs to be customized for the various compilers we use.
Yes, that is due to libraries without direct OpenMP dependency in the tree, but will only pop up for static linking with Intel. For dist I recommend to use
Linux
meson setup _build \
-Dprefix=/ \
-Dlibdir=lib \
-Dbuildtype=release \
-Dfortran_link_args="-lifcoremt -static" \
-Ddefault_library=static \
-Dlapack=mkl
meson compile -C _build
meson install -C _build --destdir $PWD/xtb-dist
Windows (powershell)
meson setup _build `
-Dfortran_args="/fpp" `
-Ddefault_library=static `
-Db_vscrt=mt `
-Dbuildtype=release `
-lapack=custom `
-Dfortran_link_args="mkl_intel_lp64.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib ifcoremt.lib /STACK:16777216"
meson compile -C _build
meson install -C _build --destdir $pwd\xtb-dist
cp $env:MKLROOT\..\..\compiler\latest\windows\redist\intel64_win\compiler\libiomp5md.dll xtb-dist\bin
Might work to just drop-in -Dfortran_args=-qopenmp
/ -Dfortran_args=/qopenmp
instead of messing with the link arguments.
Agree. As stated, adding an explicit -lifcoremt linker flag works for me for static linking. However, the dynamic build needs an additional "-qopenmp" linker flag to compile, which is nothing terrible, but we should probably include that in the README to prevent future questions.
Otherwise, this looks good to me.
Thanks for sharing.