#1143681 opm-common: FTBFS: /<<PKGBUILDDIR>>/opm/material/common/quad.hpp:282:13: error: redefinition of 'quad std::abs(quad)'

#1143681#5
Date:
2026-08-05 11:24:41 UTC
From:
To:
Dear maintainer:

During a rebuild of all packages in unstable, this package failed to build.

Below you will find the last part of the build log (probably the most
relevant part, but not necessarily). If required, the full build log
is available here:

https://people.debian.org/~sanvila/build-logs/202608/

About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.

If you cannot reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:opm-common, so that this is still
visible in the BTS web page for this package.

Thanks.
--------------------------------------------------------------------------------
[...]
[ 25%] Building CXX object CMakeFiles/opmcommon.dir/opm/material/densead/Evaluation.cpp.o
/usr/bin/x86_64-linux-gnu-g++ -DEMBEDDED_PYTHON -DFMT_SHARED [too-long-redacted] material/densead/Evaluation.cpp
In file included from /<<PKGBUILDDIR>>/opm/material/densead/Evaluation.cpp:28:
/<<PKGBUILDDIR>>/opm/material/common/quad.hpp:282:13: error: redefinition of ‘quad std::abs(quad)’
  282 | inline quad abs(quad val)
      |             ^~~
In file included from /usr/include/c++/16/cstdlib:87,
                 from /usr/include/c++/16/ext/string_conversions.h:45,
                 from /usr/include/c++/16/bits/basic_string.h:4499,
                 from /usr/include/c++/16/string:58,
                 from /usr/include/c++/16/stdexcept:41,
                 from /<<PKGBUILDDIR>>/opm/material/densead/Evaluation.hpp:42,
                 from /<<PKGBUILDDIR>>/opm/material/densead/Evaluation.cpp:25:
/usr/include/c++/16/bits/std_abs.h:150:3: note: ‘constexpr __float128 std::abs(__float128)’ previously defined here
  150 |   abs(__float128 __x)
      |   ^~~
make[3]: *** [CMakeFiles/opmcommon.dir/build.make:3840: CMakeFiles/opmcommon.dir/opm/material/densead/Evaluation.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
make[2]: *** [CMakeFiles/Makefile2:871: CMakeFiles/opmcommon.dir/all] Error 2
make[2]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
make[1]: *** [Makefile:149: all] Error 2
make[1]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
dh_auto_build: error: cd obj-x86_64-linux-gnu && make -j2 INSTALL="install --strip-program=true" VERBOSE=1 returned exit code 2
make: *** [debian/rules:17: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess failed with exit status 2
--------------------------------------------------------------------------------

#1143681#10
Date:
2026-08-14 13:23:18 UTC
From:
To:
Control: reassign 1143684 src:opm-common
Control: tags -1 experimental
Control: forcemerge -1 1143684
Control: affects -1  src:opm-simulators libopm-common-dev
Control: retitle -1 opm-common FTBFS with GCC 16 on amd64
Markus, the root cause is the following in the log that is already
present with earlier GCC version:
  -- Performing Test QuadMath_HAS_MATH_OPS
  -- Performing Test QuadMath_HAS_MATH_OPS - Failed

When I edit cmake/Modules/FindQuadMath.cmake to have empty main() in
the QuadMath_HAS_MATH_OPS check the build passes.


The test fails (also with older GCC versions) due to:

$ cat test.cc
#include <cstdlib>
#include <cmath>
int main()
{
   __float128 b=10;
   __float128 c=std::atan(b);
}
$ g++ test.cc
test.cc: In function ‘int main()’:
test.cc:6:26: error: call of overloaded ‘atan(__float128&)’ is ambiguous
    6 |    __float128 c=std::atan(b);
      |                 ~~~~~~~~~^~~
  • there are 3 candidates
In file included from /usr/include/features.h:539,
                 from /usr/include/x86_64-linux-gnu/c++/16/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/16/bits/c++config.h:733,
                 from /usr/include/c++/16/cstdlib:46,
                 from test.cc:1:
    • candidate 1: ‘double atan(double)’
      /usr/include/x86_64-linux-gnu/bits/mathcalls.h:57:1:
         57 | __MATHCALL_VEC (atan,, (_Mdouble_ __x));
            | ^~~~~~~~~~~~~~
In file included from test.cc:2:
    • candidate 2: ‘constexpr float std::atan(float)’
      /usr/include/c++/16/cmath:138:3:
        138 |   atan(float __x)
            |   ^~~~
    • candidate 3: ‘constexpr long double std::atan(long double)’
      /usr/include/c++/16/cmath:142:3:
        142 |   atan(long double __x)
            |   ^~~~
$


cu
Adrian