From 4094a19fb560cda061d39fbb7c54722d063bddec Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sat, 4 May 2024 16:14:14 +0300 Subject: [PATCH 1/5] Update GHA tests to run using RTools44 --- .github/workflows/main.yml | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dd66a7cc52b..5f3807ec889 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: Windows Rtools40 +name: Windows Rtools44 on: pull_request: @@ -30,16 +30,16 @@ jobs: python-version: '3.x' - uses: r-lib/actions/setup-r@v2 with: - r-version: 4.1.3 + r-version: 'release' + rtools-version: '44' - - name: Set path for Rtools40 + - name: Set path for Rtools44 if: runner.os == 'Windows' - run: echo "C:/rtools40/usr/bin;C:/rtools40/mingw64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 + run: echo "C:/rtools44/usr/bin;C:/rtools44/x86_64-w64-mingw32.static.posix/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 - name: Build Math libs shell: powershell run: | - Add-Content make\local "O=1`n" make -f make/standalone math-libs -j2 - name: Add TBB to PATH shell: powershell @@ -71,16 +71,16 @@ jobs: python-version: '3.x' - uses: r-lib/actions/setup-r@v2 with: - r-version: 4.1.3 + r-version: 'release' + rtools-version: '44' - - name: Set path for Rtools40 + - name: Set path for Rtools44 if: runner.os == 'Windows' - run: echo "C:/rtools40/usr/bin;C:/rtools40/mingw64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 + run: echo "C:/rtools44/usr/bin;C:/rtools44/x86_64-w64-mingw32.static.posix/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 - name: Build Math libs shell: powershell run: | - Add-Content make\local "O=1`n" make -f make/standalone math-libs -j2 - name: Add TBB to PATH shell: powershell @@ -116,16 +116,16 @@ jobs: python-version: '3.x' - uses: r-lib/actions/setup-r@v2 with: - r-version: 4.1.3 + r-version: 'release' + rtools-version: '44' - - name: Set path for Rtools40 + - name: Set path for Rtools44 if: runner.os == 'Windows' - run: echo "C:/rtools40/usr/bin;C:/rtools40/mingw64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 + run: echo "C:/rtools44/usr/bin;C:/rtools44/x86_64-w64-mingw32.static.posix/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 - name: Build Math libs shell: powershell run: | - Add-Content make\local "O=1`n" make -f make/standalone math-libs -j2 - name: Add TBB to PATH shell: powershell @@ -156,11 +156,12 @@ jobs: python-version: '3.x' - uses: r-lib/actions/setup-r@v2 with: - r-version: 4.1.3 + r-version: 'release' + rtools-version: '44' - - name: Set path for Rtools40 + - name: Set path for Rtools44 if: runner.os == 'Windows' - run: echo "C:/rtools40/usr/bin;C:/rtools40/mingw64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 + run: echo "C:/rtools44/usr/bin;C:/rtools44/x86_64-w64-mingw32.static.posix/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 - name: Build Math libs shell: powershell From d9504223fb99b96f608164c3c2f40c4343fb53d2 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sat, 4 May 2024 19:40:12 +0300 Subject: [PATCH 2/5] Fix bug in tests --- test/unit/math/mix/fun/exp_test.cpp | 12 ++++++------ test/unit/math/test_ad.hpp | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/unit/math/mix/fun/exp_test.cpp b/test/unit/math/mix/fun/exp_test.cpp index c6b4cb3bea7..4a59b5ce602 100644 --- a/test/unit/math/mix/fun/exp_test.cpp +++ b/test/unit/math/mix/fun/exp_test.cpp @@ -7,14 +7,14 @@ TEST(mathMixMatFun, exp) { }; stan::test::expect_common_unary_vectorized< stan::test::ScalarSupport::RealAndComplex>(f); - stan::test::expect_unary_vectorized< - stan::test::ScalarSupport::RealAndComplex>(f, -15.2, -10, -0.5, 0.5, 1, - 1.0, 1.3, 5, 10); - stan::test::expect_complex_common(f); +// stan::test::expect_unary_vectorized< +// stan::test::ScalarSupport::RealAndComplex>(f, -15.2, -10, -0.5, 0.5, 1, +// 1.0, 1.3, 5, 10); +// stan::test::expect_complex_common(f); std::vector com_args = stan::test::internal::common_nonzero_args(); std::vector args{-2.6, -0.5, 0.5, 1.5}; - stan::test::expect_ad_vector_matvar(f, stan::math::to_vector(com_args)); - stan::test::expect_ad_vector_matvar(f, stan::math::to_vector(args)); + //stan::test::expect_ad_vector_matvar(f, stan::math::to_vector(com_args)); + //stan::test::expect_ad_vector_matvar(f, stan::math::to_vector(args)); } diff --git a/test/unit/math/test_ad.hpp b/test/unit/math/test_ad.hpp index 7d7547bdbd9..d596f6b2e0c 100644 --- a/test/unit/math/test_ad.hpp +++ b/test/unit/math/test_ad.hpp @@ -1991,7 +1991,7 @@ void expect_common_unary_vectorized(const F& f) { for (double x1 : args) stan::test::expect_ad_vectorized(tols, f, x1); auto int_args = internal::common_int_args(); - for (int x1 : args) + for (int x1 : int_args) stan::test::expect_ad_vectorized(tols, f, x1); } @@ -2022,7 +2022,7 @@ void expect_common_unary_vectorized(const F& f) { for (double x1 : args) stan::test::expect_ad_vectorized(tols, f, x1); auto int_args = internal::common_int_args(); - for (int x1 : args) + for (int x1 : int_args) stan::test::expect_ad_vectorized(tols, f, x1); for (auto x1 : common_complex()) stan::test::expect_ad_vectorized(tols, f, x1); From 6beecf2fbf73f922a101ede5fa2625e8667691f3 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Sat, 4 May 2024 12:41:14 -0400 Subject: [PATCH 3/5] [Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1 --- test/unit/math/mix/fun/exp_test.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/unit/math/mix/fun/exp_test.cpp b/test/unit/math/mix/fun/exp_test.cpp index 4a59b5ce602..6695b7ce212 100644 --- a/test/unit/math/mix/fun/exp_test.cpp +++ b/test/unit/math/mix/fun/exp_test.cpp @@ -7,14 +7,15 @@ TEST(mathMixMatFun, exp) { }; stan::test::expect_common_unary_vectorized< stan::test::ScalarSupport::RealAndComplex>(f); -// stan::test::expect_unary_vectorized< -// stan::test::ScalarSupport::RealAndComplex>(f, -15.2, -10, -0.5, 0.5, 1, -// 1.0, 1.3, 5, 10); -// stan::test::expect_complex_common(f); + // stan::test::expect_unary_vectorized< + // stan::test::ScalarSupport::RealAndComplex>(f, -15.2, -10, -0.5, 0.5, + // 1, + // 1.0, 1.3, 5, 10); + // stan::test::expect_complex_common(f); std::vector com_args = stan::test::internal::common_nonzero_args(); std::vector args{-2.6, -0.5, 0.5, 1.5}; - //stan::test::expect_ad_vector_matvar(f, stan::math::to_vector(com_args)); - //stan::test::expect_ad_vector_matvar(f, stan::math::to_vector(args)); + // stan::test::expect_ad_vector_matvar(f, stan::math::to_vector(com_args)); + // stan::test::expect_ad_vector_matvar(f, stan::math::to_vector(args)); } From 1cfdc6778a68e6f6f0f597df0bc9628561705b4f Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sat, 4 May 2024 22:22:45 +0300 Subject: [PATCH 4/5] Undo stray test change --- test/unit/math/mix/fun/exp_test.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/test/unit/math/mix/fun/exp_test.cpp b/test/unit/math/mix/fun/exp_test.cpp index 6695b7ce212..c6b4cb3bea7 100644 --- a/test/unit/math/mix/fun/exp_test.cpp +++ b/test/unit/math/mix/fun/exp_test.cpp @@ -7,15 +7,14 @@ TEST(mathMixMatFun, exp) { }; stan::test::expect_common_unary_vectorized< stan::test::ScalarSupport::RealAndComplex>(f); - // stan::test::expect_unary_vectorized< - // stan::test::ScalarSupport::RealAndComplex>(f, -15.2, -10, -0.5, 0.5, - // 1, - // 1.0, 1.3, 5, 10); - // stan::test::expect_complex_common(f); + stan::test::expect_unary_vectorized< + stan::test::ScalarSupport::RealAndComplex>(f, -15.2, -10, -0.5, 0.5, 1, + 1.0, 1.3, 5, 10); + stan::test::expect_complex_common(f); std::vector com_args = stan::test::internal::common_nonzero_args(); std::vector args{-2.6, -0.5, 0.5, 1.5}; - // stan::test::expect_ad_vector_matvar(f, stan::math::to_vector(com_args)); - // stan::test::expect_ad_vector_matvar(f, stan::math::to_vector(args)); + stan::test::expect_ad_vector_matvar(f, stan::math::to_vector(com_args)); + stan::test::expect_ad_vector_matvar(f, stan::math::to_vector(args)); } From 32a24572a79a2f87907cb07a911341c9c6f63623 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 6 May 2024 16:39:26 +0300 Subject: [PATCH 5/5] Test glibcxx random flag fix --- make/compiler_flags | 1 + 1 file changed, 1 insertion(+) diff --git a/make/compiler_flags b/make/compiler_flags index 0be4905ccee..e5971aa4326 100644 --- a/make/compiler_flags +++ b/make/compiler_flags @@ -154,6 +154,7 @@ ifeq ($(OS),Windows_NT) CXXFLAGS_WARNINGS ?= -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -Wno-int-in-bool-context -Wno-attributes CPPFLAGS_GTEST ?= -DGTEST_HAS_PTHREAD=0 CPPFLAGS_OS ?= -D_USE_MATH_DEFINES + CPPFLAGS_OS += -D_GLIBCXX11_USE_C99_COMPLEX ## Detecting Process Bitness: ## http://blogs.msdn.com/b/david.wang/archive/2006/03/26/howto-detect-process-bitness.aspx ifeq ($(PROCESSOR_ARCHITECTURE)$(PROCESSOR_ARCHITEW6432),x86)