-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtest_gf_utils.sh
77 lines (72 loc) · 3.24 KB
/
test_gf_utils.sh
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Get gfortran utils
source gfortran_utils.sh
set -e
uname=$(uname)
FNAME_ROOT="openblas-v0.3.0"
export MACOSX_DEPLOYMENT_TARGET=10.6
ARCH_ROOT="archives/$FNAME_ROOT"
if [ $uname == Darwin ]; then
# install_gfortran
# [ -n "$GFORTRAN_DMG" ] || (echo "GFORTRAN_DMG not set"; exit 1)
# [ -n "$GFORTRAN_SHA" ] || (echo "GFORTRAN_SHA not set"; exit 1)
GFORTRAN_SHA=1becaaa76fe86f86df35f89ca30446c14a072d41
target=$(echo $MACOSX_DEPLOYMENT_TARGET | tr .- _)
PLAT_ROOT="macosx_$target"
I686_PLAT="i386"
SUF="gf_${GFORTRAN_SHA:0:7}"
elif [ $uname == Linux ]; then
[ -z "$GFORTRAN_DMG" ] || (echo "GFORTRAN_DMG is set"; exit 1)
[ -z "$GFORTRAN_SHA" ] || (echo "GFORTRAN_SHA is set"; exit 1)
# Check check, if gfortran installed
gfortran --help > /dev/null && check_gfortran
PLAT_ROOT="manylinux1"
I686_PLAT="i686"
SUF=""
fi
if [ -n "$SUF" ]; then SUFP="-$SUF"; else SUFP=""; fi
exp_64_tgz="${ARCH_ROOT}-${PLAT_ROOT}_x86_64${SUFP}.tar.gz"
[ "$(get_gf_lib_for_suf "${SUF}" "${FNAME_ROOT}" "x86_64")" == "$exp_64_tgz" ] || \
(echo Wrong tgz output; exit 1)
[ -f "$exp_64_tgz" ] || (echo Failed archive fetch; exit 1)
# Refetch does not raise error
[ "$(get_gf_lib_for_suf "${SUF}" "${FNAME_ROOT}" "x86_64")" == "$exp_64_tgz" ] || \
(echo Wrong tgz output; exit 1)
# Check another archive
exp_32_tgz="${ARCH_ROOT}-${PLAT_ROOT}_${I686_PLAT}${SUFP}.tar.gz"
[ "$(get_gf_lib_for_suf "${SUF}" "${FNAME_ROOT}" "i686")" == "$exp_32_tgz" ] || \
(echo Wrong tgz output; exit 1)
[ -f "$exp_32_tgz" ] || (echo Failed archive fetch; exit 1)
# Refetch does not raise error
[ "$(get_gf_lib_for_suf "${SUF}" "${FNAME_ROOT}" "i686")" == "$exp_32_tgz" ] || \
(echo Wrong tgz output; exit 1)
# Check intel (fused)
if [ $uname == Darwin ]; then
exp_fused_tgz="${ARCH_ROOT}-${PLAT_ROOT}_intel${SUFP}.tar.gz"
[ "$(get_gf_lib_for_suf "${SUF}" "${FNAME_ROOT}" "intel")" == "$exp_fused_tgz" ] || \
(echo Wrong tgz output; exit 1)
[ -f "$exp_fused_tgz" ] || (echo Failed archive fetch; exit 1)
fi
# Same thing, setting the hash manually, for OSX
GFORTRAN_SHA="1becaaa76fe86f86df35f89ca30446c14a072d41"
rm $exp_64_tgz $exp_32_tgz
[ "$(get_gf_lib "${FNAME_ROOT}" "x86_64")" == "$exp_64_tgz" ] || \
(echo Wrong tgz output; exit 1)
[ -f "$exp_64_tgz" ] || (echo Failed archive fetch; exit 1)
[ "$(get_gf_lib "${FNAME_ROOT}" "i686")" == "$exp_32_tgz" ] || \
(echo Wrong tgz output; exit 1)
[ -f "$exp_32_tgz" ] || (echo Failed archive fetch; exit 1)
# Test get_distutils_platform_ex processing of MB_ML_VER
if [ $uname != Darwin ]; then
export MB_ML_VER=2010
ml_plat_root="manylinux2010"
ml_exp_64_tgz="${ARCH_ROOT}-${ml_plat_root}_x86_64${SUFP}.tar.gz"
val=$(get_gf_lib "${FNAME_ROOT}" "x86_64")
[ "${val}" == "$ml_exp_64_tgz" ] || \
(echo Wrong tgz output ${val}, ${ml_exp_64_tgz}; exit 1)
fi
# Test get_distutils_platform since it is no longer used internally
[ "$(get_distutils_platform "x86_64" "x86_64")" == "manylinux1_x86_64" ] || \
(echo Wrong get_distutils_platform output for x86_64; exit 1)
darwin_target=$(echo $MACOSX_DEPLOYMENT_TARGET | tr .- _)
[ "$(get_distutils_platform "x86_64" "Darwin")" == "macosx_${darwin_target}_x86_64" ] || \
(echo Wrong get_distutils_platform output for Darwin; exit 1)