__float128 failure with gcc-7 #87

Closed
LocutusOfBorg opened this Issue Aug 9, 2017 · 14 comments

Comments

Projects
None yet
5 participants

Hello, I don't know if this is really a castxml issue, but it seems so

I'm using the castxml debian version "0.1+git20160706-2" and I started testing "0.1+git20161215-1" some minutes ago in my ppa
https://launchpad.net/~costamagnagianfranco/+archive/ubuntu/locutusofborg-ppa/+packages

/home/packages/tmp/insighttoolkit4-4.12.0-dfsg1/BUILD/Wrapping/itkFixedArray.xml
--castxml-gccxml --castxml-start _wrapping_ --castxml-cc-gnu "(" /usr/bin/c++ -g
-O2 -fdebug-prefix-map=/home/packages/tmp/insighttoolkit4-4.12.0-dfsg1=.
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
-D_FORTIFY_SOURCE=2 -I/usr/include/nifti -Wall -Wcast-align
-Wdisabled-optimization -Wextra -Wformat=2 -Winvalid-pch -Wno-format-nonliteral
-Wpointer-arith -Wshadow -Wunused -Wwrite-strings -funit-at-a-time
-Wno-strict-overflow -Wno-deprecated -Wno-invalid-offsetof -Woverloaded-virtual
-Wstrict-null-sentinel ")" -w -c
@/home/packages/tmp/insighttoolkit4-4.12.0-dfsg1/BUILD/Wrapping/ITKCommon.castxml.inc
/home/packages/tmp/insighttoolkit4-4.12.0-dfsg1/BUILD/Wrapping/itkFixedArray.cxx
In file included from
/home/packages/tmp/insighttoolkit4-4.12.0-dfsg1/BUILD/Wrapping/itkFixedArray.cxx:1:
In file included from
/home/packages/tmp/insighttoolkit4-4.12.0-dfsg1/Modules/Core/Common/include/itkCommand.h:21:
In file included from
/home/packages/tmp/insighttoolkit4-4.12.0-dfsg1/Modules/Core/Common/include/itkObject.h:31:
In file included from
/home/packages/tmp/insighttoolkit4-4.12.0-dfsg1/Modules/Core/Common/include/itkLightObject.h:21:
In file included from
/home/packages/tmp/insighttoolkit4-4.12.0-dfsg1/Modules/Core/Common/include/itkMacro.h:47:
In file included from /usr/include/c++/7/string:52:
In file included from /usr/include/c++/7/bits/basic_string.h:6159:
In file included from /usr/include/c++/7/ext/string_conversions.h:41:
In file included from /usr/include/c++/7/cstdlib:77:
/usr/include/c++/7/bits/std_abs.h:103:16: error: invalid operands to binary
expression ('__castxml__float128' (aka '__castxml__float128_s') and 'int')
  { return __x < 0 ? -__x : __x; }
           ~~~ ^ ~
/usr/include/c++/7/bits/stl_pair.h:449:5: note: candidate template ignored:
could not match 'pair<type-parameter-0-0, type-parameter-0-1>' against
'__castxml__float128_s'
    operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
    ^
/usr/include/c++/7/bits/stl_iterator.h:305:5: note: candidate template ignored:
could not match 'reverse_iterator<type-parameter-0-0>' against
'__castxml__float128_s'
    operator<(const reverse_iterator<_Iterator>& __x,
    ^
/usr/include/c++/7/bits/stl_iterator.h:343:5: note: candidate template ignored:
could not match 'reverse_iterator<type-parameter-0-0>' against
'__castxml__float128_s'
    operator<(const reverse_iterator<_IteratorL>& __x,
    ^
/usr/include/c++/7/bits/stl_iterator.h:1142:5: note: candidate template ignored:
could not match 'move_iterator<type-parameter-0-0>' against '__castxml__float128_s'
    operator<(const move_iterator<_IteratorL>& __x,
    ^
/usr/include/c++/7/bits/stl_iterator.h:1148:5: note: candidate template ignored:
could not match 'move_iterator<type-parameter-0-0>' against '__castxml__float128_s'
    operator<(const move_iterator<_Iterator>& __x,
    ^
/usr/include/c++/7/bits/basic_string.h:5892:5: note: candidate template ignored:
could not match 'basic_string<type-parameter-0-0, type-parameter-0-1,
type-parameter-0-2>' against '__castxml__float128_s'
    operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
    ^
/usr/include/c++/7/bits/basic_string.h:5905:5: note: candidate template ignored:
could not match 'basic_string<type-parameter-0-0, type-parameter-0-1,
type-parameter-0-2>' against '__castxml__float128_s'
    operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
    ^
/usr/include/c++/7/bits/basic_string.h:5917:5: note: candidate template ignored:
could not match 'const _CharT *' against '__castxml__float128' (aka
'__castxml__float128_s')
    operator<(const _CharT* __lhs,
    ^
In file included from
/home/packages/tmp/insighttoolkit4-4.12.0-dfsg1/BUILD/Wrapping/itkFixedArray.cxx:1:
In file included from
/home/packages/tmp/insighttoolkit4-4.12.0-dfsg1/Modules/Core/Common/include/itkCommand.h:21:
In file included from
/home/packages/tmp/insighttoolkit4-4.12.0-dfsg1/Modules/Core/Common/include/itkObject.h:31:
In file included from
/home/packages/tmp/insighttoolkit4-4.12.0-dfsg1/Modules/Core/Common/include/itkLightObject.h:21:
In file included from
/home/packages/tmp/insighttoolkit4-4.12.0-dfsg1/Modules/Core/Common/include/itkMacro.h:47:
In file included from /usr/include/c++/7/string:52:
In file included from /usr/include/c++/7/bits/basic_string.h:6159:
In file included from /usr/include/c++/7/ext/string_conversions.h:41:
In file included from /usr/include/c++/7/cstdlib:77:
/usr/include/c++/7/bits/std_abs.h:103:22: error: invalid argument type
'__castxml__float128' (aka '__castxml__float128_s') to unary expression
  { return __x < 0 ? -__x : __x; }
                     ^~~~
/usr/include/c++/7/bits/std_abs.h:102:3: error: no return statement in constexpr
function
  abs(__float128 __x)
  ^
3 errors generated.
Wrapping/Modules/ITKCommon/CMakeFiles/ITKCommonCastXML.dir/build.make:145:
recipe for target 'Wrapping/itkFixedArray.xml' failed
make[3]: *** [Wrapping/itkFixedArray.xml] Error 1
make[3]: Leaving directory '/home/packages/tmp/insighttoolkit4-4.12.0-dfsg1/BUILD'
CMakeFiles/Makefile2:33770: recipe for target
'Wrapping/Modules/ITKCommon/CMakeFiles/ITKCommonCastXML.dir/all' failed
make[2]: *** [Wrapping/Modules/ITKCommon/CMakeFiles/ITKCommonCastXML.dir/all]
Error 2
make[2]: Leaving directory '/home/packages/tmp/insighttoolkit4-4.12.0-dfsg1/BUILD'
Makefile:165: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/packages/tmp/insighttoolkit4-4.12.0-dfsg1/BUILD'
dh_auto_build: make -j1 returned exit code 2
debian/rules:82: recipe for target 'build' failed
make: *** [build] Error 2h

Contributor

thewtex commented Aug 9, 2017

@LocutusOfBorg Thanks for the report. This sounds familiar. Could you please try to reproduce with CastXML Git master or with the binary available here?:

https://midas3.kitware.com/midas/item/318227

Contributor

gerddie commented Aug 10, 2017

I already tried git head (last commit Wed Mar 1), I also tried switching castxml to use clang/llvm 4.0, both to no avail.

The related Debian bug is https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=871573

mmm I tried the castxml in debian experimental, and at least the i386 build has finished correctly.
Amd64 is still ongoing in my ppa
https://launchpad.net/~costamagnagianfranco/+archive/ubuntu/locutusofborg-ppa/+sourcepub/8157019/+listing-archive-extra
but it was failing after one hour, not after 12, so I consider it fixed with the git20161215 version
@gerddie what about pushing it in unstable?

(I'm closing this one since it seems ok for me, let me know in case and I'll reopen it)

@LocutusOfBorg LocutusOfBorg reopened this Aug 10, 2017

my bad the ppa was misconfigured without -proposed pocket, so it picked up gcc-6 by default.
the issue still occurs then (I didn't try git head, but above Gert did that)

It fails also with latest master, as you can see in this build log
https://launchpadlibrarian.net/332909451/buildlog_ubuntu-artful-amd64.insighttoolkit4_4.12.0-dfsg1-1ubuntu4_BUILDING.txt.gz
clang: 4.0
commit id: fab9c47
(I did start from the packaged version, and included changes with a debian specific patch, but the result doesn't change)

Owner

bradking commented Aug 23, 2017

I can reproduce this with castxml from master and a tiny source:

$ cat cstdlib.cxx 
#include <cstdlib>
$ castxml --castxml-cc-gnu g++-7 cstdlib.cxx 
In file included from cstdlib.cxx:1:
In file included from /usr/include/c++/7/cstdlib:77:
/usr/include/c++/7/bits/std_abs.h:103:16: error: invalid operands to binary expression ('__castxml__float128' (aka '__castxml__float128_s') and 'int')
  { return __x < 0 ? -__x : __x; }
           ~~~ ^ ~
/usr/include/c++/7/bits/std_abs.h:103:22: error: invalid argument type '__castxml__float128' (aka '__castxml__float128_s') to unary expression
  { return __x < 0 ? -__x : __x; }
                     ^~~~
/usr/include/c++/7/bits/std_abs.h:102:3: error: no return statement in constexpr function
  abs(__float128 __x)
  ^
3 errors generated.

@bradking bradking self-assigned this Aug 23, 2017

@bradking bradking changed the title from ITK build failure with gcc-7 to __float128 failure with gcc-7 Aug 23, 2017

@bradking bradking closed this in 927c739 Aug 23, 2017

Owner

bradking commented Aug 23, 2017

This should now be fixed for CastXML when built against LLVM/Clang 3.9 or higher.

Contributor

thewtex commented Aug 23, 2017

Great, thanks @bradking.

Hello, a similar ITK-4.12.2 build issue may still exists with c++ (Ubuntu 7.2.0-8ubuntu3) 7.2.0 from Ubuntu Linux 17.10. With ITK_WRAP_PYTHON ON
Error message:

In file included from /usr/local/src/ITK-4.12.2-build/Wrapping/itkFixedArray.cxx:1:
In file included from /usr/local/src/InsightToolkit-4.12.2/Modules/Core/Common/include/itkCommand.h:21:
In file included from /usr/local/src/InsightToolkit-4.12.2/Modules/Core/Common/include/itkObject.h:31:
In file included from /usr/local/src/InsightToolkit-4.12.2/Modules/Core/Common/include/itkLightObject.h:21:
In file included from /usr/local/src/InsightToolkit-4.12.2/Modules/Core/Common/include/itkMacro.h:47:
In file included from /usr/include/c++/7/string:52:
In file included from /usr/include/c++/7/bits/basic_string.h:6349:
In file included from /usr/include/c++/7/ext/string_conversions.h:41:
In file included from /usr/include/c++/7/cstdlib:77:
/usr/include/c++/7/bits/std_abs.h:103:22: error: invalid argument type '__castxml__float128' (aka '__castxml__float128_s') to unary expression
  { return __x < 0 ? -__x : __x; }
                     ^~~~
/usr/include/c++/7/bits/std_abs.h:102:3: error: no return statement in constexpr function
  abs(__float128 __x)
  ^
Contributor

thewtex commented Oct 28, 2017

@ktdiedrich thanks for the note. Which compiler is being used, i.e. GCC or Clang? Also, is the system CastXML being used?

Hi,
GCC C++ front end compiler.
ITK_USE_SYTEM_CASTXML OFF

Contributor

thewtex commented Oct 29, 2017

@ktdiedrich Thanks for the information. I will work on updating the CastXML version used by ITK.

Contributor

thewtex commented Nov 7, 2017

@ktdiedrich This patch will address the issue: http://review.source.kitware.com/#/c/22769/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment