Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
numba
GitHub Repository: numba/llvmlite
Path: blob/main/buildscripts/incremental/build.sh
1154 views
1
#!/bin/bash
2
3
set -ex
4
5
source activate $CONDA_ENV
6
7
# need to build with Anaconda compilers on osx, but they conflict with
8
# llvmdev... bootstrap
9
if [[ $(uname) == Darwin ]]; then
10
# Set conda subdir and bootstrap with x86_64 compiler
11
CONDA_SUBDIR=osx-64
12
conda create -y -p ${PWD}/bootstrap clangxx_osx-64
13
14
SRC_DIR=${PWD}
15
export PATH=${SRC_DIR}/bootstrap/bin:${PATH}
16
CONDA_PREFIX=${SRC_DIR}/bootstrap \
17
. ${SRC_DIR}/bootstrap/etc/conda/activate.d/*
18
19
# Use explicit SDK path if set, otherwise detect
20
if [ -z "$SDKROOT" ]; then
21
SDKPATH=$(xcrun --show-sdk-path)
22
else
23
SDKPATH=$SDKROOT
24
fi
25
export CONDA_BUILD_SYSROOT=${CONDA_BUILD_SYSROOT:-${SDKPATH}}
26
27
# Set minimum deployment target if not already set
28
if [ -z "$MACOSX_DEPLOYMENT_TARGET" ]; then
29
export MACOSX_DEPLOYMENT_TARGET=11.0
30
fi
31
32
export CXXFLAGS=${CFLAGS}" -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}"
33
export CFLAGS=${CFLAGS}" -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}"
34
SYSROOT_DIR=${CONDA_BUILD_SYSROOT}
35
CFLAG_SYSROOT="--sysroot ${SYSROOT_DIR}"
36
export SDKROOT=${SDKPATH}
37
38
DARWIN_TARGET=x86_64-apple-darwin13.4.0
39
fi
40
41
if [ -n "$MACOSX_DEPLOYMENT_TARGET" ]; then
42
export MACOSX_DEPLOYMENT_TARGET
43
fi
44
45
# This is Numba channel specific: enables static linking of libstdc++
46
if [[ "$(uname)" != "Darwin" ]]; then
47
export LLVMLITE_CXX_STATIC_LINK=1
48
fi
49
50
# Make sure any error below is reported as such
51
set -exv
52
53
if [ "$WHEEL" == "yes" ]; then
54
conda install wheel
55
python setup.py bdist_wheel
56
pip install dist/*.whl
57
else
58
python setup.py build
59
fi
60
61