Catch2-3.5.1 tests fails on i686-linux, SSE extension

  • Done
  • quality assurance status badge
Details
2 participants
  • John Kehayias
  • Richard Sent
Owner
unassigned
Submitted by
Richard Sent
Severity
normal
R
R
Richard Sent wrote on 13 Jan 17:43 +0100
(name . Bug Guix)(address . bug-guix@gnu.org)
3e5407f77e0e70bafed2f11eed692cdc@freakingpenguin.com
Opening a ticket so discussions a bit more organized. Hope this doesn't
step on anybody's toes.

Catch2-3.5.1 fails to build with system=i686-linux, log attached. This
is due to a test added upstream that assumes the SSE extension is
present,
SelfTest/IntrospectiveTests/RandomNumberGeneration.tests.cpp:570.

One fix was proposed that replaces GCC with Clang, attached. This works
because Clang assumes the SSE extension by default. If we add
"-DCMAKE_CXX_FLAGS=-mno-sse", the test fails again.

Another solution is to add "-DCMAKE_CXX_FLAGS=-msse -mfpmath=sse" to the
existing package definition.

Of the two, the second is more explicit in how the problem is resolved,
but I don't know if we should assume SSE is present on i686.

An issue was opened upstream at

Richard Sent
Toggle diff (20 lines)
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 449340f331..e09a7bd82a 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -621,9 +621,14 @@ (define-public catch2-3
(arguments
(list
#:configure-flags
- #~(list "-DCATCH_DEVELOPMENT_BUILD=ON"
+ #~(list "-DCMAKE_CXX_COMPILER=clang++" ; tests fail with gcc-11 on i686
+ "-DCMAKE_CXX_STANDARD=14"
+ "-DCMAKE_CXX_STANDARD_REQUIRED=ON"
+ "-DCMAKE_CXX_EXTENSIONS=OFF"
+ "-DCATCH_DEVELOPMENT_BUILD=ON"
"-DCATCH_ENABLE_WERROR=OFF"
"-DBUILD_SHARED_LIBS=ON")))
+ (native-inputs (list clang-10))
(inputs (list python-wrapper))
(synopsis "Automated test framework for C++ and Objective-C")
(description "Catch2 stands for C++ Automated Test Cases in Headers and is
J
J
John Kehayias wrote on 13 Jan 23:56 +0100
(name . Richard Sent)(address . richard@freakingpenguin.com)(address . 68429@debbugs.gnu.org)
87a5p8c06r.fsf@protonmail.com
Hi,

On Sat, Jan 13, 2024 at 11:43 AM, Richard Sent wrote:

Toggle quote (19 lines)
> Opening a ticket so discussions a bit more organized. Hope this
> doesn't step on anybody's toes.
>
> Catch2-3.5.1 fails to build with system=i686-linux, log attached. This
> is due to a test added upstream that assumes the SSE extension is
> present,
> SelfTest/IntrospectiveTests/RandomNumberGeneration.tests.cpp:570.
>
> One fix was proposed that replaces GCC with Clang, attached. This
> works because Clang assumes the SSE extension by default. If we add
> "-DCMAKE_CXX_FLAGS=-mno-sse", the test fails again.
>
> Another solution is to add "-DCMAKE_CXX_FLAGS=-msse -mfpmath=sse" to
> the existing package definition.
>
> Of the two, the second is more explicit in how the problem is
> resolved, but I don't know if we should assume SSE is present on i686.
>

Thanks! Looking at other packages, seems it is find to enable SSE, just
for x86_64 and i686. Other times we explicitly disable SSE2 more
generally, but in this case it makes sense to match upstream (unless
they change this) and enable in these cases.

So, I used that configure flag just for those systems in
18393fcdddf5c3d834fa89ebf5f3925fc5b166ed which I've pushed. I added you
and another (Jo Gay, from the other channel) as co-authors for finding
the fix(es).

Toggle quote (4 lines)
> An issue was opened upstream at
> https://github.com/catchorg/Catch2/issues/2796
>

And thanks for this too!

John

Toggle quote (22 lines)
> Richard Sent
>
> diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
> index 449340f331..e09a7bd82a 100644
> --- a/gnu/packages/check.scm
> +++ b/gnu/packages/check.scm
> @@ -621,9 +621,14 @@ (define-public catch2-3
> (arguments
> (list
> #:configure-flags
> - #~(list "-DCATCH_DEVELOPMENT_BUILD=ON"
> + #~(list "-DCMAKE_CXX_COMPILER=clang++" ; tests fail with gcc-11 on i686
> + "-DCMAKE_CXX_STANDARD=14"
> + "-DCMAKE_CXX_STANDARD_REQUIRED=ON"
> + "-DCMAKE_CXX_EXTENSIONS=OFF"
> + "-DCATCH_DEVELOPMENT_BUILD=ON"
> "-DCATCH_ENABLE_WERROR=OFF"
> "-DBUILD_SHARED_LIBS=ON")))
> + (native-inputs (list clang-10))
> (inputs (list python-wrapper))
> (synopsis "Automated test framework for C++ and Objective-C")
> (description "Catch2 stands for C++ Automated Test Cases in Headers and is
J
J
John Kehayias wrote on 13 Jan 23:56 +0100
(name . Richard Sent)(address . richard@freakingpenguin.com)(address . 68429-done@debbugs.gnu.org)
878r4sc06k.fsf@protonmail.com
Hi,

On Sat, Jan 13, 2024 at 11:43 AM, Richard Sent wrote:

Toggle quote (19 lines)
> Opening a ticket so discussions a bit more organized. Hope this
> doesn't step on anybody's toes.
>
> Catch2-3.5.1 fails to build with system=i686-linux, log attached. This
> is due to a test added upstream that assumes the SSE extension is
> present,
> SelfTest/IntrospectiveTests/RandomNumberGeneration.tests.cpp:570.
>
> One fix was proposed that replaces GCC with Clang, attached. This
> works because Clang assumes the SSE extension by default. If we add
> "-DCMAKE_CXX_FLAGS=-mno-sse", the test fails again.
>
> Another solution is to add "-DCMAKE_CXX_FLAGS=-msse -mfpmath=sse" to
> the existing package definition.
>
> Of the two, the second is more explicit in how the problem is
> resolved, but I don't know if we should assume SSE is present on i686.
>

Thanks! Looking at other packages, seems it is find to enable SSE, just
for x86_64 and i686. Other times we explicitly disable SSE2 more
generally, but in this case it makes sense to match upstream (unless
they change this) and enable in these cases.

So, I used that configure flag just for those systems in
18393fcdddf5c3d834fa89ebf5f3925fc5b166ed which I've pushed. I added you
and another (Jo Gay, from the other channel) as co-authors for finding
the fix(es).

Toggle quote (4 lines)
> An issue was opened upstream at
> https://github.com/catchorg/Catch2/issues/2796
>

And thanks for this too!

John

Toggle quote (22 lines)
> Richard Sent
>
> diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
> index 449340f331..e09a7bd82a 100644
> --- a/gnu/packages/check.scm
> +++ b/gnu/packages/check.scm
> @@ -621,9 +621,14 @@ (define-public catch2-3
> (arguments
> (list
> #:configure-flags
> - #~(list "-DCATCH_DEVELOPMENT_BUILD=ON"
> + #~(list "-DCMAKE_CXX_COMPILER=clang++" ; tests fail with gcc-11 on i686
> + "-DCMAKE_CXX_STANDARD=14"
> + "-DCMAKE_CXX_STANDARD_REQUIRED=ON"
> + "-DCMAKE_CXX_EXTENSIONS=OFF"
> + "-DCATCH_DEVELOPMENT_BUILD=ON"
> "-DCATCH_ENABLE_WERROR=OFF"
> "-DBUILD_SHARED_LIBS=ON")))
> + (native-inputs (list clang-10))
> (inputs (list python-wrapper))
> (synopsis "Automated test framework for C++ and Objective-C")
> (description "Catch2 stands for C++ Automated Test Cases in Headers and is
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 68429@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 68429
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch