Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eclib fails to build with gcc6 / c++11 #20928

Closed
vbraun opened this issue Jul 3, 2016 · 19 comments
Closed

eclib fails to build with gcc6 / c++11 #20928

vbraun opened this issue Jul 3, 2016 · 19 comments

Comments

@vbraun
Copy link
Member

vbraun commented Jul 3, 2016

Current version fails with

libtool: compile:  g++ -DPACKAGE_NAME=\"eclib\" -DPACKAGE_TARNAME=\"eclib\" -DPACKAGE_VERSION=\"20150827\" "-DPACKAGE_STRING=\"eclib 20150827\"" -DPACKAGE_BUGREPORT=\"john.cremona@gmail.com\" -DPACKAGE_URL=\"\" -DPACKAGE=\"eclib\" -DVERSION=\"20150827\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_STDCXX_0X=1 -DHAVE_TR1_UNORDERED_MAP=1 -DHAVE_STDCXX_0X=1 -DHAVE_UNORDERED_MAP=1 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_UNISTD_H=1 -DHAVE__BOOL=1 -DHAVE_STDBOOL_H=1 -Drestrict=__restrict -DHAVE_MEMMOVE=1 -DHAVE_MEMSET=1 -DHAVE_STRCHR=1 -I. -DFLINT_LEVEL=1 -I/home/vbraun/Code/sage/local/include -I/home/vbraun/Code/sage/local/include -I/home/vbraun/Code/sage/local/include -DNTL_ALL -DUSE_PARI_FACTORING -DNEW_OP_ORDER -g -O3 -MT timer.lo -MD -MP -MF .deps/timer.Tpo -c timer.cc  -fPIC -DPIC -o .libs/timer.o
timer.cc: In destructor 'timer::~timer()':
timer.cc:77:13: error: no match for 'operator!=' (operand types are 'std::ofstream {aka std::basic_ofstream<char>}' and 'long int')
   if( file_ != NULL ) {
              
timer.cc:77:13: note: candidate: operator!=(int, long int) <built-in>
timer.cc:77:13: note:   no known conversion for argument 1 from 'std::ofstream {aka std::basic_ofstream<char>}' to 'int'
In file included from ../../../../../../../include/NTL/ZZ.h:20:0,
                 from ./eclib/interface.h:70,
                 from timer.cc:27:
../../../../../../../include/NTL/vector.h:778:6: note: candidate: template<class T> long int NTL::operator!=(const NTL::Vec<T>&, const NTL::Vec<T>&)
 long operator!=(const Vec<T>& a, const Vec<T>& b)
      ^~~~~~~~
../../../../../../../include/NTL/vector.h:778:6: note:   template argument deduction/substitution failed:
timer.cc:77:15: note:   'std::ofstream {aka std::basic_ofstream<char>}' is not derived from 'const NTL::Vec<T>'
   if( file_ != NULL ) {
               ^~~~~~
In file included from ../../../../../../../include/NTL/ZZ.h:21:0,
                 from ./eclib/interface.h:70,
                 from timer.cc:27:
../../../../../../../include/NTL/SmartPtr.h:308:6: note: candidate: template<class X, class Y> bool NTL::operator!=(const NTL::SmartPtr<T>&, const NTL::SmartPtr<Y>&)
 bool operator!=(const SmartPtr<X>& a, const SmartPtr<Y>& b)
      ^~~~~~~~

Newest upstream has fixes for C++ compatibility issues such as the one above let's upgrade to it.

Tarball:
http://www.lmona.de/files/sage/eclib-20160720.tar.bz2

CC: @JohnCremona

Component: packages: standard

Keywords: gcc6 c++11

Author: François Bissey

Branch/Commit: b75ece6

Reviewer: André Apitzsch, Volker Braun

Issue created by migration from https://trac.sagemath.org/ticket/20928

@vbraun vbraun added this to the sage-7.3 milestone Jul 3, 2016
@vbraun
Copy link
Member Author

vbraun commented Jul 3, 2016

comment:1

Workaround at #20926

@vbraun
Copy link
Member Author

vbraun commented Jul 3, 2016

comment:2

From https://gcc.gnu.org/gcc-6/porting_to.html

Cannot convert 'std::ostream' to 'bool'

As of C++11, iostream classes are no longer implicitly convertible to void* so it is no longer valid to do something like:


  bool valid(std::ostream& os) { return os; }
Such code must be changed to convert the iostream object to bool explicitly, e.g. return (bool)os; or return static_cast<bool>(os);

@a-andre
Copy link

a-andre commented Jul 19, 2016

comment:3

Upgrading eclib to it's latest release (v20160206) should fix the issue.

@kiwifb
Copy link
Member

kiwifb commented Jul 20, 2016

comment:4

OK, it looks like the upgrade won't require any change sage side so it should be easy.

@kiwifb
Copy link
Member

kiwifb commented Jul 20, 2016

comment:5

There will be a delay JohnCremona/eclib#15 version 20160206 has a minor defect when creating tarballs, it think it is version 20160101...

@JohnCremona
Copy link
Member

comment:6

Apologies for not doing eclib releases very consistently, hopefully we can sort this out today.

@JohnCremona
Copy link
Member

comment:7

There is now a new eclib release v20160720 which should keep everyone happy for a while.

@kiwifb

This comment has been minimized.

@kiwifb
Copy link
Member

kiwifb commented Jul 21, 2016

Branch: u/fbissey/eclib-20160206

@kiwifb
Copy link
Member

kiwifb commented Jul 21, 2016

Author: François Bissey

@kiwifb
Copy link
Member

kiwifb commented Jul 21, 2016

comment:8

And now with a tarball in the description and a branch for the upgrade.


New commits:

7e03c9bupdate eclib to 20160720

@kiwifb
Copy link
Member

kiwifb commented Jul 21, 2016

Commit: 7e03c9b

@a-andre

This comment has been minimized.

@a-andre
Copy link

a-andre commented Jul 23, 2016

comment:10

Remove the related workaround flags added in #20926.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 24, 2016

Branch pushed to git repo; I updated commit sha1. New commits:

a1053c3Merge branch 'develop' into eclib-20160206
b75ece6Remove work-around from ticket #20926

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 24, 2016

Changed commit from 7e03c9b to b75ece6

@kiwifb
Copy link
Member

kiwifb commented Jul 24, 2016

comment:12

Yes, I missed it. Thank you for pointing it out. Back to need review.

@vbraun
Copy link
Member Author

vbraun commented Jul 24, 2016

Reviewer: André Apitzsch, Volker Braun

@vbraun
Copy link
Member Author

vbraun commented Jul 24, 2016

Changed branch from u/fbissey/eclib-20160206 to b75ece6

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

No branches or pull requests

4 participants