Closed yaira24 closed 5 years ago
-Werror=conversion
is not enabled by default on GCC 8. What's your compiler version and how did you invoke it?
I just built fine using master on Ubuntu 16.04.
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10)
Although my version of boost is 1.67.
g++ -v "gcc version 6.4.0 20180424 (Ubuntu 6.4.0-17ubuntu1~16.04)" I invoke like in the instructions "How to build for Linux" cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0 make
I get the same "conversion to ... from ... may alter its value" errors as you with boost 1.68 if I compile with -Werror=conversion
. Did you ever set that flag and did you try cleaning the build folder and running again?
In addition, you get "cc1plus: error: unrecognized command line option ‘-Wno-format-truncation’ [-Werror]", which looks a lot like the GCC issue described here, although GCC 6 should not be affected.
https://dev.azure.com/vclibs/cpprestsdk/_build/results?buildId=123&view=logs -- suggests otherwise?
I do not have 1.65.1 boost to compile past 1% (I got to 13% with another issue), but I tried to use your cmake invocation and it built with my config. I did have to point to my openssl was the only change I made to the invocation.
As per hrantzsch's comment did you ever set the -Werror=conversion
flag or try cleaning the build folder and running again.
I have noticed the cc1plus error is a bit of red herring. It only seems to how if you have a compilation error. Otherwise it seems suppressed. Not sure if that article also states that as well.
BTW, the oneysue I did run into which I'll have to look into is this:
[ 13%] Building CXX object Release/src/CMakeFiles/cpprest.dir/websockets/client/ws_client_wspp.cpp.o
/tmp/cpprestsdk/Release/src/websockets/client/ws_client_wspp.cpp:46:46: fatal error: websocketpp/config/asio_client.hpp: No such file or directory
compilation terminated.
Release/src/CMakeFiles/cpprest.dir/build.make:542: recipe for target 'Release/src/CMakeFiles/cpprest.dir/websockets/client/ws_client_wspp.cpp.o' failed
@BillyONeal Ubuntu is actually broken now due to websockets. Is there now some dependency required for websocketpp? It seem that this is missing
https://github.com/zaphoyd/websocketpp/tree/master/websocketpp/config
It would sort of be nice if we're not having to pull in these items ourselves. It looks like azure-pipelines.yml is pulling it in. So does this mean we now need to build and install in /usr/local?
As an FYI I did look at documentation ... no mention of this requirement that I could find. And the last successful build I had using master was 4 days ago.
@yaira24
Hmmmm perhaps those instructions are broken. On the build machines we are presently doing:
sudo apt-get update sudo apt-get install -y libboost-atomic-dev libboost-thread-dev libboost-system-dev libboost-date-time-dev libboost-regex-dev libboost-filesystem-dev libboost-random-dev libboost-chrono-dev libboost-serialization-dev libwebsocketpp-dev openssl libssl-dev ninja-build mkdir build.debug cd build.debug cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug .. ninja
(With of course debug and Debug replaced with release and Release for release bits.... :) )
There's no reason make shouldn't work if Ninja does though admittedly I haven't been testing that.
@mobileben
As per hrantzsch's comment did you ever set the -Werror=conversion flag or try cleaning the build folder and running again.
No, but given that our CMakeLists.txt don't say -Werror=conversion it seems problems caused by that would be with whatever is setting that flag? It's certainly working in Pipelines (running Ubuntu 16.04) and locally (18.04).
BTW, the oneysue I did run into which I'll have to look into is this: fatal error: websocketpp/config/asio_client.hpp: No such file or directory
That means that either (1) you need to install libwebsocketpp-dev, or (2) you need to git submodule update --init
. Previously we had an older copy of websocketspp checked in which resulted in confusion where if changes were made you'd accidentally edit upstream bits. I recently deleted the checked in copy in favor of a submodule to make it clear what is actually part of cpprestsdk and what is an upstream dependency.
We have always looked for this dependency on the system, and if that's not available, used that checked in copy.
@BillyONeal I'll install it later today and build. Just curious shouldn't the CMakeFiles be adjusted so it would at least notify if a dependency doesn't exist?
Mainly looking to make it easier for folks to use. Esp if they are currently using and then it suddenly won't build when they move to master. BTW, I've built, previously to try and discern why yaira24 was having issues, but it was building for me. I updated master and rebuilt today only to try and use his/her cmake invocation to see if that had an influence.
@mobileben It's likely that it was indeed broken -- I know the initial merge of the compression feature broke it, for example. The fact that so much broke was the motivation for adding Pipelines CI for platforms we care about. Still trying to figure out how to get Android and iOS builds working there....
I arrived here by searching for websocketpp. This new dependency does not seem to be documented yet, and my build (on Mac and CentOS) is broken.
Are we supposed to install https://github.com/zaphoyd/websocketpp manually? Also, I would appreciate an option to disable websocketpp during the build.
Anyway, cloning https://github.com/zaphoyd/websocketpp and adding it to CPLUS_INCLUDE_PATH solved my problem and made everything work now.
@adah1972: If your distro does not provide a package for websocketpp, you can get it using git:
git submodule update --init Release/libs/websocketpp
And then websocketpp appears as in the past inside the cpprestsdk git checkout, however at a newer version of websocketpp
I did not notice the submodule existed already. Good to know. (Since Git does not check out submodules automatically, it still needs to be documented.)
I'm interpreting the results of this thread as a request to spit out a better error message on configure :)
I am going to take a look at this in a day or two (ie. look at the cmake files and see about flagging the the non-existence case). I think it is sufficient if at the very least you're alerted on the config versus whilst compiling.
@BillyONeal Mostly true but not completely. The "How to build" wiki pages should probably mention git submodule update --init …
or similar.
Yeah, the wiki pages are super duper out of date at this point.
Resolved by https://github.com/Microsoft/cpprestsdk/pull/930
alon@viki:~/repos/casablanca/Release/build.debug$ make Scanning dependencies of target cpprest [ 1%] Building CXX object src/CMakeFiles/cpprest.dir/http/client/http_client.cpp.o In file included from /home/alon/repos/voiceengine/voiceengine/voiceengine/boost_1_65_1/boost/asio/detail/eventfd_select_interrupter.hpp:80:0, from /home/alon/repos/voiceengine/voiceengine/voiceengine/boost_1_65_1/boost/asio/detail/select_interrupter.hpp:25, from /home/alon/repos/voiceengine/voiceengine/voiceengine/boost_1_65_1/boost/asio/detail/epoll_reactor.hpp:29, from /home/alon/repos/voiceengine/voiceengine/voiceengine/boost_1_65_1/boost/asio/detail/reactor.hpp:21, from /home/alon/repos/voiceengine/voiceengine/voiceengine/boost_1_65_1/boost/asio/detail/impl/task_io_service.ipp:24, from /home/alon/repos/voiceengine/voiceengine/voiceengine/boost_1_65_1/boost/asio/detail/task_io_service.hpp:198, from /home/alon/repos/voiceengine/voiceengine/voiceengine/boost_1_65_1/boost/asio/impl/io_service.hpp:71, from /home/alon/repos/voiceengine/voiceengine/voiceengine/boost_1_65_1/boost/asio/io_service.hpp:767, from /home/alon/repos/voiceengine/voiceengine/voiceengine/boost_1_65_1/boost/asio/ssl/context.hpp:26, from /home/alon/repos/voiceengine/voiceengine/voiceengine/boost_1_65_1/boost/asio/ssl.hpp:19, from /home/alon/repos/casablanca/Release/include/cpprest/http_client.h:53, from /home/alon/repos/casablanca/Release/src/pch/stdafx.h:104, from /home/alon/repos/casablanca/Release/src/http/client/http_client.cpp:16: /home/alon/repos/voiceengine/voiceengine/voiceengine/boost_1_65_1/boost/asio/detail/impl/eventfd_select_interrupter.ipp: In member function ‘void boost::asio::detail::eventfd_select_interrupter::interrupt()’: /home/alon/repos/voiceengine/voiceengine/voiceengine/boost_1_65_1/boost/asio/detail/impl/eventfd_select_interrupter.ipp:122:23: error: conversion to ‘int’ from ‘ssize_t {aka long int}’ may alter its value [-Werror=conversion] int result = ::write(writedescriptor, &counter, sizeof(uint64_t));