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

c++14 upgrade #847

Closed
aautushka opened this issue Apr 14, 2018 · 23 comments
Closed

c++14 upgrade #847

aautushka opened this issue Apr 14, 2018 · 23 comments
Labels
2d Developing Status indicating currently designing and developing a solution 3c Enhancement Classification indicating a change to the functionality of the existing imlementation 5a Docs Needed Status specific to Documentation indicating the need for proper documentation to be added 6 Build Impact flag identifying the build process

Comments

@aautushka
Copy link

The project extensively uses C++11 features and compiles with C++11 support. But it's 2018 now and I frankly don't see why not upgrade at least to C++14 (or even C++17). And it's quite easy to do: change a couple of cmake files and perhaps a few compiler warnings. The real question: are there any serious enough reasons to stick to C++11?

We can do the upgrade and testing ourselves, if the community agrees and provides the list of desired platforms/compilers.

@abitmore
Copy link
Member

@aautushka see #618 for more discussion.

@abitmore
Copy link
Member

We can gather some info first, to see how requiring C++14 or even C++17 will affect people involved, and how to solve the issues (update documents).

Platform/tools I'm using:

  • Ubuntu 16.04 with shipped GCC, boost 1.58 and other libs
  • Windows 10 with VS2015 update 1, for building windows binaries. The binaries will be run in Windows 7 or Windows 10.

If these tools support C++14, I'm totally fine. If not, need to make a document about how to upgrade.

@aautushka
Copy link
Author

GCC 5.4 from Ubuntu 16.04 does support C++14.
VS2015 seems to support some of the C++14 features (according to Microsoft's documentation, not sure though how true is that).
Additionally, I think we should be totally fine with Apple, since the current Xcode provides a C++17 compatible compiler.

Personally, I am working mostly with Debian 9/GCC 6.3/GCC7.2/Boost 1.63, understandably my setup works perfectly with C++14.

As far as Windows goes, we could go to some lengths ensuring its continuing operation, but hey how important is Windows for the community? Any benefits to using Windows? Just interested.

@abitmore
Copy link
Member

Windows is important

  • Aex.com exchange is using our pre-built windows binaries.
  • many Chinese users run node by their own in Windows machines to reduce load on public API servers.

@bitshares bitshares deleted a comment Apr 15, 2018
@pmconrad
Copy link
Contributor

The real question: are there any serious enough reasons to stick to C++11?

The other real question is: what reasons are there to move to C++14?

@abitmore
Copy link
Member

The other real question is: what reasons are there to move to C++14?

Perhaps there are new features writing in C++14 already or planed to be written, that are wanted to be merged into the code base?

@aautushka
Copy link
Author

aautushka commented Apr 18, 2018

The other real question is: what reasons are there to move to C++14?

Firstly, C++14 allows for cleaner code and better coding practices. Secondly, we use it extensively in our development and want to keep using it, including possible future contributions. Besides, updating the standard is not a rocket science really, just a tiny fix, so why not?

@pmconrad
Copy link
Contributor

so why not?

For a blockchain, decentralization is an important goal. We should therefore make it easy to build and run the code on a wide variety of systems, even on old ones.

if the community agrees and provides the list of desired platforms/compilers.

Good question. I think linux systems can be expected to have gcc-5 or newer. Don't know about Mac/Windows compilers.

@abitmore abitmore added 2a Discussion Needed Prompt for team to discuss at next stand up. 2b Gathering Requirements Status indicating currently refining User Stories and defining Requirements labels Apr 26, 2018
@jmjatlanta
Copy link
Contributor

jmjatlanta commented Apr 30, 2018

As soon as a C++14 feature is used (or in the case of many '14 changes, a certain behavior is expected), we have to draw a line and say if you want to compile version y, you must have a C++14 compliant compiler (or at least one that includes the features we need).

When we draw that line, it will often exclude a segment of the "market". The longer we wait, the smaller that market is.

I would guess that it is safe to say that the majority of mac users are at or near the latest releases of the OS and its compilers (they're free, why not?).

Windows users are a different story, and to be honest I haven't been keeping up over the last 3 years. I do know that I've had trouble compiling Bitshares with VS2017 due to how the compiler handles templates. I've heard that VS2015 doesn't have the same problem, but it is not fully C++14 compatible. So mandating some C++14 features may cause all Windows users to wait until the template problem is sorted before they can use the product.

@ryanRfox ryanRfox added 3c Enhancement Classification indicating a change to the functionality of the existing imlementation 6 Build Impact flag identifying the build process 0 Help Wanted Notification to Core Team that Assignee is seeking assistance, but is able to proceed and removed 2a Discussion Needed Prompt for team to discuss at next stand up. labels May 24, 2018
@pmconrad
Copy link
Contributor

The other real question is: what reasons are there to move to C++14?

Found one: C++14 can move-capture stuff in a lambda-expression.

@ryanRfox
Copy link
Contributor

I'm going to add this into To do on our existing sprint so we invest some time into discussions about C++ 17 (or C++ 14).

@jmjatlanta jmjatlanta self-assigned this Mar 22, 2019
This was referenced Mar 22, 2019
@jmjatlanta jmjatlanta removed their assignment Apr 11, 2019
@jmjatlanta
Copy link
Contributor

PRs are done to implement this, but there is no consensus as to if we should, and to what degree. I will unassign myself to this ticket and wait for consensus.

@pmconrad
Copy link
Contributor

We're going to discuss (and hopefully decide) this after Easter.

@xloem
Copy link
Contributor

xloem commented Apr 21, 2019

I'd like to add a note that the installed headers don't compile on c++17 atm. There are symbol clashes with the std:: namespace. Building with c++17 would catch things like that.

@jmjatlanta
Copy link
Contributor

BitShares Core will now support c++14 features. The build scripts will be adjusted, probably in the release following 3.2.0.

@abitmore abitmore added this to the 3.2.0 - Feature Release milestone Apr 23, 2019
@pmconrad
Copy link
Contributor

@jmjatlanta Nathan is going to bump fc with the c++14 changes in #1737 - are there any changes required in core for this?

@pmconrad pmconrad added 2d Developing Status indicating currently designing and developing a solution and removed 0 Help Wanted Notification to Core Team that Assignee is seeking assistance, but is able to proceed 2b Gathering Requirements Status indicating currently refining User Stories and defining Requirements labels Apr 27, 2019
@pmconrad
Copy link
Contributor

There are references to c++11 still in both CMakeLists.txt and libraries/fc/CMakeLists.txt.

@jmjatlanta
Copy link
Contributor

There are references to c++11 still in both CMakeLists.txt and libraries/fc/CMakeLists.txt.

I will fix those as part of #1668

@jmjatlanta
Copy link
Contributor

Note for Visual Studio 2019: This newly released compiler only works with Boost 1.70, as its compiler profile was not included in Boost version 1.69.

Boost 1.70 causes problems with BitShares Core on all platforms (mainly around websocketpp).

Therefore, if you want to use Visual Studio 2019 before we work out the issues with Boost 1.70, you must compile Boost 1.69 on an older compiler that is binary-compatible with Visual Studio 2019. Visual Studio 2017 seems to work. Afterwards, everything else can be compiled with Visual Studio 2019.

Based on the above, I believe we need to document that until the above is fixed, the maximum supported version of Visual Studio is Visual Studio 2017, and the maximum version of Boost is 1.69.

@abitmore abitmore added the 5a Docs Needed Status specific to Documentation indicating the need for proper documentation to be added label May 21, 2019
@abitmore
Copy link
Member

As mentioned in previous message, docs are needed before closing this.

@abitmore
Copy link
Member

Will bump FC in #1695 .

@abitmore
Copy link
Member

Bumped FC in #1695.

Docs are still needed for closing this issue:

we need to document that ... the maximum supported version of Visual Studio is Visual Studio 2017, and the maximum version of Boost is 1.69.

@abitmore
Copy link
Member

Docs updated. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2d Developing Status indicating currently designing and developing a solution 3c Enhancement Classification indicating a change to the functionality of the existing imlementation 5a Docs Needed Status specific to Documentation indicating the need for proper documentation to be added 6 Build Impact flag identifying the build process
Projects
None yet
Development

No branches or pull requests

7 participants