Skip to content

Commit 085665c

Browse files
authored
BLD: add libquadmath to licences and other tweaks (#24753)
Other improvements: - use SPDX short specifiers, fixes from review - only use `openblas_support.make_init()` in CI, fix paths - fix license concatenation for wheels we distribute Closes gh-24764
1 parent 7a23a54 commit 085665c

9 files changed

Lines changed: 193 additions & 94 deletions

File tree

‎.github/workflows/linux.yml‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ defaults:
1919
run:
2020
shell: bash
2121

22-
env:
23-
DOWNLOAD_OPENBLAS: 1
24-
2522
concurrency:
2623
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
2724
cancel-in-progress: true

‎.github/workflows/windows.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
# Getting the OpenBLAS DLL to the right place so it loads
7070
$installed_path = "$PWD\build-install\usr\Lib\site-packages"
7171
$numpy_path = "${installed_path}\numpy"
72-
$libs_path = "${numpy_path}\.libs"
72+
$libs_path = "${installed_path}\numpy.libs"
7373
mkdir ${libs_path}
7474
$ob_path = "C:/opt/64/bin/"
7575
cp $ob_path/*.dll $libs_path

‎azure-steps-windows.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ steps:
4949
displayName: 'Build NumPy'
5050

5151
- powershell: |
52-
# copy from c:/opt/openblas/openblas_dll to numpy/.libs to ensure it can
52+
# copy from c:/opt/openblas/openblas_dll to numpy/../numpy.libs to ensure it can
5353
# get loaded when numpy is imported (no RPATH on Windows)
5454
$target = $(python -c "import sysconfig; print(sysconfig.get_path('platlib'))")
55-
mkdir $target/numpy/.libs
56-
copy C:/opt/openblas/openblas_dll/*.dll $target/numpy/.libs
55+
mkdir $target/numpy.libs
56+
copy C:/opt/openblas/openblas_dll/*.dll $target/numpy.libs
5757
displayName: 'Copy OpenBLAS DLL to site-packages'
5858

5959
- script: |

‎tools/ci/cirrus_wheels.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ linux_aarch64_task:
4242
apt update
4343
apt install -y python3-venv python-is-python3 gfortran libatlas-base-dev libgfortran5 eatmydata
4444
git fetch origin
45-
./tools/travis-before-install.sh
45+
bash ./tools/wheels/cibw_before_build.sh ${PWD}
4646
which python
4747
echo $CIRRUS_CHANGE_MESSAGE
4848
<<: *BUILD_AND_STORE_WHEELS

‎tools/openblas_support.py‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ def get_members():
238238
def make_init(dirname):
239239
'''
240240
Create a _distributor_init.py file for OpenBlas
241+
242+
Obsoleted by the use of delvewheel in wheel building, which
243+
adds an equivalent snippet to numpy/__init__.py, but still useful in CI
241244
'''
242245
with open(os.path.join(dirname, '_distributor_init.py'), 'w') as fid:
243246
fid.write(textwrap.dedent("""
@@ -246,19 +249,20 @@ def make_init(dirname):
246249
Once a DLL is preloaded, its namespace is made available to any
247250
subsequent DLL. This file originated in the numpy-wheels repo,
248251
and is created as part of the scripts that build the wheel.
252+
249253
'''
250254
import os
251255
import glob
252256
if os.name == 'nt':
253-
# convention for storing / loading the DLL from
254-
# numpy/.libs/, if present
257+
# load any DLL from numpy/../numpy.libs/, if present
255258
try:
256259
from ctypes import WinDLL
257-
basedir = os.path.dirname(__file__)
258260
except:
259261
pass
260262
else:
261-
libs_dir = os.path.abspath(os.path.join(basedir, '.libs'))
263+
basedir = os.path.dirname(__file__)
264+
libs_dir = os.path.join(basedir, os.pardir, 'numpy.libs')
265+
libs_dir = os.path.abspath(libs_dir)
262266
DLL_filenames = []
263267
if os.path.isdir(libs_dir):
264268
for filename in glob.glob(os.path.join(libs_dir,

‎tools/wheels/LICENSE_linux.txt‎

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ This binary distribution of NumPy also bundles the following software:
55

66

77
Name: OpenBLAS
8-
Files: .libs/libopenb*.so
8+
Files: numpy.libs/libopenblas*.so
99
Description: bundled as a dynamically linked library
10-
Availability: https://github.com/xianyi/OpenBLAS/
11-
License: 3-clause BSD
10+
Availability: https://github.com/OpenMathLib/OpenBLAS/
11+
License: BSD-3-Clause-Attribution
1212
Copyright (c) 2011-2014, The OpenBLAS Project
1313
All rights reserved.
1414

@@ -41,10 +41,10 @@ License: 3-clause BSD
4141

4242

4343
Name: LAPACK
44-
Files: .libs/libopenb*.so
44+
Files: numpy.libs/libopenblas*.so
4545
Description: bundled in OpenBLAS
46-
Availability: https://github.com/xianyi/OpenBLAS/
47-
License 3-clause BSD
46+
Availability: https://github.com/OpenMathLib/OpenBLAS/
47+
License: BSD-3-Clause-Attribution
4848
Copyright (c) 1992-2013 The University of Tennessee and The University
4949
of Tennessee Research Foundation. All rights
5050
reserved.
@@ -96,10 +96,10 @@ License 3-clause BSD
9696

9797

9898
Name: GCC runtime library
99-
Files: .libs/libgfortran*.so
99+
Files: numpy.libs/libgfortran*.so
100100
Description: dynamically linked to files compiled with gcc
101-
Availability: https://gcc.gnu.org/viewcvs/gcc/
102-
License: GPLv3 + runtime exception
101+
Availability: https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=libgfortran
102+
License: GPL-3.0-with-GCC-exception
103103
Copyright (C) 2002-2017 Free Software Foundation, Inc.
104104

105105
Libgfortran is free software; you can redistribute it and/or modify
@@ -878,3 +878,25 @@ may consider it more useful to permit linking proprietary applications with
878878
the library. If this is what you want to do, use the GNU Lesser General
879879
Public License instead of this License. But first, please read
880880
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
881+
882+
Name: libquadmath
883+
Files: numpy.libs/libquadmath*.so
884+
Description: dynamically linked to files compiled with gcc
885+
Availability: https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=libquadmath
886+
License: LGPL-2.1-or-later
887+
888+
GCC Quad-Precision Math Library
889+
Copyright (C) 2010-2019 Free Software Foundation, Inc.
890+
Written by Francois-Xavier Coudert <[email protected]>
891+
892+
This file is part of the libquadmath library.
893+
Libquadmath is free software; you can redistribute it and/or
894+
modify it under the terms of the GNU Library General Public
895+
License as published by the Free Software Foundation; either
896+
version 2.1 of the License, or (at your option) any later version.
897+
898+
Libquadmath is distributed in the hope that it will be useful,
899+
but WITHOUT ANY WARRANTY; without even the implied warranty of
900+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
901+
Lesser General Public License for more details.
902+
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html

‎tools/wheels/LICENSE_osx.txt‎

Lines changed: 115 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,102 @@
33

44
This binary distribution of NumPy also bundles the following software:
55

6+
Name: OpenBLAS
7+
Files: numpy/.dylibs/libopenblas*.so
8+
Description: bundled as a dynamically linked library
9+
Availability: https://github.com/OpenMathLib/OpenBLAS/
10+
License: BSD-3-Clause-Attribution
11+
Copyright (c) 2011-2014, The OpenBLAS Project
12+
All rights reserved.
13+
14+
Redistribution and use in source and binary forms, with or without
15+
modification, are permitted provided that the following conditions are
16+
met:
17+
18+
1. Redistributions of source code must retain the above copyright
19+
notice, this list of conditions and the following disclaimer.
20+
21+
2. Redistributions in binary form must reproduce the above copyright
22+
notice, this list of conditions and the following disclaimer in
23+
the documentation and/or other materials provided with the
24+
distribution.
25+
3. Neither the name of the OpenBLAS project nor the names of
26+
its contributors may be used to endorse or promote products
27+
derived from this software without specific prior written
28+
permission.
29+
30+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
31+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
34+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
36+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
37+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
38+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
39+
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40+
41+
42+
Name: LAPACK
43+
Files: numpy/.dylibs/libopenblas*.so
44+
Description: bundled in OpenBLAS
45+
Availability: https://github.com/OpenMathLib/OpenBLAS/
46+
License: BSD-3-Clause-Attribution
47+
Copyright (c) 1992-2013 The University of Tennessee and The University
48+
of Tennessee Research Foundation. All rights
49+
reserved.
50+
Copyright (c) 2000-2013 The University of California Berkeley. All
51+
rights reserved.
52+
Copyright (c) 2006-2013 The University of Colorado Denver. All rights
53+
reserved.
54+
55+
$COPYRIGHT$
56+
57+
Additional copyrights may follow
58+
59+
$HEADER$
60+
61+
Redistribution and use in source and binary forms, with or without
62+
modification, are permitted provided that the following conditions are
63+
met:
64+
65+
- Redistributions of source code must retain the above copyright
66+
notice, this list of conditions and the following disclaimer.
67+
68+
- Redistributions in binary form must reproduce the above copyright
69+
notice, this list of conditions and the following disclaimer listed
70+
in this license in the documentation and/or other materials
71+
provided with the distribution.
72+
73+
- Neither the name of the copyright holders nor the names of its
74+
contributors may be used to endorse or promote products derived from
75+
this software without specific prior written permission.
76+
77+
The copyright holders provide no reassurances that the source code
78+
provided does not infringe any patent, copyright, or any other
79+
intellectual property rights of third parties. The copyright holders
80+
disclaim any liability to any recipient for claims brought against
81+
recipient by any third party for infringement of that parties
82+
intellectual property rights.
83+
84+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
85+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
86+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
87+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
88+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
89+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
90+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
91+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
92+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
93+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
94+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
95+
696

797
Name: GCC runtime library
8-
Files: .dylibs/*
98+
Files: numpy/.dylibs/libgfortran*, numpy/.dylibs/libgcc*
999
Description: dynamically linked to files compiled with gcc
10-
Availability: https://gcc.gnu.org/viewcvs/gcc/
11-
License: GPLv3 + runtime exception
100+
Availability: https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=libgfortran
101+
License: GPL-3.0-with-GCC-exception
12102
Copyright (C) 2002-2017 Free Software Foundation, Inc.
13103

14104
Libgfortran is free software; you can redistribute it and/or modify
@@ -787,3 +877,25 @@ may consider it more useful to permit linking proprietary applications with
787877
the library. If this is what you want to do, use the GNU Lesser General
788878
Public License instead of this License. But first, please read
789879
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
880+
881+
Name: libquadmath
882+
Files: numpy/.dylibs/libquadmath*.so
883+
Description: dynamically linked to files compiled with gcc
884+
Availability: https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=libquadmath
885+
License: LGPL-2.1-or-later
886+
887+
GCC Quad-Precision Math Library
888+
Copyright (C) 2010-2019 Free Software Foundation, Inc.
889+
Written by Francois-Xavier Coudert <[email protected]>
890+
891+
This file is part of the libquadmath library.
892+
Libquadmath is free software; you can redistribute it and/or
893+
modify it under the terms of the GNU Library General Public
894+
License as published by the Free Software Foundation; either
895+
version 2.1 of the License, or (at your option) any later version.
896+
897+
Libquadmath is distributed in the hope that it will be useful,
898+
but WITHOUT ANY WARRANTY; without even the implied warranty of
899+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
900+
Lesser General Public License for more details.
901+
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html

0 commit comments

Comments
 (0)