Skip to content

Commit 1e36c75

Browse files
committed
Release v0.3.0
GitHub actions doesn't support ubuntu-18.04 any more, so binaries are now built with ubuntu-20.04. Update the CI scripts.
1 parent f4718dc commit 1e36c75

File tree

7 files changed

+98
-50
lines changed

7 files changed

+98
-50
lines changed

.github/workflows/deploy-mdbook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
name: Build, Test and Deploy
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v3
1313
- uses: actions-rs/toolchain@v1
1414
with:
1515
toolchain: stable

.github/workflows/releases-readme.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,23 @@ compiled inside the `hyperdrive` binary.
3131
An NVIDIA license may also be included as, per the terms of the license,
3232
`hyperdrive` utilises code that was modified from an existing CUDA example.
3333

34-
# x86-64-v3?
34+
# What are these different x86-64 versions?
3535

36-
This is a [microarchitecture
37-
level](https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels). By
36+
They are [microarchitecture
37+
levels](https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels). By
3838
default, Rust compiles for all x86-64 CPUs; this allows maximum compatibility,
3939
but potentially limits the runtime performance because many modern CPU features
4040
can't be used. Compiling at different levels allows the code to be optimised for
4141
different classes of CPUs so users can get something that works best for them.
4242

43-
If your CPU does not support x86-64-v3, you will need to compile `hyperdrive`
44-
from source.
43+
If your CPU does not support the available microarchitecture levels on the
44+
GitHub release page, you will need to compile `hyperdrive` from source.
4545

4646
# CUDA?
4747

4848
The releases with "CUDA" in the name are CUDA enabled. The `hyperdrive` binaries
49-
have been dynamically linked against CUDA 11.2.0; to run them, a CUDA
50-
installation on version 11 is required.
49+
have been dynamically linked against CUDA 12.2.0; to run them, a CUDA
50+
installation on version 12 is required.
5151

5252
There is also a double- or single-precision version of `hyperdrive` provided. If
5353
you're running a desktop NVIDIA GPU (e.g. RTX 2070), then you probably want the

.github/workflows/releases.yml

Lines changed: 64 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ env:
1414
jobs:
1515
build-linux-release:
1616
name: Build release for Linux
17-
runs-on: ubuntu-18.04
17+
runs-on: ubuntu-20.04
1818

1919
steps:
2020
- name: Checkout sources
21-
uses: actions/checkout@v2
21+
uses: actions/checkout@v3
2222
with:
2323
fetch-depth: 0
2424

@@ -32,14 +32,39 @@ jobs:
3232
cmake \
3333
curl \
3434
git \
35+
libz-dev \
36+
software-properties-common \
3537
;
38+
39+
# This comes from software-properties-common, and is only necessary
40+
# to install gcc-12. Remove this when we use a newer ubuntu image.
41+
# https://stackoverflow.com/a/67453352
42+
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
43+
sudo apt update -y
44+
sudo apt install -y gcc-11 g++-11
45+
sudo update-alternatives \
46+
--install /usr/bin/gcc gcc /usr/bin/gcc-11 110 \
47+
--slave /usr/bin/g++ g++ /usr/bin/g++-11 \
48+
--slave /usr/bin/gcov gcov /usr/bin/gcov-11 \
49+
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-11 \
50+
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-11
51+
gcc --version
52+
g++ --version
53+
gcov --version
54+
55+
# Compile cfitsio from source to get its static library.
56+
curl https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-4.3.0.tar.gz -O
57+
tar -xvf cfitsio-4.3.0.tar.gz && cd cfitsio-4.3.0
58+
CFLAGS="-fPIE -O3 -march=x86-64-v2" ./configure --enable-reentrant --disable-curl --enable-sse2 --enable-ssse3 --libdir=/usr/lib/x86_64-linux-gnu/
59+
sudo make -j install
60+
3661
env:
3762
DEBIAN_FRONTEND: noninteractive
3863

3964
- name: Install CUDA
40-
uses: Jimver/cuda-toolkit@v0.2.5
65+
uses: Jimver/cuda-toolkit@v0.2.11
4166
with:
42-
cuda: '11.2.0'
67+
cuda: '12.2.0'
4368

4469
- name: Install stable toolchain
4570
uses: actions-rs/toolchain@v1
@@ -55,25 +80,41 @@ jobs:
5580
curl https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/License.txt -o LICENSE-cfitsio
5681
cp .github/workflows/releases-readme.md README.md
5782
58-
cargo build --profile production --locked --no-default-features --features=hdf5-static,cfitsio-static
59-
mv target/production/hyperdrive .
60-
tar -acvf mwa_hyperdrive-$(git describe --tags)-Linux-x86-64-v3.tar.gz \
61-
LICENSE COPYING-hdf5 LICENSE-erfa LICENSE-cfitsio README.md \
62-
hyperdrive
63-
64-
cargo build --profile production --locked --no-default-features --features=hdf5-static,cfitsio-static,cuda
65-
mv target/production/hyperdrive .
66-
tar -acvf mwa_hyperdrive-$(git describe --tags)-Linux-x86-64-v3-CUDA-double.tar.gz \
67-
LICENSE COPYING-hdf5 LICENSE-erfa LICENSE-cfitsio LICENSE-NVIDIA README.md \
68-
hyperdrive
69-
70-
cargo build --profile production --locked --no-default-features --features=hdf5-static,cfitsio-static,cuda,gpu-single
71-
mv target/production/hyperdrive .
72-
tar -acvf mwa_hyperdrive-$(git describe --tags)-Linux-x86-64-v3-CUDA-single.tar.gz \
73-
LICENSE COPYING-hdf5 LICENSE-erfa LICENSE-cfitsio LICENSE-NVIDIA README.md \
74-
hyperdrive
75-
env:
76-
RUSTFLAGS: "-C target-cpu=x86-64-v3"
83+
# Build with our recently-built static cfitsio
84+
export CFITSIO_STATIC=1
85+
# Don't build against the host CPU
86+
rm .cargo/config.toml
87+
# Don't make it look like the git tree is dirty because we aren't
88+
# building against the host CPU
89+
perl -0777 -pe 's/let dirty = .*\n.*\n.*\n.*/let dirty = "";/' src/cli/mod.rs
90+
91+
for ARCH in {2,3}; do
92+
echo "Building x86-64-v${ARCH}"
93+
export CFLAGS="-march=x86-64-v${ARCH}"
94+
export CXXFLAGS="-march=x86-64-v${ARCH}"
95+
export RUSTFLAGS="-C target-cpu=x86-64-v${ARCH}"
96+
97+
# Use --no-default-features to disable plotting; it's too hard to make this portable.
98+
cargo build --profile production --locked --no-default-features --features=hdf5-static
99+
mv target/production/hyperdrive .
100+
tar -acvf mwa_hyperdrive-$(git describe --tags)-Linux-x86-64-v${ARCH}.tar.gz \
101+
LICENSE COPYING-hdf5 LICENSE-erfa LICENSE-cfitsio README.md \
102+
hyperdrive
103+
104+
cargo build --profile production --locked --no-default-features --features=hdf5-static,cuda
105+
mv target/production/hyperdrive .
106+
tar -acvf mwa_hyperdrive-$(git describe --tags)-Linux-x86-64-v${ARCH}-CUDA-double.tar.gz \
107+
LICENSE COPYING-hdf5 LICENSE-erfa LICENSE-cfitsio LICENSE-NVIDIA README.md \
108+
hyperdrive
109+
110+
cargo build --profile production --locked --no-default-features --features=hdf5-static,cuda,gpu-single
111+
mv target/production/hyperdrive .
112+
tar -acvf mwa_hyperdrive-$(git describe --tags)-Linux-x86-64-v${ARCH}-CUDA-single.tar.gz \
113+
LICENSE COPYING-hdf5 LICENSE-erfa LICENSE-cfitsio LICENSE-NVIDIA README.md \
114+
hyperdrive
115+
116+
cargo clean
117+
done
77118
78119
- name: Upload tarball
79120
uses: actions/upload-artifact@v2

.github/workflows/run-tests.yml

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,21 @@ on:
1010
branches:
1111
- '**'
1212

13+
# The CI jobs can use a lot of disk space; we take tips from this site to run
14+
# the jobs faster and use less space.
15+
# https://matklad.github.io/2021/09/04/fast-rust-builds.html
1316
env:
1417
CARGO_TERM_COLOR: always
1518
CARGO_INCREMENTAL: 0
19+
RUSTFLAGS: "-C debuginfo=0 --deny warnings"
1620
MWA_BEAM_FILE: /mwa_full_embedded_element_pattern.h5
1721

1822
jobs:
1923
test:
2024
runs-on: ubuntu-latest
2125
steps:
2226
- name: Checkout sources
23-
uses: actions/checkout@v2
27+
uses: actions/checkout@v3
2428
with:
2529
fetch-depth: 0
2630

@@ -44,9 +48,9 @@ jobs:
4448
DEBIAN_FRONTEND: noninteractive
4549

4650
- name: Install CUDA
47-
uses: Jimver/cuda-toolkit@v0.2.5
51+
uses: Jimver/cuda-toolkit@v0.2.11
4852
with:
49-
cuda: '11.5.1'
53+
cuda: '12.2.0'
5054

5155
- name: Install stable toolchain
5256
uses: actions-rs/toolchain@v1
@@ -58,29 +62,32 @@ jobs:
5862
- name: Get the beam HDF5 file
5963
run: sudo curl http://ws.mwatelescope.org/static/mwa_full_embedded_element_pattern.h5 -o $MWA_BEAM_FILE
6064

61-
# Test that building works. Build statically first so less compiling is
62-
# needed when running tests.
63-
- name: Debug build with static features
65+
# Test that building works before running tests. Build statically first so
66+
# less compiling is needed when running tests.
67+
- name: Build with static features
6468
run: cargo test --locked --release --features=cuda,all-static --no-run
6569

66-
- name: Debug build
70+
# Can't test with CUDA, no GPUs available in CI
71+
- name: Build
6772
run: cargo test --locked --release --features=cuda --no-run
6873

69-
# Can't test with CUDA, no GPUs available in CI
7074
- name: Run tests
7175
run: cargo test --locked --release
7276

7377
- name: Run ignored tests
74-
run: cargo test --locked --release -- --ignored
78+
run: |
79+
# It seems that we use up a lot of space by this point.
80+
cargo clean
81+
cargo test --locked --release -- --ignored
7582
7683
- name: Minimum-specified Rust version works
7784
run: |
7885
MIN_RUST=$(grep -m1 "rust-version" Cargo.toml | sed 's|.*\"\(.*\)\"|\1|')
7986
~/.cargo/bin/rustup install $MIN_RUST --profile minimal
8087
cargo clean
81-
cargo +${MIN_RUST} test --locked
82-
cargo +${MIN_RUST} test --locked --features=all-static
83-
# Can't test with --all-features, cuda and hip aren't allowed together
84-
# hip is also difficult to install so ignore it
85-
cargo +${MIN_RUST} test --locked --features=all-static,cuda --no-run
86-
cargo +${MIN_RUST} test --locked --features=all-static,cuda,gpu-single --no-run
88+
cargo +${MIN_RUST} test --locked --release
89+
cargo +${MIN_RUST} test --locked --release --features=all-static
90+
# Can't test with --all-features because cuda and hip aren't allowed
91+
# together. hip is also difficult to install so ignore it.
92+
cargo +${MIN_RUST} test --locked --release --features=all-static,cuda --no-run
93+
cargo +${MIN_RUST} test --locked --release --features=all-static,cuda,gpu-single --no-run

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic
77
Versioning](https://semver.org/spec/v2.0.0.html).
88

9-
## [0.3.0] - Unreleased
9+
## [0.3.0] - 2023-09-27
1010
### Added
1111
- Support for HIP, which allows AMD GPUs to be used instead of only NVIDIA GPUs
1212
via CUDA.

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[package]
22
name = "mwa_hyperdrive"
3-
version = "0.2.1"
3+
version = "0.3.0"
44
authors = [
55
"Christopher H. Jordan <christopherjordan87@gmail.com>",
66
"Dev Null <dev.null@curtin.edu.au>",
77
]
88
edition = "2021"
9-
rust-version = "1.65"
9+
rust-version = "1.68"
1010
license = "MPL-2.0"
1111
readme = "README.md"
1212
description = "Calibration software for the Murchison Widefield Array (MWA) radio telescope"

0 commit comments

Comments
 (0)