1414jobs :
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
0 commit comments