11#! /bin/bash
22
3-
4- # Most of the content in this file comes from https://github.com/multi-build/multibuild, with some modifications
5- # Follow the license below
6-
7- # .. _license:
8-
9- # *********************
10- # Copyright and License
11- # *********************
12-
13- # The multibuild package, including all examples, code snippets and attached
14- # documentation is covered by the 2-clause BSD license.
15-
16- # Copyright (c) 2013-2024, Matt Terry and Matthew Brett; all rights
17- # reserved.
18-
19- # Redistribution and use in source and binary forms, with or without
20- # modification, are permitted provided that the following conditions are
21- # met:
22-
23- # 1. Redistributions of source code must retain the above copyright notice,
24- # this list of conditions and the following disclaimer.
25-
26- # 2. Redistributions in binary form must reproduce the above copyright
27- # notice, this list of conditions and the following disclaimer in the
28- # documentation and/or other materials provided with the distribution.
29-
30- # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
31- # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
32- # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
33- # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
34- # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
35- # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
36- # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
37- # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
38- # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
39- # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
40- # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41-
423set -xe
434
445if [[ " $NIGHTLY " = " true" ]]; then
5314 export OPENBLAS_COMMIT=$( cat openblas_commit.txt)
5415 version=$( grep " ^version =" pyproject.toml | sed ' s/version = "//;s/"//' )
5516fi
17+
18+ # Sanity check, strip off the last (build) number from version, convert - to . in OPENBLAS_COMMIT
19+ if [[ " ${OPENBLAS_COMMIT// -/ .} " != * " ${version% .* } " * ]]; then
20+ echo " OPENBLAS_COMMIT $OPENBLAS_COMMIT does not match the pyproject.toml version $version "
21+ exit -1
22+ fi
23+
5624sed -e " s/^VERSION = .*/VERSION = ${version} /" -i.bak OpenBLAS/Makefile.rule
5725echo " creating wheel from $OPENBLAS_COMMIT (NIGHTLY is $NIGHTLY )"
5826
@@ -61,17 +29,6 @@ if [ "$(uname)" != "Darwin" ]; then
6129 export PATH=/opt/clang/bin:$PATH
6230fi
6331
64- # Work round bug in travis xcode image described at
65- # https://github.com/direnv/direnv/issues/210
66- shell_session_update () { : ; }
67-
68- # Workaround for https://github.com/travis-ci/travis-ci/issues/8703
69- # suggested by Thomas K at
70- # https://github.com/travis-ci/travis-ci/issues/8703#issuecomment-347881274
71- unset -f cd
72- unset -f pushd
73- unset -f popd
74-
7532# Build OpenBLAS
7633source build-openblas.sh
7734
0 commit comments