Code Monkey home page Code Monkey logo

Comments (10)

olk avatar olk commented on August 29, 2024

from fiber.

olk avatar olk commented on August 29, 2024

from fiber.

DenizThatMenace avatar DenizThatMenace commented on August 29, 2024

Mmhhh... I see.

You could provide a workaround by adding copies of the original callcc function-templates to Boost.Context with different names (e.g. callcc_no_args callcc_with_args callcc_no_args_palloc callcc_with_args_palloc) which are only available if GCC 4.8/4.9 are used. You then have to make sure to call these specific functions from Boost.Fiber if either GCC 4.8 or 4.9 is used.

Of course this is kind of ugly but might help in this case.

I tried it out and it works. See the attached patches (against the Boost 1.64.0 release).

context__include__continuation.hpp.diff.txt
fiber__src__context.cpp.diff.txt

from fiber.

DaoWen avatar DaoWen commented on August 29, 2024

I was able to build Boost.Fiber with toolset=gcc-4.9 and run all tests successfully using the patches in PR #122 and PR boostorg/context#55. Using toolset=gcc-4.8, a few tests failed, but most passed.

Would you be able to verify?

from fiber.

DenizThatMenace avatar DenizThatMenace commented on August 29, 2024

I can confirm that Boost.Fiber from Boost releases 1.64.0 with these patches compiles fine with GCC 4.8.

I assume that during compilation with b2 all tests were compiled and run automatically. And none of the tests failed! 👍

(However, I just tried to compile Boost.Fiber and no other Boost-library which depends on it or Boost.Context.)

from fiber.

DaoWen avatar DaoWen commented on August 29, 2024

I assume that during compilation with b2 all tests were compiled and run automatically.

I actually don't think the tests are run unless you explicitly run them. I'm fairly new to the Boost build toolchain, so there might be better ways to do this, but here's how I run the tests for a specific module:

./b2 toolset=gcc-4.9 cxxflags="-std=c++11" --build-dir="/tmp/nick/boost/1.64" libs/fiber/test

If it says anything about "skipped" or "failed" targets at the end of the run, then that indicates a problem.

from fiber.

DenizThatMenace avatar DenizThatMenace commented on August 29, 2024

OK, you are right. I somehow thought that the unit-tests would have been run automatically. (Maybe that is the case for some other Boost-libraries?)

One unit-test failed and a second was skipped because of this, when compiling with GCC 4.8. GCC 6 compiles fine instead (while Clang 3.8 does only compile the library but does not even try to compile the libraries).

So I can confirm your findings.

The failure seems to be due to the unit-test somehow trying to use the deleted copy-constructor of a move-only type (std::atomic). Maybe just the unit-test is not entirely correct (for the standard-library of GCC 4.8) and needs to be fixed (or a workaround)?

from fiber.

DaoWen avatar DaoWen commented on August 29, 2024

The failure seems to be due to the unit-test somehow trying to use the deleted copy-constructor of a move-only type (std::atomic).

Yes, that's the same error I observed.

Maybe just the unit-test is not entirely correct (for the standard-library of GCC 4.8) and needs to be fixed (or a workaround)?

I'm guessing that this is actually an issue/deficiency in the C++ standard library that ships with GCC 4.8, which means the boost library can't really work around it (aside from maybe documenting the limitation and suggesting to upgrade your compiler toolchain). But, the good news is that everything else worked, so as long as you don't try to copy something with a deleted copy constructor into a Boost.Fiber promise, then I think you should be fine using GCC 4.8.

from fiber.

olk avatar olk commented on August 29, 2024

should be fixed now (not the atomic ctor issue), ty

from fiber.

quangbuule avatar quangbuule commented on August 29, 2024

I think this problem is not solved entirely (maybe related to gcc 4.9), here is my build error (branch develop):

libs/fiber/src/context.cpp: In constructor ‘boost::fibers::context::context(boost::fibers::dispatcher_context_t, const boost::context::preallocated&, const default_stack&, boost::fibers::scheduler*)’:
libs/fiber/src/context.cpp:236:14: error: call of overloaded ‘callcc(const std::allocator_arg_t&, const boost::context::preallocated&, const default_stack&, boost::fibers::context::context(boost::fibers::dispatcher_context_t, const boost::context::preallocated&, const default_stack&, boost::fibers::scheduler*)::<lambda(boost::context::continuation&&)>)’ is ambiguous
             });
              ^
libs/fiber/src/context.cpp:236:14: note: candidates are:
In file included from ./boost/fiber/context.hpp:28:0,
                 from libs/fiber/src/context.cpp:7:

Updated: I fixed by checking out the boost_context to develop branch too.

from fiber.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.