gfortran.sh 1.51 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

set -e

readonly version="9.2"
readonly patch="0"
# From https://downloads.sourceforge.net/project/hpc/hpc/g95/gfortran-$version-bin.tar.gz
readonly tarball="gfortran-$version-bin.tar.gz"
readonly sha256sum="89f549739d4713a21781c7e478c3627ab9ad4133629ffab1e1de65c0cbc3329b"

cd .gitlab

echo "$sha256sum  $tarball" > gfortran.sha256sum
curl -OL "https://www.paraview.org/files/dependencies/$tarball"
shasum -a 256 --check gfortran.sha256sum
mkdir -p gfortran
# The tarball is hard-coded to live in `usr/local`. We need to make it
# minimally relocatable.
tar --strip-components 2 -C gfortran -xzf "$tarball"

# Fixup the references so that the toolchain is usable from the CI directory.
install_name_tool -change /usr/local/lib/libmpc.3.dylib @loader_path/../../../../lib/libmpc.3.dylib "gfortran/libexec/gcc/x86_64-apple-darwin19/$version.$patch/f951"
install_name_tool -change /usr/local/lib/libmpfr.4.dylib @loader_path/../../../../lib/libmpfr.4.dylib "gfortran/libexec/gcc/x86_64-apple-darwin19/$version.$patch/f951"
install_name_tool -change /usr/local/lib/libgmp.10.dylib @loader_path/../../../../lib/libgmp.10.dylib "gfortran/libexec/gcc/x86_64-apple-darwin19/$version.$patch/f951"
install_name_tool -change /usr/local/lib/libmpfr.4.dylib @loader_path/libmpfr.4.dylib gfortran/lib/libmpc.3.dylib
install_name_tool -change /usr/local/lib/libgmp.10.dylib @loader_path/libgmp.10.dylib gfortran/lib/libmpc.3.dylib
install_name_tool -change /usr/local/lib/libgmp.10.dylib @loader_path/libgmp.10.dylib gfortran/lib/libmpfr.4.dylib