abb_librws icon indicating copy to clipboard operation
abb_librws copied to clipboard

Set C++11 compile flag

Open sriharshav opened this issue 6 years ago • 5 comments

sriharshav avatar Aug 26 '18 01:08 sriharshav

Can you provide a bit of context? C++11 is not used in this package (yet, iirc), so that flag would seem to be unnecessary.

If you need it for some downstream package, I would suggest to set it there.

gavanderhoorn avatar Aug 26 '18 09:08 gavanderhoorn

I tried to compile it on aarch64 platform with Linux for Tegra

When I tried to compile Poco installation based on ppa build failed as Poco/Net/WebSocket.h was missing.

echo "deb http://ppa.launchpad.net/gezakovacs/poco/ubuntu xenial main" >> /etc/apt/sources.list.d/gezakovacs-poco.list

Then I compiled current stable version of Poco poco-1.9.0-release from source. This version requires C++11 std.

Thus when linking with Poco, without C++11 I envounter following error

In file included from /usr/include/c++/5/type_traits:35:0,
                 from /usr/local/include/Poco/Alignment.h:21,
                 from /usr/local/include/Poco/Foundation.h:111,
                 from /usr/local/include/Poco/XML/XML.h:23,
                 from /usr/local/include/Poco/SAX/InputSource.h:21,
                 from /media/nvidia/data/harsha/rws/abb_librws/src/rws_client.cpp:39:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support \

And thus to link with Poco current stable release proposing to set standard to C++11. Also check POCO 2.0 goals

sriharshav avatar Aug 26 '18 09:08 sriharshav

@sriharshav wrote:

I tried to compile it on aarch64 platform with Linux for Tegra

That is not a platform that we currently explicitly target with this library, so please be prepared to encounter some issues.

When I tried to compile Poco installation based on ppa build failed as Poco/Net/WebSocket.h was missing.

echo "deb http://ppa.launchpad.net/gezakovacs/poco/ubuntu xenial main" >> /etc/apt/sources.list.d/gezakovacs-poco.list

Which is not surprising, as that PPA only builds for amd64 and i386 (see here).

Then I compiled current stable version of Poco poco-1.9.0-release from source. This version requires C++11 std.

[..]

And thus to link with Poco current stable release proposing to set standard to C++11. Also check POCO 2.0 goals

We currently only test against Poco 1.7.x, so issues with newer Poco versions are expected.

If Poco requires C++11, it should set that and export that setting. I'd rather see whether the Poco CMake infrastructure exports something like that than hard-coding the flag in our build script.

Could you check whether that is the case?

gavanderhoorn avatar Aug 26 '18 10:08 gavanderhoorn

We currently only test against Poco 1.7.x, so issues with newer Poco versions are expected.

That wasn't evident from

POCO C++ Libraries (>= 1.4.3 due to WebSocket support)

And about Poco exporting C++11

If Poco requires C++11, it should set that and export that setting. I'd rather see whether the Poco CMake infrastructure exports something like that than hard-coding the flag in our build script.

Could you check whether that is the case?

PocoConfig.cmake not exporting CMAKE_CXX_STANDARD though 1.8.x is last major non-c++11 release

Agree that hard-coding a flag to meet downstream requirements is not a good practice.

sriharshav avatar Aug 26 '18 18:08 sriharshav

I'm not against fixing up our side of the CMakeLists.txt if it's needed but I'd like to make sure we also export this flag to downstream consumers.

gavanderhoorn avatar Oct 31 '18 14:10 gavanderhoorn