|
| 1 | +name: build espresso |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + espresso_version: |
| 7 | + description: Quantum espresso version (e.g., 7.5) |
| 8 | + type: string |
| 9 | + default: 7.5 |
| 10 | + build_iteration: |
| 11 | + description: Build iteration |
| 12 | + type: number |
| 13 | + default: 1 |
| 14 | + |
| 15 | +jobs: |
| 16 | + build-espresso: |
| 17 | + runs-on: ${{ matrix.os }} |
| 18 | + strategy: |
| 19 | + matrix: |
| 20 | + os: |
| 21 | + - ubuntu-24.04 |
| 22 | + - ubuntu-24.04-arm |
| 23 | + permissions: |
| 24 | + contents: read |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@v5 |
| 27 | + |
| 28 | + - name: Set ENV variables |
| 29 | + run: | |
| 30 | + version=${{ inputs.espresso_version }} |
| 31 | + iteration=${{ inputs.build_iteration }} |
| 32 | + dependencies=$(cat .github/workflows/build-manifest.json | jq -r '(.dependencies // []) | map("--depends " + .) | join(" ")') |
| 33 | + arch=$(uname -m) |
| 34 | + echo "QE_VER=$version" >> "$GITHUB_ENV" |
| 35 | + echo "ITERATION=$iteration" >> "$GITHUB_ENV" |
| 36 | + echo "FPM_DEPS=$dependencies" >> "$GITHUB_ENV" |
| 37 | + echo "ARCH=$arch" >> "$GITHUB_ENV" |
| 38 | +
|
| 39 | + - name: Install build tools |
| 40 | + run: sudo apt update && sudo apt install -y $(cat .github/workflows/build-manifest.json | jq -r '(.build_tools // []) | join(" ")') |
| 41 | + |
| 42 | + - name: Setup fpm |
| 43 | + run: sudo apt install -y ruby && sudo gem install fpm |
| 44 | + |
| 45 | + - name: Install dependencies |
| 46 | + run: sudo apt install -y $(cat .github/workflows/build-manifest.json | jq -r '(.dependencies // []) | join(" ")') |
| 47 | + |
| 48 | + - name: Build espresso |
| 49 | + run: | |
| 50 | + INSTALL_PREFIX=/opt/espresso/${QE_VER} |
| 51 | + wget https://gitlab.com/QEF/q-e/-/archive/qe-${QE_VER}/q-e-qe-${QE_VER}.tar.gz |
| 52 | + tar -xf q-e-qe-${QE_VER}.tar.gz |
| 53 | + cd q-e-qe-${QE_VER} |
| 54 | +
|
| 55 | + ./configure CC=mpicc FC=mpifort F77=mpifort F90=mpifort \ |
| 56 | + MPIF90=mpif90 --prefix=${INSTALL_PREFIX} --enable-openmp |
| 57 | + make -j$(nproc) all |
| 58 | + cd EPW |
| 59 | + make -j$(nproc) all |
| 60 | + cd ../GWW/util |
| 61 | + FC=mpifort make all |
| 62 | + cd ../.. |
| 63 | + sudo make install |
| 64 | +
|
| 65 | + - name: Build deb package |
| 66 | + run: | |
| 67 | + fpm --verbose \ |
| 68 | + --force \ |
| 69 | + --debug \ |
| 70 | + --workdir "/tmp" \ |
| 71 | + --input-type "dir" \ |
| 72 | + --output-type "deb" \ |
| 73 | + --deb-user "root" \ |
| 74 | + --deb-group "root" \ |
| 75 | + --chdir "/opt/espresso/${QE_VER}/bin" \ |
| 76 | + --name "quantum-espresso" \ |
| 77 | + --prefix "/opt/espresso/${QE_VER}" \ |
| 78 | + --version "${QE_VER}" \ |
| 79 | + --iteration "${ITERATION}" \ |
| 80 | + --url "https://github.com/pranabdas/espresso" \ |
| 81 | + --maintainer "https://pranabdas.github.io" \ |
| 82 | + --architecture "$ARCH" \ |
| 83 | + --description "Quantum Espresso ${QE_VER} parallel GNU build for 24.04 LTS." ${FPM_DEPS} |
| 84 | +
|
| 85 | + - uses: actions/upload-artifact@v4 |
| 86 | + if: runner.arch == 'X64' |
| 87 | + with: |
| 88 | + name: quantum-espresso_${{ inputs.espresso_version }}-${{ inputs.build_iteration }}_amd64.deb |
| 89 | + path: quantum-espresso_${{ inputs.espresso_version }}-${{ inputs.build_iteration }}_amd64.deb |
| 90 | + |
| 91 | + - uses: actions/upload-artifact@v4 |
| 92 | + if: runner.arch == 'ARM64' |
| 93 | + with: |
| 94 | + name: quantum-espresso_${{ inputs.espresso_version }}-${{ inputs.build_iteration }}_arm64.deb |
| 95 | + path: quantum-espresso_${{ inputs.espresso_version }}-${{ inputs.build_iteration }}_arm64.deb |
0 commit comments