Skip to content

Commit 2d2d856

Browse files
authored
Merge pull request numpy#24785 from charris/backport-24753
BLD: add libquadmath to licences and other tweaks (numpy#24753)
2 parents 6410d12 + e6a9786 commit 2d2d856

File tree

9 files changed

+213
-181
lines changed

9 files changed

+213
-181
lines changed

.github/workflows/windows_meson.yml renamed to .github/workflows/windows.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
name: Test Meson build (Windows)
1+
name: Windows tests
22

33
on:
44
pull_request:
55
branches:
66
- main
77
- maintenance/**
88

9-
env:
10-
PYTHON_VERSION: 3.11
11-
129
concurrency:
1310
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1411
cancel-in-progress: true
@@ -17,10 +14,13 @@ permissions:
1714
contents: read # to fetch code (actions/checkout)
1815

1916
jobs:
20-
msvc_64bit_python_openblas:
21-
name: MSVC, x86-64, LP64 OpenBLAS
17+
python64bit_openblas:
18+
name: x86-64, LP64 OpenBLAS
2219
runs-on: windows-2019
2320
if: "github.repository == 'numpy/numpy'"
21+
strategy:
22+
matrix:
23+
compiler: ["MSVC", "Clang-cl"]
2424
steps:
2525
- name: Checkout
2626
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
@@ -31,7 +31,7 @@ jobs:
3131
- name: Setup Python
3232
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
3333
with:
34-
python-version: ${{ env.PYTHON_VERSION }}
34+
python-version: '3.11'
3535

3636
- name: Install build dependencies from PyPI
3737
run: |
@@ -48,16 +48,28 @@ jobs:
4848
unzip -d c:\opt openblas-v0.3.21-win_amd64-gcc_10_3_0.zip
4949
echo "PKG_CONFIG_PATH=c:\opt\64\lib\pkgconfig;" >> $env:GITHUB_ENV
5050
51-
- name: Install NumPy
51+
- name: Install Clang-cl
52+
if: matrix.compiler == 'Clang-cl'
53+
run: |
54+
choco install llvm -y --version=16.0.6
55+
56+
- name: Install NumPy (MSVC)
57+
if: matrix.compiler == 'MSVC'
5258
run: |
5359
spin build -j2 -- --vsenv
5460
61+
- name: Install NumPy (Clang-cl)
62+
if: matrix.compiler == 'Clang-cl'
63+
run: |
64+
"[binaries]","c = 'clang-cl'","cpp = 'clang-cl'","ar = 'llvm-lib'","c_ld = 'lld-link'","cpp_ld = 'lld-link'" | Out-File $PWD/clang-cl-build.ini -Encoding ascii
65+
spin build -j2 -- --vsenv --native-file=$PWD/clang-cl-build.ini
66+
5567
- name: Copy OpenBLAS DLL, write _distributor_init.py
5668
run: |
5769
# Getting the OpenBLAS DLL to the right place so it loads
5870
$installed_path = "$PWD\build-install\usr\Lib\site-packages"
5971
$numpy_path = "${installed_path}\numpy"
60-
$libs_path = "${numpy_path}\.libs"
72+
$libs_path = "${installed_path}\numpy.libs"
6173
mkdir ${libs_path}
6274
$ob_path = "C:/opt/64/bin/"
6375
cp $ob_path/*.dll $libs_path

.github/workflows/windows_clangcl.yml

Lines changed: 0 additions & 82 deletions
This file was deleted.

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
@@ -41,7 +41,7 @@ linux_aarch64_task:
4141
apt update
4242
apt install -y python3-venv python-is-python3 gfortran libatlas-base-dev libgfortran5 eatmydata
4343
git fetch origin
44-
./tools/travis-before-install.sh
44+
bash ./tools/wheels/cibw_before_build.sh ${PWD}
4545
which python
4646
echo $CIRRUS_CHANGE_MESSAGE
4747
<<: *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 <fxcoudert@gcc.gnu.org>
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

0 commit comments

Comments
 (0)