Subject: Bug#983942: gromacs: ftbfs with -march=x86-64-v3

From: Matthias Klose <[email-masked]>
Date: Wed, 03 Mar 2021 15:39:09 +0000

Package: src:gromacs
Version: 2020.5-4
Severity: minor
User: [email-masked]
Usertags: ftbfs-x86-64-v3

Starting with LLVM 12 and GCC 11 (and backported to gcc-10 for Debian), 
GCC introduces optimizations for new micro-architecture levels from
the x86-64 psABI.  Filing these bug reports for packages building with
the current level (x86-64), but not with x86-64-v3.

To reproduce these issues, append -march=x86-64-v3 to the compiler
flags (CFLAGS, CXXFLAGS, ...).  You also need hardware supporting these.
The easiest way is to call the dynamic linker in glibc 2.33 like
  /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 --help
Otherwise look at the flags in /proc/cpuinfo and compare these with
those from table 3.1 in the System V Application Binary Interface doc:
https://gitlab.com/x86-psABIs/x86-64-ABI/-/wikis/x86-64-psABI

Please don't upload a package setting these flags by default.  The
x86-64 baseline is still unchanged.

The full build log can be found at:
http://people.debian.org/~doko/logs/20210228/filtered/gcc10-v3/gromacs_2020.5-4_unstable_gcc10-v3.log
The last lines of the build log are at the end of this report.

[...]
54:   the time step of 2.0e-03 ps.
54:   Maybe you forgot to change the constraints mdp option.
54: 
54: Number of degrees of freedom in T-Coupling group System is 18.00
54: 
54: NOTE 2 [file /<<PKGBUILDDIR>>/build/basic/src/api/cpp/workflow/tests/Testing/Temporary/GmxApiTest_BuildApiWorkflowImpl_input.mdp]:
54:   You are using a plain Coulomb cut-off, which might produce artifacts.
54:   You might want to consider using PME electrostatics.
54: 
54: 
54: 
54: There were 2 notes
54: Determining Verlet buffer for a tolerance of 0.005 kJ/mol/ps at 298 K
54: Calculated rlist for 1x1 atom pair-list as 1.041 nm, buffer size 0.041 nm
54: Set rlist, assuming 4x4 atom pair-list, to 1.041 nm, buffer size 0.041 nm
54: Note that mdrun will redetermine rlist based on the actual pair-list setup
54: This run will generate roughly 0 Mb of data
54: [       OK ] GmxApiTest.BuildApiWorkflowImpl (228 ms)
54: [ RUN      ] GmxApiTest.CreateApiWorkflow
54: Setting the LD random seed to -76234755
54: Generated 331705 of the 331705 non-bonded parameter combinations
54: Generating 1-4 interactions: fudge = 0.5
54: Generated 331705 of the 331705 1-4 parameter combinations
54: Excluding 2 bonded neighbours molecule type 'SOL'
54: Excluding 3 bonded neighbours molecule type 'methane'
54: 
54: NOTE 1 [file spc_and_methane.top, line 33]:
54:   The bond in molecule-type methane between atoms 1 C and 2 H1 has an
54:   estimated oscillational period of 1.1e-02 ps, which is less than 10 times
54:   the time step of 2.0e-03 ps.
54:   Maybe you forgot to change the constraints mdp option.
54: 
54: Number of degrees of freedom in T-Coupling group System is 18.00
54: 
54: NOTE 2 [file /<<PKGBUILDDIR>>/build/basic/src/api/cpp/workflow/tests/Testing/Temporary/GmxApiTest_CreateApiWorkflow_input.mdp]:
54:   You are using a plain Coulomb cut-off, which might produce artifacts.
54:   You might want to consider using PME electrostatics.
54: 
54: 
54: 
54: There were 2 notes
54: Determining Verlet buffer for a tolerance of 0.005 kJ/mol/ps at 298 K
54: Calculated rlist for 1x1 atom pair-list as 1.041 nm, buffer size 0.041 nm
54: Set rlist, assuming 4x4 atom pair-list, to 1.041 nm, buffer size 0.041 nm
54: Note that mdrun will redetermine rlist based on the actual pair-list setup
54: This run will generate roughly 0 Mb of data
54: [       OK ] GmxApiTest.CreateApiWorkflow (215 ms)
54: [----------] 2 tests from GmxApiTest (443 ms total)
54: 
54: [----------] Global test environment tear-down
54: [==========] 2 tests from 1 test case ran. (443 ms total)
54: [  PASSED  ] 2 tests.
54/54 Test #54: GmxapiInternalsMpiTests .............   Passed    0.45 sec

98% tests passed, 1 tests failed out of 54

Label Time Summary:
GTest              = 124.16 sec*proc (54 tests)
IntegrationTest    =  94.42 sec*proc (12 tests)
MpiTest            = 109.82 sec*proc (8 tests)
SlowTest           =  24.25 sec*proc (2 tests)
UnitTest           =   5.49 sec*proc (40 tests)

Total Test time (real) = 124.19 sec

The following tests FAILED:
	 27 - SimdUnitTests (Failed)
Errors while running CTest
make: *** [debian/rules:129: build-basic] Error 1
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2

---

From: "Debian Bug Tracking System" <[email-masked]>
Date: Wed, 03 Mar 2021 15:45:20 +0000

Thank you for filing a new Bug report with Debian.

You can follow progress on this Bug here: 983942: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=983942.

This is an automatically generated reply to let you know your message
has been received.

Your message has been forwarded to the package maintainers (but not
other interested parties, as you requested) for their attention; they
will reply in due course.

Your message has been sent to the package maintainer(s):
 Debichem Team <[email-masked]>

If you wish to submit further information on this problem, please
send it to [email-masked].

Please do not send mail to [email-masked] unless you wish
to report a problem with the Bug-tracking system.

-- 
983942: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=983942
Debian Bug Tracking System
Contact [email-masked] with problems

---

From: Nicholas Breen <[email-masked]>
Date: Sat, 27 Nov 2021 17:00:39 -0800

> the current level (x86-64), but not with x86-64-v3.

Checking against the newest versions, this is still present -- but it's
also avoidable; the failure only occurs because the build is elsewhere
normally forced to nothing beyond SSE4.1 extensions, as part of the
*upstream* build system, for maximum compatibility.  Building with
-march=x86-64-v3 and with autodetected best-available SIMD flags
(DEB_BUILD_OPTIONS=cpuopt) passes all tests.

If there's a future way to detect an x86-64-v3 build, I think the
sensible fix here is to raise the baseline SIMD choice to match.

-- 
Nicholas Breen
[email-masked]

---

From: "Debian Bug Tracking System" <[email-masked]>
Date: Sun, 28 Nov 2021 01:09:06 +0000

Thank you for the additional information you have supplied regarding
this Bug report.

Your message has not been forwarded to the package maintainers or
other interested parties; you should ensure that the developers are
aware of the problem you have entered into the system - preferably
quoting the Bug reference number, #983942.

If you wish to submit further information on this problem, please
send it to [email-masked].