On Fri, Jul 1, 2016 at 10:58 AM, David Knezevic <david.kneze...@akselos.com> wrote:
> On Fri, Jul 1, 2016 at 10:51 AM, John Peterson <jwpeter...@gmail.com> > wrote: > >> >> >> On Fri, Jul 1, 2016 at 5:51 AM, David Knezevic < >> david.kneze...@akselos.com> wrote: >> >>> On Fri, Jul 1, 2016 at 2:32 AM, John Peterson <jwpeter...@gmail.com> >>> wrote: >>> >>>> >>>> >>>> On Thu, Jun 30, 2016 at 10:15 PM, David Knezevic < >>>> david.kneze...@akselos.com> wrote: >>>> >>>>> I have a libMesh app (which has been working fine for a long time) >>>>> that has: >>>>> >>>>> #include <boost/property_tree/json_parser.hpp> >>>>> >>>>> I just updated to the git HEAD, and now I get boost compilation errors >>>>> for >>>>> this app, e.g.: >>>>> >>>>> >>>>> /home/dknez/software/libmesh_install/opt_real/libmesh/include/boost/type_traits/aligned_storage.hpp:29:1: >>>>> error: redefinition of ‘const size_t >>>>> boost::detail::aligned_storage::alignment_of_max_align’ >>>>> BOOST_STATIC_CONSTANT( >>>>> ^ >>>>> >>>>> /home/dknez/software/libmesh_install/opt_real/libmesh/include/boost/aligned_storage.hpp:33:1: >>>>> error: ‘const size_t >>>>> boost::detail::aligned_storage::alignment_of_max_align’ previously >>>>> defined >>>>> here >>>>> BOOST_STATIC_CONSTANT( >>>>> ^ >>>>> >>>>> I guess this is related to the recent boost refresh? Any suggestions >>>>> on the >>>>> right fix? >>>>> >>>> >>>> Hmm... the error message is a little strange, I would have expected a >>>> "file not found" error caused by us forgetting a necessary header. I guess >>>> could you try compiling libmesh with an external boost 1.61 instead of its >>>> internal one? If that works, then it's some issue with our subset of >>>> boost. If that doesn't work, then you might need to update your app to >>>> work with newer versions of boost somehow. >>>> >>> >>> >>> I've been using boost provided by Ubuntu 14.04 (which is boost 1.54), to >>> provide extra functionality that I need (e.g. the JSON parser, referred to >>> in the header above). If I add --with-boost to my libMesh configure line, >>> then it still uses the boost in contrib because it requires 1.61 or higher. >>> >> >> libmesh currently requires boost 1.57 and higher, but prior to that it >> should have been requiring 1.55 and higher... so I'm not sure how you were >> able to previously use a boost 1.54 from Ubuntu? I suppose if: >> >> 1.) /usr/include is in your compiler path, and >> 2.) your boost is installed in /usr/include/boost, and >> 3.) you #include a header like json_parser.hpp that is not in our boost >> subset, >> >> then libmesh would think you were using its internal boost subset but in >> reality you would be mixing boost versions. >> > > > Yes, this is presumably what was happening for me before. > > > > >> If I update my external boost package to 1.61 then I guess it'd work >>> fine, but I'd rather not do that right now... I'm not clear on why I'm >>> getting a "previously defined" error, though... is it because by external >>> boost library (from Ubuntu) is clashing with the boost in contrib? >>> >> >> It sounds like the above is what is happening, i.e you've been mixing >> Boost versions 1.54 and 1.55 for a while now in your app, and it used to >> work fine until the recent upgrade. >> >> The best fix would be to not allow this (mixing of boost versions) to >> happen, but I'm not sure that's even possible, because we can't control >> every include path set by the user. Other fixes: >> >> 1.) You could try relaxing the minimum version of boost required by >> libmesh to 1.54. This should allow your --with-boost configure flag to >> work, but I'm not sure it would work with the Howard Hinnant unique_ptr.hpp >> header we use (this was what initially drove the 1.55 requirement IIRC). >> 2.) We could add json_parser.hpp (and its required headers) to the boost >> subset in libmesh. I'm hesitant to do this, though, since we are not >> actually using it in the library anywhere. >> 3.) You could keep using an older version of libmesh that still works >> with this app >> 4.) You could build and install a new (>=1.57) version of boost somewhere >> on your system and use that instead, ignoring the Ubuntu-provided one. >> >> I guess none of these is really ideal, but that is one of the pitfalls of >> relying on Boost I guess... >> > > > OK, thanks for your comments. That all makes sense. > > For now I removed the boost dependency in my app (it turns out I didn't > really need the JSON parser in this case), so this issue isn't urgent for > me anymore. > > In the future I'll plan to update to a newer version of boost so that > --with-boost will work for me. That way I should be able to use all of > boost in my apps (not just libMesh's subset of boost). > P.S. I realized that the cause of this issue was that I had "stale" boost include files in my libmesh_install/contrib directory. After I wiped my install directory and redid "make install", it worked fine. David ------------------------------------------------------------------------------ Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today. http://sdm.link/attshape _______________________________________________ Libmesh-users mailing list Libmesh-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libmesh-users