Skip to content

Conversation

awvwgk
Copy link
Member

@awvwgk awvwgk commented May 15, 2022

  • enable optional build with tblite
    • support as feature in meson (default: auto-detect)
    • support as option CMake (default: off?)
  • provide calculator implementation
    • basic single point calculator
    • allow selection of method or parameter file
    • allow creation of solvation models (separate PR)
    • provide info printout from parametrization (separate PR)
  • regression tests
  • documentation about new option

Closes #514

@awvwgk awvwgk added the library: tblite Related to the tblite library dependency label May 15, 2022
@awvwgk awvwgk force-pushed the tblite branch 5 times, most recently from a57f5b7 to 8560e0c Compare May 18, 2022 11:23
@awvwgk awvwgk force-pushed the tblite branch 4 times, most recently from aa96db5 to 4cdb451 Compare July 8, 2022 11:42
@awvwgk awvwgk added this to the v6.6.0 milestone Jul 8, 2022
@awvwgk awvwgk marked this pull request as ready for review October 1, 2022 07:01
@awvwgk
Copy link
Member Author

awvwgk commented Oct 1, 2022

This is mostly complete, in case anyone is interested in helping to get it merged let me know.

@awvwgk awvwgk force-pushed the tblite branch 3 times, most recently from 5dce44d to f3079b5 Compare October 23, 2022 09:56
@awvwgk
Copy link
Member Author

awvwgk commented Oct 23, 2022

Ready for review.

@awvwgk awvwgk requested review from cplett and marcelmbn October 23, 2022 10:08
- Support for passing through options to tblite
- Update OpenMP linking
@MtoLStoN
Copy link
Contributor

MtoLStoN commented Nov 10, 2022

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.

@awvwgk
Copy link
Member Author

awvwgk commented Nov 10, 2022

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.

Signed-off-by: MtoLStoN <70513124+MtoLStoN@users.noreply.github.com>
@MtoLStoN
Copy link
Contributor

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.

@MtoLStoN
Copy link
Contributor

Thanks for sharing.

@MtoLStoN MtoLStoN merged commit 729bdeb into grimme-lab:main Nov 29, 2022
@awvwgk awvwgk deleted the tblite branch November 29, 2022 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
library: tblite Related to the tblite library dependency
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integration of tblite library
3 participants