-
Notifications
You must be signed in to change notification settings - Fork 8
Some performance enhancements #72
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
Changes from all commits
af2df49
6e22786
4f0fa08
e6fc79b
6b7b924
32bcdf1
aa00d26
65979c9
239d8d1
8293bdf
4fab59d
1f36f1d
98faae2
c212a5f
499d519
4a9e71e
74aba06
2f76347
db2d0e9
2d7c9b4
d1efad1
9b0a9f6
27319bc
8bdf70d
25f58a4
90fda37
48294fe
090cb0e
687efc0
542cb1e
ce52121
4d95d24
3dda2b4
7ac9933
429dbb9
7d47fc1
6f7ebe5
84ecc27
29249ec
c25d599
bf1bc86
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ on: | |
| - "main" | ||
|
|
||
| jobs: | ||
| windows-and-linux-build: | ||
| build: | ||
| name: Build on ${{ matrix.platform }} with ${{ matrix.build_type }} configuration | ||
| strategy: | ||
| matrix: | ||
|
|
@@ -16,11 +16,17 @@ jobs: | |
| platform: | ||
| - "windows-latest" | ||
| - "ubuntu-latest" | ||
| - "macos-latest" # arm | ||
| - "macos-13" # x86_64 | ||
| include: | ||
| - platform: "windows-latest" | ||
| vcpkg_triplet: "x64-windows-static" | ||
| - platform: "ubuntu-latest" | ||
| vcpkg_triplet: "x64-linux" | ||
| - platform: "macos-latest" | ||
| vcpkg_triplet: "arm64-osx" | ||
| - platform: "macos-13" | ||
| vcpkg_triplet: "x64-osx" | ||
|
|
||
| runs-on: ${{ matrix.platform }} | ||
|
|
||
|
|
@@ -38,13 +44,18 @@ jobs: | |
|
|
||
| - name: Install vcpkg | ||
| run: | | ||
| git clone https://github.com/microsoft/vcpkg.git | ||
| git clone https://github.com/microsoft/vcpkg.git -b 2025.02.14 | ||
| cd vcpkg && ./bootstrap-vcpkg.sh | ||
| echo "VCPKG_ROOT=${{github.workspace}}/vcpkg" >> $GITHUB_ENV | ||
| echo "${{github.workspace}}/vcpkg" >> $GITHUB_PATH | ||
| ./vcpkg integrate install | ||
| shell: bash | ||
|
|
||
| - name: Install OpenMP | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd recommend renaming this task to "Install OpenMP on macOS" to make the platform-specific purpose clearer. The same comment applies to all instances in this PR. |
||
| if: matrix.platform == 'macos-latest' || matrix.platform == 'macos-13' | ||
| run: | | ||
| brew install libomp | ||
|
|
||
| - name: CMake | ||
| run: | | ||
| cmake --preset=default -DVCPKG_TARGET_TRIPLET=${{matrix.vcpkg_triplet}} | ||
|
|
@@ -57,62 +68,7 @@ jobs: | |
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{matrix.platform}} ${{matrix.build_type}} binaries | ||
| path: ${{github.workspace}}/*.zip | ||
|
|
||
| mac-build: | ||
| strategy: | ||
| matrix: | ||
| build_type: | ||
| - "Debug" | ||
| - "Release" | ||
|
|
||
| runs-on: "macos-latest" | ||
|
|
||
| permissions: | ||
| actions: write | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }}-macos-latest-${{ matrix.build_type }} | ||
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| with: | ||
| submodules: true | ||
|
|
||
| - name: Install vcpkg | ||
| run: | | ||
| git clone https://github.com/microsoft/vcpkg.git | ||
| cd vcpkg && ./bootstrap-vcpkg.sh | ||
| echo "VCPKG_ROOT=${{github.workspace}}/vcpkg" >> $GITHUB_ENV | ||
| echo "${{github.workspace}}/vcpkg" >> $GITHUB_PATH | ||
| ./vcpkg integrate install | ||
| shell: bash | ||
|
|
||
| - name: Build for x64 | ||
| run: | | ||
| cmake --preset=default -DVCPKG_TARGET_TRIPLET=x64-osx -DVCPKG_INSTALLED_DIR=${{github.workspace}}/vcpkg-x64 -B ${{github.workspace}}/build-x64 -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_OSX_ARCHITECTURES="x86_64" -DBUILD_TESTING=OFF | ||
| cmake --build ${{github.workspace}}/build-x64 --config ${{matrix.build_type}} | ||
|
|
||
| - name: Build for arm64 | ||
| run: | | ||
| cmake --preset=default -DVCPKG_TARGET_TRIPLET=arm64-osx -DVCPKG_INSTALLED_DIR=${{github.workspace}}/vcpkg-arm64 -B ${{github.workspace}}/build-arm64 -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_OSX_ARCHITECTURES="arm64" -DBUILD_TESTING=OFF | ||
| cmake --build ${{github.workspace}}/build-arm64 --config ${{matrix.build_type}} | ||
|
|
||
| - name: Create a universal binary | ||
| run: | | ||
| cp -r ${{github.workspace}}/build-x64 ${{github.workspace}}/build && cd ${{github.workspace}}/build | ||
| for filename in $(find . -type f -exec grep -H "build-x64" {} \; | awk '{print $1}' | sed -e 's/:.*//' | sort -u); do sed -i.bak -e "s/build-x64/build/g" $filename && rm ${filename}.bak; done | ||
| for lib in `find . -type f \( -name "*.so" -o -name "*.a" \)`; do rm $lib && lipo -create ../build-x64/${lib} ../build-arm64/${lib} -output $lib; done | ||
|
|
||
| - name: Package | ||
| run: | | ||
| cpack --config ${{github.workspace}}/build/CPackConfig.cmake -C ${{matrix.build_type}} -G ZIP | ||
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: macos-latest ${{matrix.build_type}} binaries | ||
| name: ${{matrix.platform == 'macos-latest' && 'macos-arm64' || (matrix.platform == 'macos-13' && 'macos-x86_64' || matrix.platform)}} ${{matrix.build_type}} binaries | ||
| path: ${{github.workspace}}/*.zip | ||
|
|
||
| build-wheel: | ||
|
|
@@ -121,7 +77,8 @@ jobs: | |
| platform: | ||
| - "windows-latest" | ||
| - "ubuntu-22.04" | ||
| - "macos-latest" # TODO (aliddell): universal binary? | ||
| - "macos-latest" # arm | ||
| - "macos-13" # x86_64 | ||
|
|
||
| runs-on: ${{ matrix.platform }} | ||
|
|
||
|
|
@@ -140,11 +97,11 @@ jobs: | |
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: "3.10" | ||
| python-version: "3.13" | ||
|
|
||
| - name: Install vcpkg | ||
| run: | | ||
| git clone https://github.com/microsoft/vcpkg.git | ||
| git clone https://github.com/microsoft/vcpkg.git -b 2025.02.14 | ||
| cd vcpkg && ./bootstrap-vcpkg.sh | ||
| echo "VCPKG_ROOT=${{github.workspace}}/vcpkg" >> $GITHUB_ENV | ||
| echo "${{github.workspace}}/vcpkg" >> $GITHUB_PATH | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,18 +10,24 @@ env: | |
| BUILD_TYPE: Release | ||
|
|
||
| jobs: | ||
| windows-and-linux-build: | ||
| build: | ||
| name: Build on ${{ matrix.platform }} | ||
| strategy: | ||
| matrix: | ||
| platform: | ||
| - "windows-latest" | ||
| - "ubuntu-latest" | ||
| - "macos-latest" | ||
| - "macos-13" | ||
| include: | ||
| - platform: "windows-latest" | ||
| vcpkg_triplet: "x64-windows-static" | ||
| - platform: "ubuntu-latest" | ||
| vcpkg_triplet: "x64-linux" | ||
| - platform: "macos-latest" | ||
| vcpkg_triplet: "arm64-osx" | ||
| - platform: "macos-13" | ||
| vcpkg_triplet: "x64-osx" | ||
|
|
||
| runs-on: ${{ matrix.platform }} | ||
|
|
||
|
|
@@ -39,13 +45,18 @@ jobs: | |
|
|
||
| - name: Install vcpkg | ||
| run: | | ||
| git clone https://github.com/microsoft/vcpkg.git | ||
| git clone https://github.com/microsoft/vcpkg.git -b 2025.02.14 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we currently caching any of the vcpkg build artifacts? I believe GitHub Actions supports this pretty easily. If we’re not caching them yet, it might be worth opening an issue to track — could be a nice win for reducing CI/CD runtime.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's not something I've ever looked into, but if if could speed up builds that would be a huge win. |
||
| cd vcpkg && ./bootstrap-vcpkg.sh | ||
| echo "VCPKG_ROOT=${{github.workspace}}/vcpkg" >> $GITHUB_ENV | ||
| echo "${{github.workspace}}/vcpkg" >> $GITHUB_PATH | ||
| ./vcpkg integrate install | ||
| shell: bash | ||
|
|
||
| - name: Install OpenMP | ||
| if: matrix.platform == 'macos-latest' || matrix.platform == 'macos-13' | ||
| run: | | ||
| brew install libomp | ||
|
|
||
| - name: Build | ||
| run: | | ||
| cmake --preset=default -DVCPKG_TARGET_TRIPLET=${{matrix.vcpkg_triplet}} -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release | ||
|
|
@@ -66,68 +77,15 @@ jobs: | |
| name: ${{matrix.platform}} binaries | ||
| path: ${{github.workspace}}/*.zip | ||
|
|
||
| mac-build: | ||
| name: Build on macos-latest | ||
| runs-on: "macos-latest" | ||
|
|
||
| permissions: | ||
| actions: write | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.platform }} | ||
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| with: | ||
| submodules: true | ||
|
|
||
| - name: Install vcpkg | ||
| run: | | ||
| git clone https://github.com/microsoft/vcpkg.git | ||
| cd vcpkg && ./bootstrap-vcpkg.sh | ||
| echo "VCPKG_ROOT=${{github.workspace}}/vcpkg" >> $GITHUB_ENV | ||
| echo "${{github.workspace}}/vcpkg" >> $GITHUB_PATH | ||
| ./vcpkg integrate install | ||
| shell: bash | ||
|
|
||
| - name: Build for x64 | ||
| run: | | ||
| cmake --preset=default -DVCPKG_TARGET_TRIPLET=x64-osx -DVCPKG_INSTALLED_DIR=${{github.workspace}}/vcpkg-x64 -B ${{github.workspace}}/build-x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="x86_64" -DBUILD_TESTING=OFF | ||
| cmake --build ${{github.workspace}}/build-x64 --config Release | ||
|
|
||
| - name: Build for arm64 | ||
| run: | | ||
| cmake --preset=default -DVCPKG_TARGET_TRIPLET=arm64-osx -DVCPKG_INSTALLED_DIR=${{github.workspace}}/vcpkg-arm64 -B ${{github.workspace}}/build-arm64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="arm64" -DBUILD_TESTING=OFF | ||
| cmake --build ${{github.workspace}}/build-arm64 --config Release | ||
|
|
||
| - name: Test # don't release if tests are failing | ||
| working-directory: ${{github.workspace}}/build-arm64 | ||
| run: ctest -C Release -L anyplatform --output-on-failure | ||
|
|
||
| - name: Create a universal binary | ||
| run: | | ||
| cp -r ${{github.workspace}}/build-x64 ${{github.workspace}}/build && cd ${{github.workspace}}/build | ||
| for filename in $(find . -type f -exec grep -H "build-x64" {} \; | awk '{print $1}' | sed -e 's/:.*//' | sort -u); do sed -i.bak -e "s/build-x64/build/g" $filename && rm ${filename}.bak; done | ||
| for lib in `find . -type f \( -name "*.so" -o -name "*.a" \)`; do rm $lib && lipo -create ../build-x64/${lib} ../build-arm64/${lib} -output $lib; done | ||
|
|
||
| - name: Package | ||
| run: | | ||
| cpack --config ${{github.workspace}}/build/CPackConfig.cmake -C Release -G ZIP | ||
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: macos-latest binaries | ||
| path: ${{github.workspace}}/*.zip | ||
|
|
||
| build-wheel: | ||
| name: Build wheels for Python | ||
| strategy: | ||
| matrix: | ||
| platform: | ||
| - "windows-latest" | ||
| - "ubuntu-22.04" | ||
| - "macos-latest" # TODO (aliddell): universal binary? | ||
| - "macos-latest" # arm | ||
| - "macos-13" # x86_64 | ||
| python: | ||
| - "3.9" | ||
| - "3.10" | ||
|
|
@@ -156,13 +114,18 @@ jobs: | |
|
|
||
| - name: Install vcpkg | ||
| run: | | ||
| git clone https://github.com/microsoft/vcpkg.git | ||
| git clone https://github.com/microsoft/vcpkg.git -b 2025.02.14 | ||
| cd vcpkg && ./bootstrap-vcpkg.sh | ||
| echo "VCPKG_ROOT=${{github.workspace}}/vcpkg" >> $GITHUB_ENV | ||
| echo "${{github.workspace}}/vcpkg" >> $GITHUB_PATH | ||
| ./vcpkg integrate install | ||
| shell: bash | ||
|
|
||
| - name: Install OpenMP | ||
| if: matrix.platform == 'macos-latest' || matrix.platform == 'macos-13' | ||
| run: | | ||
| brew install libomp | ||
|
|
||
| - name: Install system dependencies | ||
| if: ${{ matrix.platform == 'ubuntu-22.04' }} | ||
| run: | | ||
|
|
@@ -190,8 +153,7 @@ jobs: | |
|
|
||
| release: | ||
| needs: | ||
| - windows-and-linux-build | ||
| - mac-build | ||
| - build | ||
| - build-wheel | ||
| name: "Release" | ||
| runs-on: "ubuntu-latest" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,17 +4,19 @@ cmake_policy(SET CMP0057 NEW) # allows IN_LIST operator (for pybind11) | |
| cmake_policy(SET CMP0079 NEW) # allows use with targets in other directories | ||
| enable_testing() | ||
|
|
||
| find_package(nlohmann_json CONFIG REQUIRED) | ||
| find_package(blosc CONFIG REQUIRED) | ||
| find_package(miniocpp CONFIG REQUIRED) | ||
| find_package(Crc32c CONFIG REQUIRED) | ||
|
|
||
| include(cmake/aq_require.cmake) | ||
| include(cmake/git-versioning.cmake) | ||
| include(cmake/ide.cmake) | ||
| include(cmake/install-prefix.cmake) | ||
| include(cmake/wsl.cmake) | ||
| include(cmake/simd.cmake) | ||
| include(cmake/openmp.cmake) | ||
|
|
||
| find_package(nlohmann_json CONFIG REQUIRED) | ||
| find_package(blosc CONFIG REQUIRED) | ||
| find_package(miniocpp CONFIG REQUIRED) | ||
| find_package(Crc32c CONFIG REQUIRED) | ||
| find_package(OpenMP REQUIRED) | ||
|
Comment on lines
+15
to
+19
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we have multiple targets using these packages? If they’re only needed for something specific like streaming or testing, it might make sense to move the find_package calls closer to where they’re actually used, rather than keeping them at the top level. |
||
|
|
||
| set(CMAKE_C_STANDARD 11) | ||
| set(CMAKE_CXX_STANDARD 20) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity — what’s the reason for tagging vcpkg here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran into an issue in CI on Friday afternoon which was introduced with this and apparently resolved with this. I decided to tag a known working version so this doesn't happen again.