use default threshold for compute_nns_p_matricx to avoid an additiona… #3802
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Linux/MacOS Build | |
| on: [push, pull_request] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/master'}} # don't cancel jobs on master | |
| #env: | |
| jobs: | |
| build: | |
| timeout-minutes: 60 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| build_type : [ Release, Debug ] | |
| os : [ macos-15, ubuntu-24.04 ] | |
| valgrind: [ true, false ] | |
| sanitize: [ true, false ] | |
| exclude: | |
| - valgrind : true | |
| sanitize : true | |
| - build_type : Release | |
| valgrind : true | |
| - build_type : Release | |
| sanitize : true | |
| - os: macos-15 | |
| sanitize: true | |
| - os: macos-15 | |
| valgrind: true | |
| include: | |
| - os: ubuntu-24.04 | |
| cxx: /usr/bin/g++-14 | |
| sanitize_flags: -fsanitize=address -fsanitize=leak -fsanitize=undefined -fno-omit-frame-pointer -fno-var-tracking | |
| - os: macos-15 | |
| cxx: clang++ | |
| sanitize_flags: -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer -fno-var-tracking | |
| name: "${{ matrix.valgrind && 'Valgrind' || matrix.sanitize && 'Sanitizers' || '' }} ${{ matrix.os }}: ${{ matrix.cxx }} ${{ matrix.build_type }}" | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| CXX : ${{ matrix.cxx }} | |
| DOXYGEN_VERSION : 1.9.1 | |
| CCACHE_DIR : ${{github.workspace}}/build/.ccache | |
| CCACHE_COMPRESS : true | |
| CCACHE_COMPRESSLEVEL : 6 | |
| BUILD_CONFIG : > | |
| -G Ninja | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
| -DBUILD_SHARED_LIBS=OFF | |
| -DCMAKE_UNITY_BUILD=${{ !matrix.sanitize && (matrix.build_type == 'Debug' || matrix.valgrind) }} | |
| -DMPIEXEC_PREFLAGS='--bind-to;none;--allow-run-as-root' | |
| -DCMAKE_PREFIX_PATH='/usr/local/opt/boost' | |
| -DSEQUANT_TESTS=ON | |
| -DSEQUANT_EVAL_TESTS=${{ !matrix.valgrind && !matrix.sanitize }} | |
| -DSEQUANT_USE_SYSTEM_BOOST_HASH=OFF | |
| -DCMAKE_CXX_STANDARD=20 | |
| -DCMAKE_CXX_EXTENSIONS=OFF | |
| -DSEQUANT_BENCHMARKS=${{ !matrix.valgrind && !matrix.sanitize }} | |
| -DSEQUANT_SKIP_LONG_TESTS=${{ matrix.valgrind || matrix.sanitize }} | |
| -DSEQUANT_COMPILE_DOC_EXAMPLES=${{ !matrix.valgrind }} | |
| -DSEQUANT_PYTHON=${{ !matrix.valgrind && !matrix.sanitize }} | |
| -DSEQUANT_ASSERT_BEHAVIOR=THROW | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: free up disk space on Ubuntu runner | |
| if: ${{ matrix.os == 'ubuntu-24.04' }} | |
| uses: jlumbroso/free-disk-space@main | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install Python packages | |
| run: pip install --index-url https://download.pytorch.org/whl/cpu numpy torch | |
| - name: Create Build Environment | |
| # Some projects don't allow in-source building, so create a separate build directory | |
| # We'll use this as our working directory for all subsequent commands | |
| run: cmake -E make_directory ${{github.workspace}}/build | |
| - name: Set sanitizer flags | |
| if: ${{ matrix.sanitize }} | |
| shell: bash | |
| run: | | |
| if [[ '${{ matrix.sanitize }}' = 'true' ]]; then | |
| echo "CXXFLAGS=${{ matrix.sanitize_flags }}" >> "$GITHUB_ENV" | |
| fi | |
| - name: Install prerequisite MacOS packages | |
| if: ${{ startswith(matrix.os, 'macos') }} | |
| run: brew install boost eigen open-mpi ccache | |
| - name: Install prerequisites Ubuntu packages | |
| if: ${{ matrix.os == 'ubuntu-24.04' }} | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install ninja-build g++-14 liblapack-dev libboost-dev libboost-locale-dev libboost-random-dev libboost-regex-dev libeigen3-dev openmpi-bin libopenmpi-dev ccache valgrind catch2 | |
| - name: Prepare ccache timestamp | |
| id: ccache_cache_timestamp | |
| shell: bash | |
| run: echo "timestamp=$(date -u +'%Y-%m-%d-%H-%M-%S')" >> $GITHUB_OUTPUT | |
| - name: Setup ccache cache files | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{github.workspace}}/build/.ccache | |
| key: ${{ matrix.config.name }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }} | |
| restore-keys: | | |
| ${{ matrix.config.name }}-ccache- | |
| - name: Configure CMake | |
| # Use a bash shell so we can use the same syntax for environment variable | |
| # access regardless of the host operating system | |
| shell: bash | |
| working-directory: ${{github.workspace}}/build | |
| # 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 $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE $BUILD_CONFIG | |
| - name: Build | |
| working-directory: ${{github.workspace}}/build | |
| shell: bash | |
| # Execute the build. You can specify a specific target with "--target <NAME>" | |
| run: ccache -p && ccache -z && cmake --build . -j 2 && ccache -s | |
| - name: Test | |
| if: ${{ !matrix.valgrind }} | |
| working-directory: ${{github.workspace}}/build | |
| shell: bash | |
| run: ctest --output-on-failure -R "^sequant" | |
| - name: Test (+ Valgrind) | |
| if: ${{ matrix.valgrind }} | |
| working-directory: ${{github.workspace}}/build | |
| shell: bash | |
| run: valgrind --error-exitcode=1 --leak-check=full ./tests/unit/unit_tests-sequant |