--
To unsubscribe from this group and stop receiving emails from it, send an email to build+un...@tensorflow.org.
Forwarding to Manuel (though he's on OOO ATM).I believe we have a number of preconfigured toolchains for the build under google3/third_party/tensorflow/third_party/toolchains/preconfig/ but I'm not familiar with the details.This may be a good place to start:
On Mon, Aug 10, 2020 at 9:04 AM Günhan Gülsoy <gu...@google.com> wrote:Artem may have some information on this.On Sat, Aug 8, 2020 at 11:54 AM Andrew Marshall <planetma...@gmail.com> wrote:What's the best way to go about building tensorflow wtih clang and LLVM's libc++, for Linux platforms?Just changing CC=clang++ and `--copts=-stdlib=libc++` doesn't work due to differences in how clang (the C compiler) and clang++ (The C++ compiler) handle include paths.Is this something best handled with a toolchain - is there an existing similar toolchain (Android must be similar?)
Unfortunately I don't think I have enough information to help; can you give the error log? Generally, building with clang (cuda-clang) works. Using libc++ should generally work, as we use it internally, but I haven't tried externally, and it might need a bit of fiddling to get it right.
On Mon, 17 Aug 2020 at 10:29, Manuel Klimek <kli...@google.com> wrote:Unfortunately I don't think I have enough information to help; can you give the error log? Generally, building with clang (cuda-clang) works. Using libc++ should generally work, as we use it internally, but I haven't tried externally, and it might need a bit of fiddling to get it right.Hi Manuel - thanks for the reply.Apologies for the lack of info - here's what I've tried so far.Working with the current master (1. configure with default options.2. export CC=clang && bazel build -s --config=opt --config=libc++ --cxxopt=-stdlib=libc++ //tensorflow:tensorflow_ccThis fails on failing to find the STL include <iterator>
I've tried adding the libc++ includes explicitly with `-I` or `-isystem` but get "The include path '/usr/lib/llvm-10/include/c++/v1' references a path outside of the execution root"
Does /usr/bin/clang -c test.cc -std=c++14 -stdlib=libc++ works, if test.cc contains #include <iterator>?
I've tried adding the libc++ includes explicitly with `-I` or `-isystem` but get "The include path '/usr/lib/llvm-10/include/c++/v1' references a path outside of the execution root"Yea, that is the interesting part -- if clang -x c++ does not output the right paths here, they'll not be correctly included.Can you paste the output of/usr/bin/clang -E -x c++ - -v
Are you configuring with cuda or cpu only?
Ok, for the cuda toolchain I could tell you how to generate a patch, for the cc_configure toolchain looping in +Lukacs Berki to find the right person to explain how to configure libc++ in a way that figures out the right builtin-include-paths.
Having multiple instances of clang include headers suggests that it has not been installed correctly or there's something wrong with the set of packages you have installed.Clang's include path is somewhat special, and specifying it explicitly when clang didn't do it itself will put it in the wrong place in the search list and that will likely lead to more problems, some obvious, some not.I'd recommend figuring out which packages have installed those two copies of clang includes and figure out which one of them should be gone.`dpkg -S /usr/lib/clang/10.0.0` and `dpkg -S /usr/lib/llvm-10` should give you the names of the packages.You need the one from the package set that installed the clang binary you are using. Normally, I'd expect clang to be able to find its own headers, but it, apparently, didn't happen in your case.--Artem
I'll maybe try a docker image with a clean environment.
That would definitely have a better chance to work out of the box. That's what I usually use when I need to tinker with TF.--Artem
++ @Michael O'Connor (Deep Learning) @Cliff Woolley @Nathan Luehr
From: Andrew Marshall <planetma...@gmail.com>
Date: Friday, September 18, 2020 at 10:19 AM
To: Manuel Klimek <kli...@google.com>
Cc: Lukacs Berki <lbe...@google.com>, Artem Belevich <t...@google.com>, Günhan Gülsoy <gu...@google.com>, SIG Build <bu...@tensorflow.org>
Subject: Re: Build tensorflow with Clang and libc++ on Linux
|
External email: Use caution opening links or attachments |
--
We had this issue as well and I opened a report for that: https://github.com/tensorflow/tensorflow/issues/33975
A decent fix is
https://github.com/easybuilders/easybuild-easyconfigs/blob/develop/easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.1.0_fix-cuda-build.patch
which should work for your case as well.
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Dipl.-Inf. Alexander Grund Research Assistant Technische Universität Dresden Zentrum für Informationsdienste und Hochleistungsrechnen (ZIH) 01062 Dresden Tel.: +49 (351) 463-35982 E-Mail: alexand...@tu-dresden.de ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We had this issue as well and I opened a report for that: https://github.com/tensorflow/tensorflow/issues/33975
A decent fix is https://github.com/easybuilders/easybuild-easyconfigs/blob/develop/easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.1.0_fix-cuda-build.patch which should work for your case as well.