Validate MD restart files (#1431) #2245
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: [push, pull_request] | |
| env: | |
| BUILD_DIR: _build | |
| jobs: | |
| gcc-meson-build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| version: [12, 13, 14] | |
| include: | |
| - os: ubuntu-22.04 | |
| version: 10 | |
| - os: ubuntu-22.04 | |
| version: 11 | |
| - os: ubuntu-24.04-arm | |
| version: 14 | |
| - os: macos-15-intel | |
| version: 15 | |
| - os: macos-latest | |
| version: 14 | |
| - os: macos-latest | |
| version: 15 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.x | |
| - name: Install OpenBLAS (macOS) | |
| if: ${{ contains(matrix.os, 'macos') }} | |
| run: | | |
| brew install openblas | |
| echo "PKG_CONFIG_PATH=/usr/local/opt/openblas/lib/pkgconfig" >> $GITHUB_ENV | |
| echo "LDFLAGS=-L/opt/homebrew/opt/openblas/lib" >> $GITHUB_ENV | |
| echo "CPPFLAGS=-I/opt/homebrew/opt/openblas/include" >> $GITHUB_ENV | |
| - name: Install OpenBLAS (ubuntu-latest) | |
| if: ${{ matrix.os == 'ubuntu-latest' || contains(matrix.os, 'ubuntu-24.04') }} | |
| run: | | |
| sudo apt-get install libopenblas-dev | |
| - name: Install meson | |
| run: pip install meson==1.7.0 ninja | |
| - name: Configure build | |
| run: > | |
| meson setup ${{ env.BUILD_DIR }} --buildtype=debug --warnlevel=0 -Db_coverage=true ${{ env.MESON_ARGS }} | |
| env: | |
| FC: gfortran-${{ matrix.version }} | |
| CC: gcc-${{ matrix.version }} | |
| MESON_ARGS: ${{ contains(matrix.os, 'macos') && '-Dlapack=openblas' || '-Dlapack=netlib' }} | |
| - name: Build project | |
| run: meson compile -C ${{ env.BUILD_DIR }} | |
| - name: Run unit tests | |
| run: meson test -C ${{ env.BUILD_DIR }} --print-errorlogs --no-rebuild -t 120 --suite xtb | |
| env: | |
| OMP_NUM_THREADS: 2,1 | |
| - name: Upload coverage report | |
| run: bash <(curl -s https://codecov.io/bash) | |
| gcc-cmake-build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, ubuntu-24.04-arm] | |
| fc: [gfortran-14] | |
| cc: [gcc-14] | |
| build: [Release, Debug] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.x | |
| - name: Install OpenBLAS (ubuntu-latest) | |
| if: ${{ matrix.os == 'ubuntu-latest' || contains(matrix.os, 'ubuntu-24.04') }} | |
| run: | | |
| sudo apt-get install libopenblas-dev | |
| - name: Install CMake | |
| run: pip install ninja cmake | |
| - name: Configure build | |
| run: cmake -B ${{ env.BUILD_DIR }} -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build }} | |
| env: | |
| FC: ${{ matrix.fc }} | |
| CC: ${{ matrix.cc }} | |
| - name: Build project | |
| run: cmake --build ${{ env.BUILD_DIR }} | |
| - name: Run unit tests | |
| run: ctest --parallel --output-on-failure -R 'xtb/*' -E 'tblite/gfn1-xtb' | |
| working-directory: ${{ env.BUILD_DIR }} | |
| env: | |
| OMP_NUM_THREADS: 2,1 | |
| xtb-lightweight-meson-build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| fc: [gfortran-14] | |
| cc: [gcc-14] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.10.x | |
| - name: Install OpenBLAS (ubuntu-latest) | |
| if: ${{ matrix.os == 'ubuntu-latest' || contains(matrix.os, 'ubuntu-24.04') }} | |
| run: | | |
| sudo apt-get install libopenblas-dev | |
| - name: Install meson | |
| run: pip3 install meson==0.62.0 ninja cmake | |
| - name: Configure build | |
| run: > | |
| meson setup ${{ env.BUILD_DIR }} --buildtype=debug --warnlevel=0 ${{ env.MESON_ARGS }} | |
| env: | |
| FC: ${{ matrix.fc }} | |
| CC: ${{ matrix.cc }} | |
| MESON_ARGS: ${{ '-Dlapack=netlib -Dtblite=disabled -Dcpcmx=disabled' }} | |
| - name: Build project | |
| run: meson compile -C ${{ env.BUILD_DIR }} | |
| - name: Run unit tests | |
| run: meson test -C ${{ env.BUILD_DIR }} --print-errorlogs --no-rebuild -t 120 --suite xtb | |
| env: | |
| OMP_NUM_THREADS: 2,1 | |
| xtb-lightweight-cmake-build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| fc: [gfortran-14] | |
| cc: [gcc-14] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.x | |
| - name: Install OpenBLAS (ubuntu-latest) | |
| if: ${{ matrix.os == 'ubuntu-latest' || contains(matrix.os, 'ubuntu-24.04') }} | |
| run: | | |
| sudo apt-get install libopenblas-dev | |
| - name: Install CMake | |
| run: pip3 install ninja cmake | |
| - name: Configure build | |
| run: cmake -B ${{ env.BUILD_DIR }} -DWITH_CPCMX=false -DWITH_TBLITE=false -G Ninja | |
| env: | |
| FC: ${{ matrix.fc }} | |
| CC: ${{ matrix.cc }} | |
| - name: Build project | |
| run: cmake --build ${{ env.BUILD_DIR }} | |
| - name: Run unit tests | |
| run: ctest --parallel --output-on-failure -R 'xtb/*' | |
| working-directory: ${{ env.BUILD_DIR }} | |
| env: | |
| OMP_NUM_THREADS: 2,1 | |
| # Test native MinGW Windows build | |
| mingw-meson-build: | |
| runs-on: windows-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: [{msystem: MINGW64, arch: x86_64,} | |
| # { msystem: MINGW32, arch: i686 } | |
| ] | |
| defaults: | |
| run: | |
| shell: msys2 {0} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup MSYS2 toolchain | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: ${{ matrix.msystem }} | |
| update: false | |
| install: >- | |
| git | |
| mingw-w64-${{ matrix.arch }}-gcc-fortran | |
| mingw-w64-${{ matrix.arch }}-openblas | |
| mingw-w64-${{ matrix.arch }}-lapack | |
| mingw-w64-${{ matrix.arch }}-python | |
| mingw-w64-${{ matrix.arch }}-python-pip | |
| mingw-w64-${{ matrix.arch }}-meson | |
| mingw-w64-${{ matrix.arch }}-ninja | |
| - name: Configure build | |
| run: meson setup ${{ env.BUILD_DIR }} -Dlapack=netlib --warnlevel=0 | |
| env: | |
| FC: gfortran | |
| CC: gcc | |
| - name: Build project | |
| run: meson compile -C ${{ env.BUILD_DIR }} | |
| - name: Run unit tests | |
| run: meson test -C ${{ env.BUILD_DIR }} --print-errorlogs --no-rebuild -t 120 --suite xtb | |
| env: | |
| OMP_NUM_THREADS: 1 | |
| intel-meson-build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| fc: [ifort] | |
| cc: [icc] | |
| env: | |
| FC: ${{ matrix.fc }} | |
| CC: ${{ matrix.cc }} | |
| APT_PACKAGES: >- | |
| intel-oneapi-compiler-fortran-2022.1.0 intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2022.1.0 intel-oneapi-mkl-2022.1.0 intel-oneapi-mkl-devel-2022.1.0 asciidoctor | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.x | |
| - run: pip3 install meson==1.7.0 ninja --user | |
| - name: Add Intel repository | |
| if: contains(matrix.os, 'ubuntu') | |
| run: | | |
| wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB | |
| sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB | |
| rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB | |
| echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list | |
| sudo apt-get update | |
| - name: Install Intel oneAPI compiler | |
| if: contains(matrix.os, 'ubuntu') | |
| run: | | |
| sudo apt-get install ${APT_PACKAGES} | |
| source /opt/intel/oneapi/setvars.sh | |
| printenv >> $GITHUB_ENV | |
| - name: Configure meson build | |
| run: > | |
| meson setup ${{ env.BUILD_DIR }} --prefix=/ --libdir=lib | |
| -Dfortran_link_args="-lifcoremt -static" | |
| -Ddefault_library=static | |
| -Dlapack=mkl | |
| - name: Build project | |
| run: ninja -C ${{ env.BUILD_DIR }} | |
| - name: Run unit tests | |
| run: > | |
| meson test -C ${{ env.BUILD_DIR }} --print-errorlogs --num-processes 1 | |
| --no-rebuild --suite xtb -t 120 | |
| env: | |
| OMP_NUM_THREADS: 2,1 | |
| - name: Install package | |
| run: | | |
| meson install -C ${{ env.BUILD_DIR }} --no-rebuild | |
| tar cJvf xtb-bleed.tar.xz xtb-bleed | |
| env: | |
| DESTDIR: ${{ env.PWD }}/xtb-bleed | |
| - name: Upload binary | |
| if: github.event_name == 'push' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: xtb-bleed.tar.xz | |
| path: xtb-bleed.tar.xz | |
| intel-ifx-cmake-build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| build: [Release] | |
| toolchain: | |
| - {compiler: intel, version: '2024.1'} | |
| # - {compiler: intel, version: '2025.0'} SegFault in disp/ncoord.f90 near 'do concurrent(tx = -rep_cn(1):rep_cn(1), &' | |
| # - {compiler: intel, version: '2025.1'} # Worked fine as of Jul 2, 2025; commit d3f212ba83287290efafee6580670d02d7b2f49d | |
| - {compiler: intel, version: '2025.2'} | |
| env: | |
| APT_PACKAGES: >- | |
| intel-oneapi-mkl-${{ matrix.toolchain.version }} intel-oneapi-mkl-devel-${{ matrix.toolchain.version }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Fortran | |
| uses: fortran-lang/setup-fortran@v1 | |
| with: | |
| compiler: ${{ matrix.toolchain.compiler }} | |
| version: ${{ matrix.toolchain.version }} | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.x | |
| - run: pip3 install cmake ninja --user | |
| - name: Install Intel MKL | |
| if: contains(matrix.os, 'ubuntu') | |
| run: | | |
| sudo apt-get install ${APT_PACKAGES} | |
| source /opt/intel/oneapi/setvars.sh --force | |
| printenv >> $GITHUB_ENV | |
| - name: Configure cmake build | |
| run: > | |
| cmake -B ${{ env.BUILD_DIR }} -G Ninja | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build }} | |
| -DCMAKE_C_COMPILER=icx | |
| -DCMAKE_Fortran_COMPILER=ifx | |
| -DBLA_VENDOR=Intel10_64lp | |
| -DWITH_TBLITE=ON | |
| -DWITH_CPCMX=ON | |
| - name: Build project | |
| run: ninja -C ${{ env.BUILD_DIR }} | |
| - name: Run unit tests | |
| run: ctest --parallel --output-on-failure -R 'xtb/*' | |
| working-directory: ${{ env.BUILD_DIR }} | |
| env: | |
| OMP_NUM_THREADS: 2,1 | |
| intel-ifx-meson-build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| toolchain: | |
| - {compiler: intel, version: '2024.1'} | |
| # - {compiler: intel, version: '2025.0'} SegFault in disp/ncoord.f90 near 'do concurrent(tx = -rep_cn(1):rep_cn(1), &' | |
| - {compiler: intel, version: '2025.1'} | |
| env: | |
| APT_PACKAGES: >- | |
| intel-oneapi-mkl-${{ matrix.toolchain.version }} intel-oneapi-mkl-devel-${{ matrix.toolchain.version }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Fortran | |
| uses: fortran-lang/setup-fortran@v1 | |
| with: | |
| compiler: ${{ matrix.toolchain.compiler }} | |
| version: ${{ matrix.toolchain.version }} | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.x | |
| - run: pip3 install meson==1.7.0 ninja --user | |
| - name: Install Intel MKL | |
| if: contains(matrix.os, 'ubuntu') | |
| run: | | |
| sudo apt-get install ${APT_PACKAGES} | |
| source /opt/intel/oneapi/setvars.sh --force | |
| printenv >> $GITHUB_ENV | |
| - name: Configure meson build | |
| run: > | |
| CC=${{ env.CC }} FC=${{ env.FC }} meson setup ${{ env.BUILD_DIR }} | |
| --prefix=/ --libdir=lib | |
| -Dfortran_link_args="-lifcoremt -static" | |
| -Ddefault_library=static | |
| -Dlapack=mkl | |
| -Dtblite=disabled | |
| - name: Build project | |
| run: ninja -C ${{ env.BUILD_DIR }} | |
| - name: Run unit tests | |
| run: > | |
| meson test -C ${{ env.BUILD_DIR }} --print-errorlogs --num-processes 1 | |
| --no-rebuild --suite xtb -t 120 | |
| env: | |
| OMP_NUM_THREADS: 2,1 | |
| mingw-meson-static-build: | |
| runs-on: windows-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - { msystem: MINGW64, arch: x86_64 } | |
| defaults: | |
| run: | |
| shell: msys2 {0} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup MSYS2 toolchain | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: ${{ matrix.msystem }} | |
| update: false | |
| install: >- | |
| git | |
| mingw-w64-${{ matrix.arch }}-gcc-fortran | |
| mingw-w64-${{ matrix.arch }}-lapack | |
| mingw-w64-${{ matrix.arch }}-python | |
| mingw-w64-${{ matrix.arch }}-python-pip | |
| mingw-w64-${{ matrix.arch }}-meson | |
| mingw-w64-${{ matrix.arch }}-ninja | |
| mingw-w64-${{ matrix.arch }}-binutils | |
| mingw-w64-${{ matrix.arch }}-ntldd | |
| zip | |
| # Configure static build with an absolute install location | |
| - name: Configure build (static) | |
| run: > | |
| meson setup ${{ env.BUILD_DIR }} | |
| --prefix="$PWD/xtb-bleed-windows" | |
| --libdir=lib | |
| -Ddefault_library=static | |
| -Dlapack=netlib | |
| -Db_lto=false | |
| --buildtype release | |
| --optimization 2 | |
| --warnlevel=0 | |
| env: | |
| CC: gcc | |
| FC: gfortran | |
| PKG_CONFIG_ALL_STATIC: "1" | |
| CFLAGS: "-fno-strict-aliasing" | |
| FFLAGS: "-fno-strict-aliasing" | |
| LDFLAGS: "-static -static-libgcc -static-libgfortran -static-libstdc++ -Wl,--as-needed -lquadmath" | |
| - name: Build project | |
| run: | | |
| meson compile -C ${{ env.BUILD_DIR }} | |
| - name: Run unit tests | |
| run: | | |
| meson test -C ${{ env.BUILD_DIR }} --print-errorlogs --no-rebuild -t 120 --suite xtb | |
| env: | |
| OMP_NUM_THREADS: 2 | |
| - name: Install package | |
| run: | | |
| meson install -C ${{ env.BUILD_DIR }} --no-rebuild | |
| - name: Bundle Runtime DLLs | |
| run: | | |
| [ -d "xtb-bleed-windows/bin" ] || mkdir -p "xtb-bleed-windows/bin" | |
| WANTED_DLLS=("libblas.dll" "liblapack.dll" "libgfortran-5.dll" "libgcc_s_seh-1.dll" "libquadmath-0.dll" "libwinpthread-1.dll") | |
| for dll in "${WANTED_DLLS[@]}"; do | |
| dll_path=$(which "$dll" || true) | |
| if [ -f "$dll_path" ]; then | |
| echo "Bundling $dll from $dll_path" | |
| cp "$dll_path" "xtb-bleed-windows/bin/" | |
| else | |
| echo "::warning::$dll not found in PATH. The binary might fail on other machines." | |
| fi | |
| done | |
| - name: Create distributable zip | |
| run: | | |
| zip -r xtb-bleed-windows.zip xtb-bleed-windows | |
| - name: Upload binary | |
| if: github.event_name == 'push' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: xtb-bleed-windows.zip | |
| path: xtb-bleed-windows.zip | |
| # Inspired from https://github.com/endless-sky/endless-sky | |
| continuous-delivery: | |
| if: github.event_name == 'push' | |
| runs-on: ubuntu-latest | |
| needs: | |
| - intel-meson-build | |
| - mingw-meson-static-build | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| RELEASE_TAG: bleed | |
| OUTPUT_INTEL: xtb-bleed.tar.xz | |
| OUTPUT_WINDOWS: xtb-bleed-windows.zip | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install github-release | |
| run: | | |
| go install github.com/github-release/github-release@latest | |
| echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV | |
| echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
| - name: Set environment variables | |
| run: | | |
| echo "GITHUB_USER=$( echo ${{ github.repository }} | cut -d/ -f1 )" >> $GITHUB_ENV | |
| echo "GITHUB_REPO=$( echo ${{ github.repository }} | cut -d/ -f2 )" >> $GITHUB_ENV | |
| - name: Move/Create continuous tag | |
| run: | | |
| git tag --force ${{ env.RELEASE_TAG }} ${{ github.sha }} | |
| git push --tags --force | |
| - name: Get Time | |
| run: echo "TIME=$(date -u '+%Y/%m/%d, %H:%M')" >> $GITHUB_ENV | |
| - name: Check continuous release status | |
| run: | | |
| if ! github-release info -t ${{ env.RELEASE_TAG }} > /dev/null 2>&1; then | |
| echo "RELEASE_COMMAND=release" >> $GITHUB_ENV | |
| else | |
| echo "RELEASE_COMMAND=edit" >> $GITHUB_ENV | |
| fi | |
| - name: Setup continuous release | |
| run: > | |
| github-release ${{ env.RELEASE_COMMAND }} --tag ${{ env.RELEASE_TAG }} | |
| --name "Bleeding edge version" --description "$DESCRIPTION" --pre-release | |
| env: | |
| DESCRIPTION: | | |
| Created on ${{ env.TIME }} UTC by @${{ github.actor }} with commit ${{ github.sha }}. | |
| This is an automated distribution of the latest `xtb` version. This version is only minimally tested and may be unstable or even crash. Use with caution! | |
| https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v4.1.7 | |
| with: | |
| path: ${{ github.workspace }} | |
| - name: Create SHA256 checksums | |
| run: | | |
| sha256sum "${{ env.OUTPUT_INTEL }}/${{ env.OUTPUT_INTEL }}" > "${{ env.OUTPUT_INTEL }}.sha256" | |
| sha256sum "${{ env.OUTPUT_WINDOWS }}/${{ env.OUTPUT_WINDOWS }}" > "${{ env.OUTPUT_WINDOWS }}.sha256" | |
| - name: Add Linux Intel to release tag | |
| run: > | |
| github-release upload --tag ${{ env.RELEASE_TAG }} --replace | |
| --name ${{ env.OUTPUT_INTEL }} --file ${{ env.OUTPUT_INTEL }}/${{ env.OUTPUT_INTEL }} | |
| - name: Add Linux Intel SHA256 checksums to release tag | |
| run: > | |
| github-release upload --tag ${{ env.RELEASE_TAG }} --replace | |
| --name "${{ env.OUTPUT_INTEL }}.sha256" --file ${{ env.OUTPUT_INTEL }}.sha256 | |
| - name: Add Windows GNU to release tag | |
| run: > | |
| github-release upload --tag ${{ env.RELEASE_TAG }} --replace | |
| --name ${{ env.OUTPUT_WINDOWS }} --file ${{ env.OUTPUT_WINDOWS }}/${{ env.OUTPUT_WINDOWS }} | |
| - name: Add Windows GNU SHA256 checksums to release tag | |
| run: > | |
| github-release upload --tag ${{ env.RELEASE_TAG }} --replace | |
| --name "${{ env.OUTPUT_WINDOWS }}.sha256" --file ${{ env.OUTPUT_WINDOWS }}.sha256 |