Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI setup #3

Merged
merged 105 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
f2ea261
Create python-safpy.yml
chris-hld Aug 7, 2023
f13ec9c
Update python-safpy.yml
chris-hld Aug 7, 2023
37b431a
Update python-safpy.yml
chris-hld Aug 7, 2023
e0fd687
Add SAF submodule
chris-hld Aug 7, 2023
e4b6da7
Adapt build path to reflect submodule
chris-hld Aug 7, 2023
4557f9b
Update python-safpy.yml
chris-hld Aug 7, 2023
c39a566
Update python-safpy.yml
chris-hld Aug 7, 2023
d3bcca2
Update python-safpy.yml
chris-hld Aug 7, 2023
84f1c2c
Update python-safpy.yml
chris-hld Aug 7, 2023
e813cf5
Update python-safpy.yml
chris-hld Aug 7, 2023
1375b78
Update python-safpy.yml
chris-hld Aug 7, 2023
2b45650
Update python-safpy.yml
chris-hld Aug 7, 2023
7a3e6c8
Update python-safpy.yml
chris-hld Aug 7, 2023
2e9e1e5
Change branch in SAF
chris-hld Aug 7, 2023
29bba96
Merge branch 'CI-setup' of https://github.com/chris-hld/SAFpy into CI…
chris-hld Aug 7, 2023
acc1c16
Add develop branch to SAF
chris-hld Aug 7, 2023
e818cc8
Update python-safpy.yml
chris-hld Aug 7, 2023
7954081
Update python-safpy.yml
chris-hld Aug 7, 2023
26b4ceb
Update python-safpy.yml
chris-hld Aug 7, 2023
2085020
Update python-safpy.yml
chris-hld Aug 7, 2023
8677869
Update python-safpy.yml
chris-hld Aug 7, 2023
6d5e2d9
Update python-safpy.yml
chris-hld Aug 7, 2023
e945d39
Link saf_performance lib explicitly
chris-hld Aug 8, 2023
80cdba5
Split into two jobs
chris-hld Aug 8, 2023
6f9a9d4
Update python-safpy.yml
chris-hld Aug 8, 2023
773f096
Revert needs same job
chris-hld Aug 8, 2023
1a91a50
Merge branch 'master' into CI-setup
chris-hld Jan 29, 2024
8c6131c
CI: run python version matrix
chris-hld Jan 29, 2024
c677f55
CI: Use Python versions
chris-hld Jan 29, 2024
565b0a8
CI: Introduce macOS
chris-hld Jan 29, 2024
c38086a
Update python-safpy.yml
chris-hld Jan 29, 2024
087fdf7
Update python-safpy.yml
chris-hld Jan 29, 2024
9ce25d7
Update python-safpy.yml
chris-hld Jan 29, 2024
379df6e
Update python-safpy.yml
chris-hld Jan 29, 2024
0ae91b2
Update python-safpy.yml
chris-hld Jan 29, 2024
068bbeb
Update python-safpy.yml
chris-hld Jan 29, 2024
54291f5
Update python-safpy.yml
chris-hld Jan 29, 2024
012cb37
Update python-safpy.yml
chris-hld Jan 29, 2024
b56cfab
Update python-safpy.yml
chris-hld Jan 29, 2024
8ccb6b0
Update python-safpy.yml
chris-hld Jan 29, 2024
e812ef6
Update python-safpy.yml
chris-hld Jan 29, 2024
7b56bb1
Update python-safpy.yml
chris-hld Jan 29, 2024
df6dbbd
Update python-safpy.yml
chris-hld Jan 29, 2024
07e4ea2
Update python-safpy.yml
chris-hld Jan 29, 2024
45ab05e
Update python-safpy.yml
chris-hld Jan 29, 2024
c8b9015
Update python-safpy.yml
chris-hld Jan 29, 2024
54c3442
Update python-safpy.yml
chris-hld Jan 29, 2024
6dda6e5
Update python-safpy.yml
chris-hld Jan 29, 2024
8aaa0d0
Update python-safpy.yml
chris-hld Jan 29, 2024
93f4c85
Update python-safpy.yml
chris-hld Jan 29, 2024
a65a4db
Update python-safpy.yml
chris-hld Jan 29, 2024
e130808
Update python-safpy.yml
chris-hld Jan 30, 2024
bf91011
Update python-safpy.yml
chris-hld Jan 30, 2024
8b168b4
Update python-safpy.yml
chris-hld Jan 30, 2024
8f48d9b
Update python-safpy.yml
chris-hld Jan 30, 2024
ae31b62
Update python-safpy.yml
chris-hld Jan 30, 2024
4e77acd
Update Spatial_Audio_Framework
chris-hld Jan 30, 2024
6269d01
Update python-safpy.yml
chris-hld Jan 30, 2024
36602bb
Update python-safpy.yml
chris-hld Jan 30, 2024
60fcc29
Update python-safpy.yml
chris-hld Jan 30, 2024
ce7b663
Update Spatial_Audio_Framework
chris-hld Jan 30, 2024
a013ab5
Update python-safpy.yml
chris-hld Jan 30, 2024
4b01ff7
Update python-safpy.yml
chris-hld Jan 30, 2024
ac1600b
Update python-safpy.yml
chris-hld Jan 30, 2024
2d04445
Update python-safpy.yml
chris-hld Jan 30, 2024
ee76d6c
Update python-safpy.yml
chris-hld Jan 30, 2024
18e9f5d
Update python-safpy.yml
chris-hld Jan 30, 2024
cff810a
Update python-safpy.yml
chris-hld Jan 30, 2024
dd610cc
Update python-safpy.yml
chris-hld Jan 30, 2024
a0994f3
Update python-safpy.yml
chris-hld Jan 30, 2024
2682c7e
Update python-safpy.yml
chris-hld Jan 30, 2024
f098d27
Update python-safpy.yml
chris-hld Jan 30, 2024
b5e598c
Introduce MSVC complex type to safpy_build.py
chris-hld Jan 30, 2024
d5b0844
Move complex typedef in safpy_build.py
chris-hld Jan 30, 2024
b0d91dc
Use _Complex in safpy_build.py
chris-hld Jan 30, 2024
42ed8c1
Revert "Use _Complex in safpy_build.py"
chris-hld Jan 30, 2024
fa6bd9a
Revert "Move complex typedef in safpy_build.py"
chris-hld Jan 30, 2024
9a4c3bf
Revert "Introduce MSVC complex type to safpy_build.py"
chris-hld Jan 30, 2024
9d94942
Use Ninja on Windows
chris-hld Jan 30, 2024
8b3a5a2
Same test run for all
chris-hld Jan 30, 2024
5493de3
Update python-safpy.yml
chris-hld Jan 30, 2024
84d9722
Update python-safpy.yml
chris-hld Jan 30, 2024
92224d9
Update python-safpy.yml
chris-hld Jan 30, 2024
87f8313
Update safpy_build.py
chris-hld Jan 30, 2024
ec114c6
Update python-safpy.yml
chris-hld Jan 30, 2024
93f0e36
Link only openBLAS
chris-hld Jan 30, 2024
d91f656
Update safpy_build.py
chris-hld Jan 30, 2024
ffff16a
Safpy_build: switch typedef complex on win32
chris-hld Feb 6, 2024
47d1158
CI: use msvc again
chris-hld Feb 6, 2024
0a9e57c
Update python-safpy.yml
chris-hld Feb 6, 2024
9ec0509
Update safpy_build.py
chris-hld Feb 6, 2024
6932d60
Trying to use the native _Complex
chris-hld Feb 6, 2024
160f9b5
Update safpy_build.py
chris-hld Feb 6, 2024
93397b1
Revert "Trying to use the native _Complex"
chris-hld Feb 6, 2024
807993a
Trying typedef struct float_complex
chris-hld Feb 6, 2024
f76bb56
Update safpy_build.py
chris-hld Feb 6, 2024
b0e608c
Update safpy_build.py
chris-hld Feb 6, 2024
82ee0a0
Update safpy_build.py
chris-hld Feb 6, 2024
604b926
Copy openblas on windows to safpy folder
chris-hld Feb 6, 2024
211d4d0
Update python-safpy.yml
chris-hld Feb 6, 2024
6d6c3bb
Update python-safpy.yml
chris-hld Feb 6, 2024
4a1e156
More defaults for win and openblas
chris-hld Feb 6, 2024
18d3faa
Update python-safpy.yml
chris-hld Feb 6, 2024
c540ee9
Update Spatial_Audio_Framework
chris-hld Feb 6, 2024
2af574b
Cleanup
chris-hld Feb 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 61 additions & 18 deletions .github/workflows/python-safpy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,42 +14,82 @@ permissions:

jobs:
build-and-test:
runs-on: ubuntu-latest

name: Test on ${{ matrix.os }} with Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
python-version: ["3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
python-version: ${{ matrix.python-version }}
- name: Install Python package dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install cffi numpy spaudiopy
- name: Checkout submodules
run: git submodule update --init --recursive

- name: Dependency packages
run: |
sudo apt-get update && sudo apt-get install libsndfile1 liblapack3 liblapack-dev libopenblas-base libopenblas-dev liblapacke-dev
sudo ldconfig
run: git submodule update --init --recursive --depth=1

- name: Install system dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get update && sudo apt-get install libsndfile1 liblapack3 liblapack-dev libopenblas-base libopenblas-dev liblapacke-dev
sudo ldconfig
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install openblas
elif [ "$RUNNER_OS" == "Windows" ]; then
curl https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.26/OpenBLAS-0.3.26-x64.zip -L -o tmp.zip
7z x ./tmp.zip -oOpenBLAS
cp ./OpenBLAS/lib/libopenblas.lib $GITHUB_WORKSPACE
cp ./OpenBLAS/bin/libopenblas.dll $GITHUB_WORKSPACE
echo "$GITHUB_WORKSPACE" >> $GITHUB_PATH
else
echo "$RUNNER_OS not supported"
exit 1
fi
shell: bash

- name: Configure CMake (Linux)
- name: Configure CMake
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: |
cmake -E make_directory ./Spatial_Audio_Framework/build
cmake -S ./Spatial_Audio_Framework/ -B ./Spatial_Audio_Framework/build -DSAF_PERFORMANCE_LIB=SAF_USE_OPEN_BLAS_AND_LAPACKE -DSAF_BUILD_EXAMPLES=0
if [ "$RUNNER_OS" == "Linux" ]; then
cmake -S ./Spatial_Audio_Framework/ -B ./Spatial_Audio_Framework/build -DSAF_PERFORMANCE_LIB=SAF_USE_OPEN_BLAS_AND_LAPACKE -DSAF_BUILD_EXAMPLES=0
elif [ "$RUNNER_OS" == "macOS" ]; then
cmake -S ./Spatial_Audio_Framework/ -B ./Spatial_Audio_Framework/build -DSAF_PERFORMANCE_LIB=SAF_USE_APPLE_ACCELERATE -DSAF_BUILD_EXAMPLES=0
elif [ "$RUNNER_OS" == "Windows" ]; then
cmake -S ./Spatial_Audio_Framework/ -B ./Spatial_Audio_Framework/build -DSAF_PERFORMANCE_LIB=SAF_USE_OPEN_BLAS_AND_LAPACKE -DOPENBLAS_LIBRARY=$GITHUB_WORKSPACE/OpenBLAS/lib/libopenblas.lib -DLAPACKE_LIBRARY=$GITHUB_WORKSPACE/OpenBLAS/lib/libopenblas.lib -DOPENBLAS_HEADER_PATH=$GITHUB_WORKSPACE/OpenBLAS/include/ -DSAF_BUILD_EXAMPLES=0
fi
shell: bash

- name: Build SAF
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build ./Spatial_Audio_Framework/build
run: cmake --build ./Spatial_Audio_Framework/build -j2

- name: Print shared object dependencies
if: ${{ contains( runner.os, 'Linux' ) }}
run: ldd ./Spatial_Audio_Framework/build/test/saf_test

- name: Test SAF
run: |
ldd ./Spatial_Audio_Framework/build/test/saf_test
./Spatial_Audio_Framework/build/test/saf_test
if [ "$RUNNER_OS" != "Windows" ]; then
./Spatial_Audio_Framework/build/test/saf_test
else
cp ./Spatial_Audio_Framework/build/test/Debug/saf_test.exe ./Spatial_Audio_Framework/build/test/
cp ./Spatial_Audio_Framework/build/framework/Debug/saf.lib ./Spatial_Audio_Framework/build/framework/

./Spatial_Audio_Framework/build/test/saf_test.exe
fi
shell: bash

- name: Lint with flake8
run: |
Expand All @@ -58,8 +98,11 @@ jobs:
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: Build package
run: python setup.py build

- name: Build and install package
run: python -m pip install -e .

- name: Test with pytest
run: |
pytest -vvv
run: pytest -vvv
2 changes: 1 addition & 1 deletion Spatial_Audio_Framework
Submodule Spatial_Audio_Framework updated 44 files
+15 −6 .github/workflows/cmake.yml
+6 −1 ChangeLog.txt
+5 −3 README.md
+5 −1 docs/FRAMEWORK_STRUCTURE.md
+0 −9 examples/CMakeLists.txt
+7 −5 examples/include/_common.h
+1 −1 examples/include/array2sh.h
+3 −0 examples/src/ambi_bin/ambi_bin.c
+1 −1 examples/src/ambi_dec/ambi_dec_internal.c
+9 −0 examples/src/ambi_drc/ambi_drc_internal.c
+1 −1 examples/src/ambi_enc/ambi_enc_internal.c
+15 −1 examples/src/array2sh/array2sh.c
+29 −35 examples/src/array2sh/array2sh_internal.c
+8 −1 examples/src/array2sh/array2sh_internal.h
+3 −3 examples/src/beamformer/beamformer.c
+3 −0 examples/src/binauraliser/binauraliser.c
+1 −1 examples/src/binauraliser/binauraliser_internal.c
+1 −1 examples/src/binauraliser_nf/binauraliser_nf.c
+7 −5 examples/src/matrixconv/matrixconv.c
+2 −2 examples/src/matrixconv/matrixconv_internal.h
+10 −6 examples/src/multiconv/multiconv.c
+3 −3 examples/src/multiconv/multiconv_internal.h
+2 −2 examples/src/panner/panner_internal.c
+7 −3 examples/src/pitch_shifter/pitch_shifter.c
+2 −2 examples/src/pitch_shifter/pitch_shifter_internal.h
+26 −17 examples/src/sldoa/sldoa.c
+0 −2,642 examples/src/sldoa/sldoa_database.c
+0 −18 examples/src/sldoa/sldoa_database.h
+19 −16 examples/src/sldoa/sldoa_internal.c
+8 −8 examples/src/sldoa/sldoa_internal.h
+51 −36 examples/src/spreader/spreader.c
+5 −0 examples/src/spreader/spreader_internal.h
+9 −6 examples/src/tvconv/tvconv.c
+2 −2 examples/src/tvconv/tvconv_internal.h
+3 −0 framework/CMakeLists.txt
+1 −1 framework/include/saf.h
+3 −3 framework/modules/saf_hoa/saf_hoa.c
+46 −69 framework/modules/saf_hoa/saf_hoa_internal.c
+51 −60 framework/modules/saf_sh/saf_sh.c
+130 −0 framework/modules/saf_utilities/saf_utility_loudspeaker_presets.c
+5 −2 framework/modules/saf_utilities/saf_utility_loudspeaker_presets.h
+6 −6 framework/modules/saf_utilities/saf_utility_misc.c
+130 −0 framework/modules/saf_utilities/saf_utility_sensorarray_presets.c
+3 −0 framework/modules/saf_utilities/saf_utility_sensorarray_presets.h
35 changes: 30 additions & 5 deletions safpy_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,52 @@

# Sensible default, please adjust if needed.
# In case of doubt, you can also check numpy.show_config() for its BLAS
print("Detected platform: " + sys.platform)
if sys.platform == "darwin":
print("SAFPY using default Apple Accelerate")
extra_link_args.extend(['-Wl,-framework', '-Wl,Accelerate'])
else:
elif sys.platform == "linux":
print("SAFPY using default OpenBLAS/LAPACKE")
saf_performance_lib.extend(["openblas", "lapacke"])

elif sys.platform == "win32":
print("SAFPY using default OpenBLAS/LAPACKE")
saf_performance_lib.extend(["libopenblas"]) # should include lapacke
else:
print("No defaults.")

# cdef() expects a single string declaring the C types, functions and
# globals needed to use the shared object. It must be in valid C syntax.
ffibuilder.cdef("""

#define SAF_VERSION ...

""")

if sys.platform != "win32":
ffibuilder.cdef("""

typedef float _Complex float_complex;
typedef double _Complex double_complex;
typedef float _Complex float_complex;
typedef double _Complex double_complex;

""")
else:
ffibuilder.cdef("""

typedef struct
{
float _Val[2];
} float_complex;

""")

ffibuilder.cdef("""

typedef enum _AFSTFT_FDDATA_FORMAT{
AFSTFT_BANDS_CH_TIME, /**< nBands x nChannels x nTimeHops */
AFSTFT_TIME_CH_BANDS /**< nTimeHops x nChannels x nBands */

}AFSTFT_FDDATA_FORMAT;


void *malloc(size_t size);
void free(void *ptr);

Expand Down Expand Up @@ -201,6 +223,9 @@

libraries.extend(saf_performance_lib)

library_dirs.extend([this_dir, saf_path])


print("Compiling _safpy with:")
print(f"C_Header_Source: {c_header_source}")
print(f"include_dirs: {include_dirs}")
Expand Down
Loading