Skip to content

Commit 85d15ef

Browse files
authored
Merge pull request numpy#20206 from seiko2plus/ci_armv7_simd_test
CI: Add new workflow/action for testing universal intrinsics on armv7
2 parents 5914281 + f559951 commit 85d15ef

File tree

2 files changed

+48
-2
lines changed

2 files changed

+48
-2
lines changed

.github/workflows/build_test.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,3 +230,50 @@ jobs:
230230
python-version: ${{ env.PYTHON_VERSION }}
231231
- uses: ./.github/actions
232232

233+
armv7_simd_test:
234+
needs: [smoke_test]
235+
runs-on: ubuntu-latest
236+
steps:
237+
- uses: actions/checkout@v2
238+
with:
239+
submodules: recursive
240+
fetch-depth: 0
241+
- name: Initialize binfmt_misc for qemu-user-static
242+
run: |
243+
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
244+
- name: Creates new container
245+
run: |
246+
# use x86_64 cross-compiler to speed up the build
247+
sudo apt update
248+
sudo apt install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
249+
docker run --name the_container --interactive -v /:/host arm32v7/ubuntu:latest /bin/bash -c "
250+
apt update &&
251+
apt install -y git python3 python3-dev python3-pip &&
252+
pip3 install cython==0.29.24 setuptools\<49.2.0 hypothesis==6.23.3 pytest==6.2.5 &&
253+
ln -s /host/lib64 /lib64 &&
254+
ln -s /host/lib/x86_64-linux-gnu /lib/x86_64-linux-gnu &&
255+
ln -s /host/usr/arm-linux-gnueabihf /usr/arm-linux-gnueabihf &&
256+
rm -rf /usr/lib/gcc/arm-linux-gnueabihf && ln -s /host/usr/lib/gcc-cross/arm-linux-gnueabihf /usr/lib/gcc/arm-linux-gnueabihf &&
257+
rm -f /usr/bin/arm-linux-gnueabihf-gcc && ln -s /host/usr/bin/arm-linux-gnueabihf-gcc /usr/bin/arm-linux-gnueabihf-gcc &&
258+
rm -f /usr/bin/arm-linux-gnueabihf-g++ && ln -s /host/usr/bin/arm-linux-gnueabihf-g++ /usr/bin/arm-linux-gnueabihf-g++ &&
259+
rm -f /usr/bin/arm-linux-gnueabihf-ar && ln -s /host/usr/bin/arm-linux-gnueabihf-ar /usr/bin/arm-linux-gnueabihf-ar &&
260+
rm -f /usr/bin/arm-linux-gnueabihf-as && ln -s /host/usr/bin/arm-linux-gnueabihf-as /usr/bin/arm-linux-gnueabihf-as &&
261+
rm -f /usr/bin/arm-linux-gnueabihf-ld && ln -s /host/usr/bin/arm-linux-gnueabihf-ld /usr/bin/arm-linux-gnueabihf-ld &&
262+
rm -f /usr/bin/arm-linux-gnueabihf-ld.bfd && ln -s /host/usr/bin/arm-linux-gnueabihf-ld.bfd /usr/bin/arm-linux-gnueabihf-ld.bfd
263+
"
264+
docker commit the_container the_container
265+
- name: Build
266+
run: |
267+
sudo docker run --name the_build --interactive -v $(pwd):/numpy -v /:/host the_container /bin/bash -c "
268+
uname -a &&
269+
gcc --version &&
270+
g++ --version &&
271+
python3 --version &&
272+
cd /numpy && python3 setup.py install
273+
"
274+
docker commit the_build the_build
275+
- name: Run SIMD Tests
276+
run: |
277+
docker run --rm --interactive -v $(pwd):/numpy the_build /bin/bash -c "
278+
cd /numpy && python3 runtests.py -n -v -- -k test_simd
279+
"

numpy/core/include/numpy/npy_common.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,12 +359,11 @@ typedef unsigned char npy_bool;
359359

360360

361361
#if NPY_SIZEOF_LONGDOUBLE == NPY_SIZEOF_DOUBLE
362-
typedef double npy_longdouble;
363362
#define NPY_LONGDOUBLE_FMT "g"
364363
#else
365-
typedef long double npy_longdouble;
366364
#define NPY_LONGDOUBLE_FMT "Lg"
367365
#endif
366+
typedef long double npy_longdouble;
368367

369368
#ifndef Py_USING_UNICODE
370369
#error Must use Python with unicode enabled.

0 commit comments

Comments
 (0)