"platforms/reference/src/sfmt/SFMT-sse2.h" did not exist on "85da5e0f9018719e95350c76b483a2160c84d9d3"
configure_build.sh 2.26 KB
Newer Older
1
# Find, load common utilities
Andrew Murray's avatar
Andrew Murray committed
2
# Defines IS_MACOS, fetch_unpack
3
4
5
MULTIBUILD_DIR=$(dirname "${BASH_SOURCE[0]}")
source $MULTIBUILD_DIR/common_utils.sh

6
7
8
9
10
11
# Only source configure_build once
if [ -n "$CONFIGURE_BUILD_SOURCED" ]; then
    return
fi
CONFIGURE_BUILD_SOURCED=1

12
BUILD_PREFIX="${BUILD_PREFIX:-/usr/local}"
mattip's avatar
mattip committed
13
MB_ML_VER=${MB_ML_VER:-1}
14

Andrew Murray's avatar
Andrew Murray committed
15
16
# IS_MACOS is defined in common_utils.sh
if [ -n "$IS_MACOS" ]; then
17
    # Default compilation flags for OSX
18
    source $MULTIBUILD_DIR/osx_utils.sh
19
    PLAT=${PLAT:-$(macpython_arch_for_version $MB_PYTHON_VERSION)}
20
    if [[ $PLAT == intel ]]; then
21
        ARCH_FLAGS=${ARCH_FLAGS:-"-arch i386 -arch x86_64"}
22
    elif [[ $PLAT == x86_64 ]]; then
23
        ARCH_FLAGS=${ARCH_FLAGS:-"-arch x86_64"}
Isuru Fernando's avatar
Isuru Fernando committed
24
25
26
27
    elif [[ $PLAT == arm64 ]]; then
        ARCH_FLAGS=${ARCH_FLAGS:-"-arch arm64"}
    elif [[ $PLAT == universal2 ]]; then
        # Do nothing as we are going with fusing wheels
28
    else
Isuru Fernando's avatar
Isuru Fernando committed
29
        echo "invalid platform = '$PLAT', supported values are 'intel' or 'x86_64' or 'arm64' or 'universal2'"
30
31
        exit 1
    fi
32
33
34
35
36
    # Only set CFLAGS, FFLAGS if they are not already defined.  Build functions
    # can override the arch flags by setting CFLAGS, FFLAGS
    export CFLAGS="${CFLAGS:-$ARCH_FLAGS}"
    export CXXFLAGS="${CXXFLAGS:-$ARCH_FLAGS}"
    export FFLAGS="${FFLAGS:-$ARCH_FLAGS}"
37
38
39

    # Disable homebrew auto-update
    export HOMEBREW_NO_AUTO_UPDATE=1
Uwe L. Korn's avatar
Uwe L. Korn committed
40
else
41
42
    # default compilation flags for linux
    PLAT="${PLAT:-x86_64}"
Uwe L. Korn's avatar
Uwe L. Korn committed
43
44
45
46
47
48
    # Strip all binaries after compilation.
    STRIP_FLAGS=${STRIP_FLAGS:-"-Wl,-strip-all"}

    export CFLAGS="${CFLAGS:-$STRIP_FLAGS}"
    export CXXFLAGS="${CXXFLAGS:-$STRIP_FLAGS}"
    export FFLAGS="${FFLAGS:-$STRIP_FLAGS}"
mattip's avatar
mattip committed
49
50
51
52
53
54
55
56
57
    if [[ $MB_ML_VER == "1" ]]; then
        if [ "${MB_PYTHON_VERSION:0:4}" == "pypy" ]; then
            yum install -y libtool wget
        else
            yum install -y libtool
        fi
    elif [ "${MB_PYTHON_VERSION:0:4}" == "pypy" ]; then
        yum install -y wget
    fi
58
59
60
fi

# Promote BUILD_PREFIX on search path to any newly built libs
Matthew Brett's avatar
Matthew Brett committed
61
export CPPFLAGS="-I$BUILD_PREFIX/include $CPPFLAGS"
62
export LIBRARY_PATH="$BUILD_PREFIX/lib:$LIBRARY_PATH"
63
export PKG_CONFIG_PATH="$BUILD_PREFIX/lib/pkgconfig/:$PKG_CONFIG_PATH"
64
65
# Add binary path for configure utils etc
export PATH="$BUILD_PREFIX/bin:$PATH"