aboutsummaryrefslogtreecommitdiff
path: root/configure.sh
blob: 96f34cdbd1aebae16aa2b1b78875dcca4d3d9cb3 (plain)
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#! /bin/bash

# Set up shell
if [ "$(echo ${VERBOSE} | tr '[:upper:]' '[:lower:]')" = 'yes' ]; then
    set -x                      # Output commands
fi
set -e                          # Abort on errors



################################################################################
# Examine settings
################################################################################



case $(echo "x$VECTORISE" | tr '[:upper:]' '[:lower:]') in
    (xyes) VECTORISE=1 ;;
    (xno)  VECTORISE=0 ;;
    (x)    VECTORISE=0 ;;        # default
    (*)    echo "BEGIN ERROR"
           echo "Illegal value of option VECTORISE"
           echo "END ERROR"
           exit 1;;
esac

# Disable vectorisation when optimisation is disabled. (The
# vectorisation macros depend on optimisation for efficient code;
# without optimisation, the code is most likely much slower than
# usual.)
case $(echo "x$OPTIMISE$OPTIMIZE" | tr '[:upper:]' '[:lower:]') in
    (x)    ;;                   # treat as 'yes'
    (xyes) ;;                   # do nothing
    (xno)  VECTORISE=0 ;;       # disable vectorisation
    (*)    echo "BEGIN ERROR"
           echo "Illegal value of option OPTIMISE or OPTIMIZE"
           echo "END ERROR"
           exit 1
esac

case $(echo "x$VECTORISE_ALIGNED_ARRAYS" | tr '[:upper:]' '[:lower:]') in
    (xyes) VECTORISE_ALIGNED_ARRAYS=1 ;;
    (xno)  VECTORISE_ALIGNED_ARRAYS=0 ;;
    (x)    VECTORISE_ALIGNED_ARRAYS=0 ;; # default
    (*)    echo "BEGIN ERROR"
           echo "Illegal value of option VECTORISE_ALIGNED_ARRAYS"
           echo "END ERROR"
           exit 1
esac

case $(echo "x$VECTORISE_ALWAYS_USE_UNALIGNED_LOADS" | tr '[:upper:]' '[:lower:]') in
    (xyes) VECTORISE_ALWAYS_USE_UNALIGNED_LOADS=1 ;;
    (xno)  VECTORISE_ALWAYS_USE_UNALIGNED_LOADS=0 ;;
    (x)    VECTORISE_ALWAYS_USE_UNALIGNED_LOADS=0 ;; # default
    (*)    echo "BEGIN ERROR"
           echo "Illegal value of option VECTORISE_ALWAYS_USE_UNALIGNED_LOADS"
           echo "END ERROR"
           exit 1
esac

case $(echo "x$VECTORISE_ALWAYS_USE_ALIGNED_LOADS" | tr '[:upper:]' '[:lower:]') in
    (xyes) VECTORISE_ALWAYS_USE_ALIGNED_LOADS=1 ;;
    (xno)  VECTORISE_ALWAYS_USE_ALIGNED_LOADS=0 ;;
    (x)    VECTORISE_ALWAYS_USE_ALIGNED_LOADS=0 ;; # default
    (*)    echo "BEGIN ERROR"
           echo "Illegal value of option VECTORISE_ALWAYS_USE_ALIGNED_LOADS"
           echo "END ERROR"
           exit 1
esac

case $(echo "x$VECTORISE_STREAMING_STORES" | tr '[:upper:]' '[:lower:]') in
    (xyes) VECTORISE_STREAMING_STORES=1 ;;
    (xno)  VECTORISE_STREAMING_STORES=0 ;;
    (x)    VECTORISE_STREAMING_STORES=0 ;; # default
    (*)    echo "BEGIN ERROR"
           echo "Illegal value of option VECTORISE_STREAMING_STORES"
           echo "END ERROR"
           exit 1
esac

case $(echo "x$VECTORISE_INLINE" | tr '[:upper:]' '[:lower:]') in
    (xyes) VECTORISE_INLINE=1 ;;
    (xno)  VECTORISE_INLINE=0 ;;
    (x)    VECTORISE_INLINE=0 ;; # default
    (*)    echo "BEGIN ERROR"
           echo "Illegal value of option VECTORISE_INLINE"
           echo "END ERROR"
           exit 1
esac



################################################################################
# Configure Cactus
################################################################################

# Pass options to Cactus
echo "BEGIN DEFINE"
echo "VECTORISE                            $VECTORISE"
echo "VECTORISE_ALIGNED_ARRAYS             $VECTORISE_ALIGNED_ARRAYS"
echo "VECTORISE_ALWAYS_USE_UNALIGNED_LOADS $VECTORISE_ALWAYS_USE_UNALIGNED_LOADS"
echo "VECTORISE_ALWAYS_USE_ALIGNED_LOADS   $VECTORISE_ALWAYS_USE_ALIGNED_LOADS"
echo "VECTORISE_INLINE                     $VECTORISE_INLINE"
echo "VECTORISE_STREAMING_STORES           $VECTORISE_STREAMING_STORES"
echo "END DEFINE"

echo "BEGIN MAKE_DEFINITION"
echo "VECTORISE                            = $VECTORISE"
echo "VECTORISE_ALIGNED_ARRAYS             = $VECTORISE_ALIGNED_ARRAYS"
echo "VECTORISE_ALWAYS_USE_UNALIGNED_LOADS = $VECTORISE_ALWAYS_USE_UNALIGNED_LOADS"
echo "VECTORISE_ALWAYS_USE_ALIGNED_LOADS   = $VECTORISE_ALWAYS_USE_ALIGNED_LOADS"
echo "VECTORISE_INLINE                     = $VECTORISE_INLINE"
echo "VECTORISE_STREAMING_STORES           = $VECTORISE_STREAMING_STORES"
echo "END MAKE_DEFINITION"