File: build.sh

package info (click to toggle)
llvmlite 0.46.0-0.1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,140 kB
  • sloc: python: 13,605; cpp: 3,192; makefile: 185; sh: 168
file content (59 lines) | stat: -rwxr-xr-x 1,565 bytes parent folder | download
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
#!/bin/bash

set -ex

source activate $CONDA_ENV

# need to build with Anaconda compilers on osx, but they conflict with
# llvmdev... bootstrap
if [[ $(uname) == Darwin ]]; then
  # Set conda subdir and bootstrap with x86_64 compiler
  CONDA_SUBDIR=osx-64
  conda create -y -p ${PWD}/bootstrap clangxx_osx-64

  SRC_DIR=${PWD}
  export PATH=${SRC_DIR}/bootstrap/bin:${PATH}
  CONDA_PREFIX=${SRC_DIR}/bootstrap \
    . ${SRC_DIR}/bootstrap/etc/conda/activate.d/*

  # Use explicit SDK path if set, otherwise detect
  if [ -z "$SDKROOT" ]; then
    SDKPATH=$(xcrun --show-sdk-path)
  else
    SDKPATH=$SDKROOT
  fi
  export CONDA_BUILD_SYSROOT=${CONDA_BUILD_SYSROOT:-${SDKPATH}}

  # Set minimum deployment target if not already set
  if [ -z "$MACOSX_DEPLOYMENT_TARGET" ]; then
    export MACOSX_DEPLOYMENT_TARGET=11.0
  fi

  export CXXFLAGS=${CFLAGS}" -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}"
  export CFLAGS=${CFLAGS}" -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}"
  SYSROOT_DIR=${CONDA_BUILD_SYSROOT}
  CFLAG_SYSROOT="--sysroot ${SYSROOT_DIR}"
  export SDKROOT=${SDKPATH}

  DARWIN_TARGET=x86_64-apple-darwin13.4.0
fi

if [ -n "$MACOSX_DEPLOYMENT_TARGET" ]; then
    export MACOSX_DEPLOYMENT_TARGET
fi

# This is Numba channel specific: enables static linking of libstdc++
if [[ "$(uname)" != "Darwin" ]]; then
  export LLVMLITE_CXX_STATIC_LINK=1
fi

# Make sure any error below is reported as such
set -exv

if [ "$WHEEL" == "yes" ]; then
  conda install wheel
  python setup.py bdist_wheel
  pip install dist/*.whl
else
  python setup.py build
fi