C++14 in TensorFlow

235 views
Skip to first unread message

Günhan Gülsoy

unread,
Sep 9, 2019, 1:12:39 PM9/9/19
to SIG Build, TensorFlow Developers
Hi all,
LLVM is now using C++14 features in their codebase. As TF depends on LLVM, we have decided to move forward with allowing usage of C++14 in TF codebase. We will still reject any changes that use C++17 features. Unfortunately, this may require you to update the compilers/toolchains you are using to build TF if you are building TF from sources.

Please feel free to reach out if you have any questions.
Gunhan

王振华

unread,
Sep 9, 2019, 10:00:10 PM9/9/19
to TensorFlow Developers, bu...@tensorflow.org
I think it will be very helpful if the official building documents can have a section (Requirements for example) to describe the recommended toolchains and the versions rather than list the version internal toolchain (GCC 4.8 for example, with which public version people cannot build TF) that the community doesn't hold :)

在 2019年9月10日星期二 UTC+8上午1:12:39,Günhan Gülsoy写道:

Günhan Gülsoy

unread,
Sep 10, 2019, 1:18:47 AM9/10/19
to 王振华, Billy Lamberta, TensorFlow Developers, SIG Build
Thanks for your feedback!
We should definitely update the requirements section with minimum toolchains requirement.

The existing list is just to express what we tested the builds with, as the section name suggests:
Moreover, none of the build environments listed are internal, and we build on top of public Ubuntu, MacOS and Windows images.


--
You received this message because you are subscribed to the Google Groups "TensorFlow Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/developers/d32b753b-4ec2-42ea-9f90-0c52b46c6dea%40tensorflow.org.

王振华

unread,
Sep 10, 2019, 1:54:45 AM9/10/19
to Günhan Gülsoy, Billy Lamberta, TensorFlow Developers, SIG Build
Thank you for the quick response Günhan!

Maybe my machine wrongly configured with GCC 4.8 such that it cannot build TF these days ever since MLIR requires C++14 in TF. I had checked that C++14 is not well supported in GCC until 5, and https://www.tensorflow.org/install/source#tested_build_configurations states that GCC 4.8 was used. I had also opened an issue, in which someone stated that the GCC 4.8 seems including back-port patches, and some other said that it was GCC 5.4.

Anyway, I am mean to argue about this, but it could be really helpful if the toolchain related build environment setup can have a dedicated section, like many open source projects, like suggested three weeks ago in that issue.


Best regards
Zhenhua (aka jackwish)


Günhan Gülsoy <gu...@google.com> 于2019年9月10日周二 下午1:18写道:

Günhan Gülsoy

unread,
Sep 10, 2019, 2:01:42 AM9/10/19
to 王振华, Billy Lamberta, TensorFlow Developers, SIG Build
As far as I know, MLIR highly depends on LLVM, so it won't be compilable with gcc 4.8 these days.
You are definitely right about when C++14 support landed in GCC.
Therefore, I do not expect 1.15, current 2.0 or master branches to be able to build with GCC 4.8

However, as the page suggests 1.14 or older branches should still be able to build with gcc 4.8

Robison, Clayne B

unread,
Sep 10, 2019, 4:40:18 AM9/10/19
to Günhan Gülsoy, 王振华, Billy Lamberta, TensorFlow Developers

Hi Gunhan,

Per https://www.tensorflow.org/install/source#bazel_build_options,what are the official TensorFlow packages being built with for 1.15 and 2.0? 
 
Also, can we assume the --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0 is no longer necessary?
 

Clayne

--
To unsubscribe from this group and stop receiving emails from it, send an email to build+un...@tensorflow.org.

Manuel Klimek

unread,
Sep 10, 2019, 5:45:29 AM9/10/19
to Robison, Clayne B, Günhan Gülsoy, 王振华, Billy Lamberta, TensorFlow Developers
On Tue, Sep 10, 2019 at 10:40 AM Robison, Clayne B <clayne.b...@intel.com> wrote:

Hi Gunhan,

Per https://www.tensorflow.org/install/source#bazel_build_options,what are the official TensorFlow packages being built with for 1.15 and 2.0? 
 
Also, can we assume the --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0 is no longer necessary?
What do you mean with "necessary"? Due to manylinux requirements the pypi packages do use _GLIBCXX_USE_CXX11_ABI=0; this is not a requirement for TensorFlow, but a requirement for manylinux compliant packages.

Clayne B Robison

unread,
Sep 11, 2019, 3:20:53 AM9/11/19
to TensorFlow Developers, wangzh...@gmail.com, bl...@google.com, bu...@tensorflow.org
Actually, 2.0.0-rc0 builds are doing just find with gcc4.8 because the `-std=c++14` copts stuff in third_party/mlir/BUILD apparently didn't make it into the r2.0 branch before it was cut.
To unsubscribe from this group and stop receiving emails from it, send an email to devel...@tensorflow.org.

Mehdi Amini

unread,
Sep 24, 2019, 4:23:32 AM9/24/19
to Günhan Gülsoy, 王振华, Billy Lamberta, TensorFlow Developers, SIG Build
T

On Mon, Sep 9, 2019 at 10:18 PM 'Günhan Gülsoy' via TensorFlow Developers <devel...@tensorflow.org> wrote:
Thanks for your feedback!
We should definitely update the requirements section with minimum toolchains requirement.

The existing list is just to express what we tested the builds with, as the section name suggests:
Moreover, none of the build environments listed are internal, and we build on top of public Ubuntu, MacOS and Windows images.

The table here lists "clang from xcode" without stating which Xcode version.

Also, the LLVM and MLIR requirements (which puts a minimum on TF) are documented here: https://llvm.org/docs/GettingStarted.html#host-c-toolchain-both-compiler-and-standard-library

-- 
Mehdi


 


On Mon, Sep 9, 2019 at 7:00 PM 王振华 <wangzh...@gmail.com> wrote:
I think it will be very helpful if the official building documents can have a section (Requirements for example) to describe the recommended toolchains and the versions rather than list the version internal toolchain (GCC 4.8 for example, with which public version people cannot build TF) that the community doesn't hold :)

在 2019年9月10日星期二 UTC+8上午1:12:39,Günhan Gülsoy写道:
Hi all,
LLVM is now using C++14 features in their codebase. As TF depends on LLVM, we have decided to move forward with allowing usage of C++14 in TF codebase. We will still reject any changes that use C++17 features. Unfortunately, this may require you to update the compilers/toolchains you are using to build TF if you are building TF from sources.

Please feel free to reach out if you have any questions.
Gunhan

--
You received this message because you are subscribed to the Google Groups "TensorFlow Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/developers/d32b753b-4ec2-42ea-9f90-0c52b46c6dea%40tensorflow.org.

--
You received this message because you are subscribed to the Google Groups "TensorFlow Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@tensorflow.org.

Günhan Gülsoy

unread,
Oct 1, 2019, 8:27:50 PM10/1/19
to Mehdi Amini, Amit Patankar, 王振华, Billy Lamberta, TensorFlow Developers, SIG Build
+Amit Patankar 
Could you look into this?
We should include the version of xcode version we build with.

Amit Patankar

unread,
Oct 2, 2019, 4:37:13 AM10/2/19
to Günhan Gülsoy, Goldie Gadde, Mehdi Amini, 王振华, Billy Lamberta, TensorFlow Developers, SIG Build
I've added comments on cl/272228919 from +Goldie Gadde to include the xCode version which is 10.1 and the GCC from the toolchain which is 7.3.1.

-Amit

Reply all
Reply to author
Forward
0 new messages