bertiniteam / b2

Bertini 2.0: The redevelopment of Bertini in C++.
92 stars 34 forks source link

Trouble compiling with boost 1.67 #158

Closed hroskes closed 5 years ago

hroskes commented 5 years ago

I'm trying to compile Bertini with a link to Boost 1.67. I get the following error message:

In file included from src/basics/mpfr_complex.cpp:1:0:
./include/bertini2/mpfr_complex.hpp: In member function 'bertini::complex::operator std::complex<double>() const':
./include/bertini2/mpfr_complex.hpp:926:44: error: invalid cast from type 'const mpfr_float {aka const boost::multiprecision::number<boost::multiprecision::backends::mpfr_float_backend<0, (boost::multiprecision::mpfr_allocation_type)1> >}' to type 'double'
    return std::complex<double>(double(real_), double(imag_));

and, similarly

In file included from ./include/bertini2/function_tree.hpp:42:0,
                 from src/function_tree/node.cpp:27:
./include/bertini2/function_tree/symbols/linear_product.hpp: In constructor 'bertini::node::LinearProduct::LinearProduct(bertini::VariableGroup, int, bool)':
./include/bertini2/function_tree/symbols/linear_product.hpp:102:78: error: invalid static_cast from type 'Eigen::DenseCoeffsBase<Eigen::Matrix<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational>, -1, -1, 0, -1, -1>, 1>::Scalar {aka boost::multiprecision::number<boost::multiprecision::backends::gmp_rational>}' to type 'double'
       coeffs_dbl_ref(ii,jj).real( static_cast<double>(coeffs_rat_real_(ii,jj)) );

And a bunch more like each of those.

ofloveandhate commented 5 years ago

i'll just tried compiling from a fresh clone (both develop branch and master [develop is default]), and did not generate any errors when compiling the core, which I think you are probably compiling based on the error message you got (that is, I don't think you're compiling the python bindings in this issue).

can you tell me more about your compiling environment? what branch are you on? compiler? how old is your clone of the repo?

ofloveandhate commented 5 years ago

also, i was using Boost 1.67.0_1 from Homebrew on my Mac, with the supplied compiler from the XCode command line tools, Apple LLVM version 9.0.0 (clang-900.0.39.2).

i am happy to set up a VM to try to replicate your environment, provided it isn't some crazy distro, or redhat (which I don't have access to $$$)

hroskes commented 5 years ago

Sorry for the noise. I ended up finding a different workaround. I think there's a real issue with some permutation of the environment, but I can't chase it right now. Thanks anyway.