JohnCremona / eclib

The eclib package includes mwrank (for 2-descent on elliptic curves over Q) and modular symbol code used to create the elliptic curve database.
GNU General Public License v2.0
21 stars 15 forks source link

build fails with boost 1.64 #20

Closed antonio-rojas closed 6 years ago

antonio-rojas commented 7 years ago

In file included from ./eclib/method.h:60:0, from ./eclib/xsplit.h:35, from xsplit.cc:32: /usr/include/boost/smart_ptr/allocate_shared_array.hpp: In function ‘typename boost::detail::sp_if_size_array< >::type boost::allocate_shared(const A&)’: ./eclib/smatrix_elim.h:93:16: error: multiple types in one declaration

define scalar int

            ^

./eclib/smatrix_elim.h:93:16: error: declaration does not declare anything [-fpermissive] /usr/include/boost/smart_ptr/allocate_shared_array.hpp: In function ‘typename boost::detail::sp_if_size_array< >::type boost::allocate_shared(const A&, const typename boost::detail::sp_array_element::type&)’: ./eclib/smatrix_elim.h:93:16: error: multiple types in one declaration

define scalar int

            ^

./eclib/smatrix_elim.h:93:16: error: declaration does not declare anything [-fpermissive] /usr/include/boost/smart_ptr/allocate_shared_array.hpp: In function ‘typename boost::detail::sp_if_size_array< >::type boost::allocate_shared_noinit(const A&)’: ./eclib/smatrix_elim.h:93:16: error: multiple types in one declaration

define scalar int

            ^

./eclib/smatrix_elim.h:93:16: error: declaration does not declare anything [-fpermissive] /usr/include/boost/smart_ptr/allocate_shared_array.hpp: In function ‘typename boost::detail::sp_if_array< >::type boost::allocate_shared(const A&, std::size_t)’: ./eclib/smatrix_elim.h:93:16: error: multiple types in one declaration

define scalar int

            ^

./eclib/smatrix_elim.h:93:16: error: declaration does not declare anything [-fpermissive] /usr/include/boost/smart_ptr/allocate_shared_array.hpp: In function ‘typename boost::detail::sp_if_array< >::type boost::allocate_shared(const A&, std::size_t, const typename boost::detail::sp_array_element::type&)’: ./eclib/smatrix_elim.h:93:16: error: multiple types in one declaration

define scalar int

            ^

./eclib/smatrix_elim.h:93:16: error: declaration does not declare anything [-fpermissive] /usr/include/boost/smart_ptr/allocate_shared_array.hpp: In function ‘typename boost::detail::sp_if_array< >::type boost::allocate_shared_noinit(const A&, std::size_t)’: ./eclib/smatrix_elim.h:93:16: error: multiple types in one declaration

define scalar int

            ^

./eclib/smatrix_elim.h:93:16: error: declaration does not declare anything [-fpermissive] make[1]: *** [Makefile:570: xsplit.lo] Error 1

antonio-rojas commented 7 years ago

FTR, this is the exact commit that introduces the breakage:

https://github.com/boostorg/smart_ptr/commit/970e88897c095782c7c660f43a7c029ccd648d29#diff-826c7d222a732b683508798b5f2522d2

JohnCremona commented 7 years ago

Feel free to submit a pull request. eclib only uses boost in a very small way (parallelising one small part) which was contributed by a student who did a project with me. Otherwise this is not a priority for me until it breaks on my own machines, or in building Sage.

kiwifb commented 7 years ago

One of the issue here is that boost is enabled by default if it is found. The AX_BOOST_BASE macro is unfortunately set that way. So unless you explicitly pass --without-boost (or --with-boost=no) if boost 1.64 is present the build will break.

So I think it should either be fixed or the macro default should be changed so that boost has to be explicitly enabled.

JohnCremona commented 7 years ago

I agree that boost should not be enabled unless configured explicitly. Originally I did not have boost installed anywhere and only installed it when I wanted eclib to use it, but that is not a good basis for default setting. Pull requests welcome.

kiwifb commented 7 years ago

OK changing the default is now https://github.com/JohnCremona/eclib/pull/24 but if boost is to be kept we should still fix this. At least by default it won't break.

JohnCremona commented 7 years ago

Update: now boost is not enabled by default. It seems that the problem is that I typedef 'scalar' to be either int or long but boost also typdef 'scalar' to be something else. Is there a way to manage this apart from globally editing all my 'scalar' to something else? This seems to be a bad way to proceed.

kiwifb commented 7 years ago

I have officially removed the boost option from eclib in sage-on-gentoo. It was motivated by the report of the above breakage with boost 1.65.0.

jamesjer commented 6 years ago

The code was not using typedefs, but rather #defines, which replace the name 'scalar' in every context. I just opened a pull request to change to typedef, which fixes the issue for me: https://github.com/JohnCremona/eclib/pull/37

JohnCremona commented 6 years ago

Fixed in v20180710