grantila / q

A platform-independent promise library for C++, implementing asynchronous continuations.
http://libq.io
Apache License 2.0
193 stars 24 forks source link

build error and mails related to libq stay unanswered #1

Closed a4z closed 7 years ago

a4z commented 7 years ago

Hej Gustaf, please check you inbox ;-)

ytterligare: I thought I have a look and check how the build and pack experience is, submit improvements if required/wanted, .... like we talked about recently.

unfortunately my user experience was not the best

make VERBOSE=1
/usr/bin/cmake -H/home/a4z/tmp/q -B/home/a4z/tmp/q/buildDebug --check-build-system CMakeFiles/Makefile.cmake 0                                                                                       
/usr/bin/cmake -E cmake_progress_start /home/a4z/tmp/q/buildDebug/CMakeFiles /home/a4z/tmp/q/buildDebug/CMakeFiles/progress.marks                                                                    
make -f CMakeFiles/Makefile2 all                                                                                                                                                                     
make[1]: Entering directory '/home/a4z/tmp/q/buildDebug'
make -f libs/q/CMakeFiles/q.dir/build.make libs/q/CMakeFiles/q.dir/depend
make[2]: Entering directory '/home/a4z/tmp/q/buildDebug'
cd /home/a4z/tmp/q/buildDebug && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/a4z/tmp/q /home/a4z/tmp/q/libs/q /home/a4z/tmp/q/buildDebug /home/a4z/tmp/q/buildDebug/libs/q /home/a4z/tmp/q/buildDebug/libs/q/CMakeFiles/q.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/a4z/tmp/q/buildDebug'
make -f libs/q/CMakeFiles/q.dir/build.make libs/q/CMakeFiles/q.dir/build
make[2]: Entering directory '/home/a4z/tmp/q/buildDebug'
[  1%] Building CXX object libs/q/CMakeFiles/q.dir/src/lib.cpp.o
cd /home/a4z/tmp/q/buildDebug/libs/q && /usr/bin/c++    -I/home/a4z/tmp/q/libs/q/include  -g -g   -Wall -Wno-comment -std=gnu++11 -o CMakeFiles/q.dir/src/lib.cpp.o -c /home/a4z/tmp/q/libs/q/src/lib.cpp
In file included from /usr/include/c++/5.3.0/bits/move.h:57:0,
                 from /usr/include/c++/5.3.0/bits/stl_pair.h:59,
                 from /usr/include/c++/5.3.0/bits/stl_algobase.h:64,
                 from /usr/include/c++/5.3.0/bits/char_traits.h:39,
                 from /usr/include/c++/5.3.0/ios:40,
                 from /usr/include/c++/5.3.0/ostream:38,
                 from /usr/include/c++/5.3.0/iostream:39,
                 from /home/a4z/tmp/q/libs/q/include/q/functional.hpp:20,
                 from /home/a4z/tmp/q/libs/q/include/q/function.hpp:21,
                 from /home/a4z/tmp/q/libs/q/include/q/scope.hpp:20,
                 from /home/a4z/tmp/q/libs/q/include/q/lib.hpp:20,
                 from /home/a4z/tmp/q/libs/q/src/lib.cpp:17:
/usr/include/c++/5.3.0/type_traits: In instantiation of ‘struct std::__is_move_constructible_impl<q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void>, true>’:
/usr/include/c++/5.3.0/type_traits:1125:12:   required from ‘struct std::is_move_constructible<q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void> >’
/home/a4z/tmp/q/libs/q/include/q/function.hpp:449:3:   required by substitution of ‘template<class Fn> q::detail::any_function<Signature, Shared, TotalSize, Ret, Args>::any_function(Fn&&, typename std::enable_if<(q::bool_type<((((((typename q::function_traits<typename std::decay<_Tp>::type>::valid:: value && (! std::is_same<typename std::decay<_Tp>::type, q::detail::any_function<Signature, Shared, TotalSize, Ret, Args> >::value)) && typename q::function_traits<Fn>::argument_types::is_convertible_to<typename q::function_traits<typename std::decay<_Tp>::type>::argument_types>::value) && typename q::function_traits<typename std::decay<_Tp>::type>::result_argument_type::is_convertible_to<typename q::function_traits<Fn>::result_argument_type>::value) && std::is_move_constructible<typename std::decay<_Tp>::type>::value) && ((std::is_rvalue_reference<Fn&&>::value && (! std::is_const<_Functor>::value)) || std::is_copy_constructible<typename std::decay<_Tp>::type>::value)) && (((! Shared:: value) || (! q::bool_type<((! typename q::function_traits<typename std::decay<_Tp>::type>::is_const:: value) && typename q::function_traits<typename std::decay<_Tp>::type>::using_call_operator:: value)>::value)) || std::is_copy_constructible<typename std::decay<_Tp>::type>::value))>::value && std::is_copy_constructible<typename std::decay<_Tp>::type>::value)>::type*) [with Fn = q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void>]’
/usr/include/c++/5.3.0/type_traits:936:43:   required by substitution of ‘template<class _Tp, class _Arg, class> static std::true_type std::__do_is_direct_constructible_impl::__test(int) [with _Tp = q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void>; _Arg = q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void>&&; <template-parameter-1-3> = <missing>]’
/usr/include/c++/5.3.0/type_traits:948:41:   required from ‘struct std::__is_direct_constructible_impl<q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void>, q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void>&&>’
/usr/include/c++/5.3.0/type_traits:137:12:   required from ‘struct std::__and_<std::is_destructible<q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void> >, std::__is_direct_constructible_impl<q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void>, q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void>&&> >’
/usr/include/c++/5.3.0/type_traits:952:12:   [ skipping 12 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/usr/include/c++/5.3.0/bits/stl_iterator.h:1161:32:   required by substitution of ‘template<class _Iterator, class _ReturnType> _ReturnType std::__make_move_if_noexcept_iterator(_Iterator) [with _Iterator = q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void>*; _ReturnType = <missing>]’
/usr/include/c++/5.3.0/bits/stl_uninitialized.h:303:3:   required from ‘_ForwardIterator std::__uninitialized_move_if_noexcept_a(_InputIterator, _InputIterator, _ForwardIterator, _Allocator&) [with _InputIterator = q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void>*; _ForwardIterator = q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void>*; _Allocator = std::allocator<q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void> >]’
/usr/include/c++/5.3.0/bits/vector.tcc:422:8:   required from ‘void std::vector<_Tp, _Alloc>::_M_emplace_back_aux(_Args&& ...) [with _Args = {q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void>}; _Tp = q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void>; _Alloc = std::allocator<q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void> >]’
/usr/include/c++/5.3.0/bits/vector.tcc:101:23:   required from ‘void std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void>}; _Tp = q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void>; _Alloc = std::allocator<q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void> >]’
/usr/include/c++/5.3.0/bits/stl_vector.h:932:21:   required from ‘void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void>; _Alloc = std::allocator<q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void> >; std::vector<_Tp, _Alloc>::value_type = q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void>]’
/home/a4z/tmp/q/libs/q/src/lib.cpp:37:52:   required from here
/usr/include/c++/5.3.0/type_traits:1119:12: error: invalid use of incomplete type ‘struct std::is_constructible<q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void>, q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void>&&>’
     struct __is_move_constructible_impl<_Tp, true>
            ^
/usr/include/c++/5.3.0/type_traits:1089:12: note: declaration of ‘struct std::is_constructible<q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void>, q::detail::any_function<void(), std::integral_constant<bool, true>, std::integral_constant<long unsigned int, 128ul>, void>&&>’
     struct is_constructible
            ^
libs/q/CMakeFiles/q.dir/build.make:86: recipe for target 'libs/q/CMakeFiles/q.dir/src/lib.cpp.o' failed
make[2]: *** [libs/q/CMakeFiles/q.dir/src/lib.cpp.o] Error 1
make[2]: Leaving directory '/home/a4z/tmp/q/buildDebug'
CMakeFiles/Makefile2:85: recipe for target 'libs/q/CMakeFiles/q.dir/all' failed
make[1]: *** [libs/q/CMakeFiles/q.dir/all] Error 2
make[1]: Leaving directory '/home/a4z/tmp/q/buildDebug'
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

so please open a communication channel so that we can fix so small issues on the fly, mail works excellent for me, but do you prefer slack, do I need an invitation for slack?

grantila commented 7 years ago

Hi,

You just need a slack account I think (or link it to your google account).

Anyhow, I'm just in the middle of getting q to build with both GCC and MSVC after having only used clang for quite a long time, and I realise that GCC 5 will not work whatsoever. It's pretty far from C++11 compliant. I've just gotten it to compile with GCC6 (although with huge warning outputs which are bogus and known to the GCC developers since 6.1, also there in 6.2 - haven't tested with 6.3).

So, you'll need clang/llvm or GCC 6 right now. It's a bit sad, but I really don't think this is my fault... C++11 support is still generally not very good with most compilers.

I still need to work on packaging q, and I'll ensure this works smooth for .deb. That should mean that it's relatively easy to build and package it with other package managers too.

I have a lot more struggle with MSVC though...

a4z commented 7 years ago

that you will have more issues with MSVC is clear. I will test with gcc 6 / clang 3.9 tomorrow and tet with clang 3.8 maybe later this evening

if you do not plan to support compiler < 6.x than there is no need to hurry with packaging, since it will take several years to see distributions coming with it. except Arch and maybe Fedora.

therefore support of 5.3 should possible be on your feature list (Ubuntu 16.04 LTS. RHEL/CentOS 7 with the latest dev-toolset, and of course the most important of all, Slackware!) I can have a look what clang is more c++11 complaint than gcc. To tell you the truth, I have some doubts that this is the case, but I am talking about clang, not clang on mac, which might have some extensions to what I use on Linux.

you might also thing about turning on C++14, no need to restrict to C++11, except you plan support for gcc 4.8.x.

ad Slack, I have a Slack account, since I am in 2 groups, and tried to log in, but it did not work. will try it again later this evening.

grantila commented 7 years ago

Seems like slack won't allow open chats, so I'll drop it...

My experience is that MSVC has had similar kinds of bugs as GCC in the past, e.g. certain complex noexcept statements causes ICE in both GCC and MSVC. Perhaps, when I've managed to make MSVC work, there won't be too much hassle to get GCC 5.3 to compile either.

grantila commented 7 years ago

Hours of pain later it compiles with 5.4 (I hope 5.3 as well), so please try again!

grantila commented 7 years ago

But beware, on a 64-bit machine when linking, GCC5 seems to consume about 4 GiB of ram while linking, GCC6 consumes 5 GiB. I guess compilers still don't like templates.

a4z commented 7 years ago

excellent and respect @grantila , but I hope you got some hours of sleep.

will try 5.3 in the evening, my Slackware notebook has 8 gig of ram, so this should be no problem. will try to use gold for linking, this might work better

builds now with gcc 6.2, but the warnings are of course extreme. don't think that these are that many. it seems to be mostly the same and the one I see most is triggered from -Wplacement-new. This flag is new in gcc, and actually pretty useful. I think clang does not know it and does not have a corresponding check. Are you sure this is a compiler bugs? If the compiler says something has size 160 but only 56 are given, I would believe the compiler.

However, this is in no relation from me if looking at the CMake files, if it builds, it builds, and there is something to install. If it's OK for you I can give it a look and maybe start make some suggestions for the cmake files ?

a4z commented 7 years ago

5.3 doesn't work but that's less important 5.4 works, that is important because of Ubuntu 16.04

I suggest you make some image change for libq. it is a modern C++14 and above library, requires therefore a decent new compiler. This will also make you live more easy, since this archaic 5 year old C++11 misses really some features that are available in C++14. Anyhow, I close this issue now since this is a good enough base for now.

grantila commented 7 years ago

Regarding the placement new detection, it's fantastic I agree, but I do think my code is correct and that I ended up with this bug, fixed in GCC 7.0 (and backported to 6.x, although I don't know if that's the x you and I are using): https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71306

C++14 does make sense, especially since it's kind of a bugfix version to C++11, however, I'll probably start using more of the 14 features and then have even more problems making it work well with clang, GCC and MSVC, especially the latter. Having made it this far, only requiring 11 is great for compatibility and portability, perhaps less so for the image ;)