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

Build Error for Portable Executor for c++14 #501

Closed
aaronalbers opened this issue Oct 1, 2022 · 1 comment
Closed

Build Error for Portable Executor for c++14 #501

aaronalbers opened this issue Oct 1, 2022 · 1 comment

Comments

@aaronalbers
Copy link
Contributor

aaronalbers commented Oct 1, 2022

There is a build error when building the library for c++14 using Boost shims and the portable executor. This is happening because the copy constructor of the portable task system is implicitly deleted and copy elision is not guaranteed in c++14.

aaronalbers@Aarons-MacBook-Pro stlab_fork % cmake -S . -B ../BUILD -DCMAKE_CXX_STANDARD=14 -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DSTLAB_TASK_SYSTEM=portable -DSTLAB_USE_BOOST_CPP17_SHIMS=ON   
CMake Warning at CMakeLists.txt:13 (find_package):
  By not providing "FindQt6.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt6", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt6" with any of
  the following names:

    Qt6Config.cmake
    qt6-config.cmake

  Add the installation prefix of "Qt6" to CMAKE_PREFIX_PATH or set "Qt6_DIR"
  to a directory containing one of the above files.  If "Qt6" provides a
  separate development package or SDK, be sure it has been installed.


-- stlab: Use Boost C++17 Shims: ON
-- stlab: Disable Coroutines: TRUE
-- stlab: Thread System: pthread-apple
-- stlab: Task System: portable
-- stlab: Main Executor: libdispatch
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/aaronalbers/git/BUILD
aaronalbers@Aarons-MacBook-Pro stlab_fork % cd ..
aaronalbers@Aarons-MacBook-Pro git % cd BUILD 
aaronalbers@Aarons-MacBook-Pro BUILD % cmake --build .                                                                                                                                                     
Consolidate compiler generated dependencies of target stlab.test.channel
[  2%] Building CXX object test/CMakeFiles/stlab.test.channel.dir/channel_functor_tests.cpp.o
In file included from /Users/aaronalbers/git/stlab_fork/test/channel_functor_tests.cpp:12:
/Users/aaronalbers/git/stlab_fork/stlab/concurrency/default_executor.hpp:436:16: error: call to implicitly-deleted copy constructor of 'stlab::detail::priority_task_system'
        return priority_task_system{};
               ^~~~~~~~~~~~~~~~~~~~~~
/Users/aaronalbers/git/stlab_fork/stlab/concurrency/default_executor.hpp:332:27: note: copy constructor of 'priority_task_system' is implicitly deleted because field '_index' has a deleted copy constructor
    std::atomic<unsigned> _index{0};
                          ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/atomic:1816:7: note: copy constructor of 'atomic<unsigned int>' is implicitly deleted because base class '__atomic_base<unsigned int>' has a deleted copy constructor
    : public __atomic_base<_Tp>
      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/atomic:1733:7: note: copy constructor of '__atomic_base<unsigned int, true>' is implicitly deleted because base class '__atomic_base<unsigned int, false>' has a deleted copy constructor
    : public __atomic_base<_Tp, false>
      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/atomic:1716:5: note: '__atomic_base' has been explicitly marked deleted here
    __atomic_base(const __atomic_base&) = delete;
    ^
In file included from /Users/aaronalbers/git/stlab_fork/test/channel_functor_tests.cpp:12:
/Users/aaronalbers/git/stlab_fork/stlab/concurrency/default_executor.hpp:432:33: error: call to implicitly-deleted copy constructor of 'stlab::detail::priority_task_system'
    static priority_task_system only_task_system{[]{
                                ^               ~~~~
/Users/aaronalbers/git/stlab_fork/stlab/concurrency/default_executor.hpp:332:27: note: copy constructor of 'priority_task_system' is implicitly deleted because field '_index' has a deleted copy constructor
    std::atomic<unsigned> _index{0};
                          ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/atomic:1816:7: note: copy constructor of 'atomic<unsigned int>' is implicitly deleted because base class '__atomic_base<unsigned int>' has a deleted copy constructor
    : public __atomic_base<_Tp>
      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/atomic:1733:7: note: copy constructor of '__atomic_base<unsigned int, true>' is implicitly deleted because base class '__atomic_base<unsigned int, false>' has a deleted copy constructor
    : public __atomic_base<_Tp, false>
      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/atomic:1716:5: note: '__atomic_base' has been explicitly marked deleted here
    __atomic_base(const __atomic_base&) = delete;
    ^
2 errors generated.
make[2]: *** [test/CMakeFiles/stlab.test.channel.dir/channel_functor_tests.cpp.o] Error 1
make[1]: *** [test/CMakeFiles/stlab.test.channel.dir/all] Error 2
make: *** [all] Error 2
sean-parent added a commit that referenced this issue Oct 11, 2022
* Changes to support C++14 and fixed missing include file for unit tests

* Fixing namespace for nullptr_t and formatting.

* Update default_executor.hpp

Improving comments per code review.
@sean-parent
Copy link
Member

Marking as fixed.

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

No branches or pull requests

2 participants