From 5291d58e93a2c82fbd4290ba90cbb6ba1db42bf2 Mon Sep 17 00:00:00 2001 From: Davis King Date: Sun, 6 Feb 2022 21:36:56 -0500 Subject: [PATCH] See if this makes the MPC test more reliable on MacOS --- .github/workflows/build_cmake.yml | 8 +++++++- dlib/test/mpc.cpp | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index 2308b35df..b9895edad 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -29,7 +29,13 @@ jobs: - name: Build just tests working-directory: ${{ github.workspace }}/dlib/test - run: cmake --build ${{ env.build_dir }} --config ${{ env.config }} --target dtest --parallel 4 + run: | + if [ "$RUNNER_OS" == "macOS" ]; then + # MacOS machines often come with low quality BLAS libraries installed, so don't use those. + cmake --build ${{ env.build_dir }} --config ${{ env.config }} --target dtest --parallel 4 -DDLIB_USE_BLAS=0 -DDLIB_USE_LAPACK=0 + else + cmake --build ${{ env.build_dir }} --config ${{ env.config }} --target dtest --parallel 4 + fi; - name: Test working-directory: ${{ github.workspace }}/dlib/test/${{ env.build_dir }} diff --git a/dlib/test/mpc.cpp b/dlib/test/mpc.cpp index dfe402219..53e865c11 100644 --- a/dlib/test/mpc.cpp +++ b/dlib/test/mpc.cpp @@ -403,7 +403,7 @@ namespace dlog << LINFO << trans(alpha2); dlog << LINFO << "objective value: " << 0.5*trans(alpha)*Q*alpha + trans(b)*alpha; dlog << LINFO << "objective value2: " << 0.5*trans(alpha2)*Q*alpha + trans(b)*alpha2; - DLIB_TEST_MSG(max(abs(alpha-alpha2)) < 1e-6, max(abs(alpha-alpha2))); + DLIB_TEST_MSG(max(abs(alpha-alpha2)) < 1e-7, max(abs(alpha-alpha2))); } test_with_positive_target_error_thresh();