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

OS X: Error: no matching constructor for initialization of 'hpx::lcos::local::condition_variable_any' #2261

Closed
tbiedert opened this issue Jul 24, 2016 · 6 comments

Comments

@tbiedert
Copy link

When compiling the current master in OS X using default CMake configuration, I receive the following error:

/Users/tb/Downloads/hpx/hpx/util/tuple.hpp:73:17: error: no matching constructor for initialization of
'hpx::lcos::local::condition_variable_any'
: _value(std::forward(value))

Happens with both system clang and llvm 3.8.1 (Homebrew), and with both Boost 1.59.0 and Boost 1.60.0 (also both Homebrew).

@K-ballo
Copy link
Member

K-ballo commented Jul 24, 2016

The error itself is sane, condition_variable[_any] is not movable. Could you provide the full output so we can trace where this is coming from?

@hkaiser
Copy link
Member

hkaiser commented Jul 24, 2016

Does this happen while compiling HPX Itself or while compiling your application?

@tbiedert
Copy link
Author

tbiedert commented Jul 24, 2016

Happens when compiling HPX itself.

I compile using: cmake -DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm/3.8.1/bin/clang++ ..

(With system clang the well known thread-local storage error appears of course, sorry for the confusion).

Here's the output after make:

[  0%] Building CXX object src/CMakeFiles/hpx.dir/pre_main.cpp.o
In file included from /Users/tb/Downloads/hpx/src/pre_main.cpp:9:
In file included from /Users/tb/Downloads/hpx/hpx/runtime.hpp:20:
In file included from /Users/tb/Downloads/hpx/hpx/runtime_fwd.hpp:14:
In file included from /Users/tb/Downloads/hpx/hpx/runtime/basename_registration.hpp:12:
In file included from /Users/tb/Downloads/hpx/hpx/lcos/future.hpp:12:
In file included from /Users/tb/Downloads/hpx/hpx/lcos/detail/future_data.hpp:20:
In file included from /Users/tb/Downloads/hpx/hpx/util/bind.hpp:19:
In file included from /Users/tb/Downloads/hpx/hpx/util/invoke_fused.hpp:13:
/Users/tb/Downloads/hpx/hpx/util/tuple.hpp:73:17: error: no matching constructor for initialization of
      'hpx::lcos::local::condition_variable_any'
              : _value(std::forward<U>(value))
                ^      ~~~~~~~~~~~~~~~~~~~~~~

/Users/tb/Downloads/hpx/hpx/util/tuple.hpp:213:13: note: in instantiation of function template specialization
      'hpx::util::detail::tuple_member<2, hpx::lcos::local::condition_variable_any,
      void>::tuple_member<hpx::util::detail::tuple_member<2, hpx::lcos::local::condition_variable_any, void>
      >' requested here
            tuple_impl(tuple_impl&&) = default;
            ^
/usr/local/Cellar/llvm/3.8.1/bin/../include/c++/v1/utility:352:37: note: in instantiation of template class
      'std::__1::is_convertible<hpx::util::tuple<bool, unsigned long,
      hpx::lcos::local::condition_variable_any>, hpx::util::tuple<bool, unsigned long,
      hpx::lcos::local::condition_variable_any> >' requested here
                                    is_convertible<_U2, _T2>::value>::type* = 0)
                                    ^
/usr/local/Cellar/llvm/3.8.1/bin/../include/c++/v1/utility:280:30: note: while substituting deduced template
      arguments into function template 'pair' [with _U1 = const hpx::naming::gid_type, _U2 =
      hpx::util::tuple<bool, unsigned long, hpx::lcos::local::condition_variable_any>]
struct _LIBCPP_TYPE_VIS_ONLY pair
                             ^
/usr/local/Cellar/llvm/3.8.1/bin/../include/c++/v1/__tree:579:16: note: in instantiation of template class
      'std::__1::__value_type<hpx::naming::gid_type, hpx::util::tuple<bool, unsigned long,
      hpx::lcos::local::condition_variable_any> >' requested here
    value_type __value_;
               ^
/usr/local/Cellar/llvm/3.8.1/bin/../include/c++/v1/__tree:780:16: note: in instantiation of template class
      'std::__1::__tree_node<std::__1::__value_type<hpx::naming::gid_type, hpx::util::tuple<bool, unsigned
      long, hpx::lcos::local::condition_variable_any> >, void *>' requested here
        return static_cast<__node_pointer>
               ^
/usr/local/Cellar/llvm/3.8.1/bin/../include/c++/v1/__tree:1067:22: note: in instantiation of member function
      'std::__1::__tree<std::__1::__value_type<hpx::naming::gid_type, hpx::util::tuple<bool, unsigned long,
      hpx::lcos::local::condition_variable_any> >, std::__1::__map_value_compare<hpx::naming::gid_type,
      std::__1::__value_type<hpx::naming::gid_type, hpx::util::tuple<bool, unsigned long,
      hpx::lcos::local::condition_variable_any> >, std::__1::less<hpx::naming::gid_type>, true>,
      std::__1::allocator<std::__1::__value_type<hpx::naming::gid_type, hpx::util::tuple<bool, unsigned long,
      hpx::lcos::local::condition_variable_any> > > >::__end_node' requested here
    __begin_node() = __end_node();
                     ^
/usr/local/Cellar/llvm/3.8.1/bin/../include/c++/v1/map:882:11: note: in instantiation of member function
      'std::__1::__tree<std::__1::__value_type<hpx::naming::gid_type, hpx::util::tuple<bool, unsigned long,
      hpx::lcos::local::condition_variable_any> >, std::__1::__map_value_compare<hpx::naming::gid_type,
      std::__1::__value_type<hpx::naming::gid_type, hpx::util::tuple<bool, unsigned long,
      hpx::lcos::local::condition_variable_any> >, std::__1::less<hpx::naming::gid_type>, true>,
      std::__1::allocator<std::__1::__value_type<hpx::naming::gid_type, hpx::util::tuple<bool, unsigned long,
      hpx::lcos::local::condition_variable_any> > > >::__tree' requested here
        : __tree_(__vc(key_compare())) {}
          ^
/Users/tb/Downloads/hpx/hpx/runtime/agas/server/primary_namespace.hpp:269:5: note: in instantiation of member
      function 'std::__1::map<hpx::naming::gid_type, hpx::util::tuple<bool, unsigned long,
      hpx::lcos::local::condition_variable_any>, std::__1::less<hpx::naming::gid_type>,
      std::__1::allocator<std::__1::pair<const hpx::naming::gid_type, hpx::util::tuple<bool, unsigned long,
      hpx::lcos::local::condition_variable_any> > > >::map' requested here
    primary_namespace()
    ^
/Users/tb/Downloads/hpx/hpx/lcos/local/condition_variable.hpp:130:11: note: candidate constructor
      (the implicit copy constructor) not viable: no known conversion from 'hpx::util::detail::tuple_member<2,
      hpx::lcos::local::condition_variable_any, void>' to 'const hpx::lcos::local::condition_variable_any' for
      1st argument
    class condition_variable_any
          ^
/Users/tb/Downloads/hpx/hpx/lcos/local/condition_variable.hpp:130:11: note: candidate constructor
      (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided
1 error generated.
make[2]: *** [src/CMakeFiles/hpx.dir/pre_main.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/hpx.dir/all] Error 2
make: *** [all] Error 2

@K-ballo
Copy link
Member

K-ballo commented Jul 24, 2016

This looks like a bug in libc++'s pair, combined with some lack of SFINAE-friendlyness on our tuple. Will investigate.

@K-ballo
Copy link
Member

K-ballo commented Jul 24, 2016

This is caused by a NASTY combination of language corner cases, standard defects, and library implementation bugs. Fortunately the workaround should be rather simple, as depicted in the fixing_2261 branch.

@timbiedert Would you give it a try and report back?

@tbiedert
Copy link
Author

Hey, it works! Even without any warnings :-)

Good work! Thanks!

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

No branches or pull requests

3 participants