Repository navigation
Open
Description
I'm trying to create a doc for tensorflow.
First, it's hard to use a dummy gcc on Bazel. (you need to change a lot of things)
And, the simple scripts is not work for Bazel's complicated build command (like
/home/yangff/woboq_codebrowser-master/scripts/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wl,-z,-relro,-z,now -B/home/yangff/woboq_codebrowser-master/scripts -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-canonical-system-headers -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -MD -MF bazel-out/local-py3-opt/bin/tensorflow/core/kernels/_objs/pooling_ops/tensorflow/core/kernels/avgpooling_op.pic.d '-frandom-seed=bazel-out/local-py3-opt/bin/tensorflow/core/kernels/_objs/pooling_ops/tensorflow/core/kernels/avgpooling_op.pic.o' -fPIC -DEIGEN_MPL2_ONLY -iquote . -iquote bazel-out/local-py3-opt/genfiles -iquote external/eigen_archive -iquote bazel-out/local-py3-opt/genfiles/external/eigen_archive -iquote external/bazel_tools -iquote bazel-out/local-py3-opt/genfiles/external/bazel_tools -iquote external/protobuf -iquote bazel-out/local-py3-opt/genfiles/external/protobuf -iquote external/com_googlesource_code_re2 -iquote bazel-out/local-py3-opt/genfiles/external/com_googlesource_code_re2 -iquote external/farmhash_archive -iquote bazel-out/local-py3-opt/genfiles/external/farmhash_archive -iquote external/gif_archive -iquote bazel-out/local-py3-opt/genfiles/external/gif_archive -iquote external/highwayhash -iquote bazel-out/local-py3-opt/genfiles/external/highwayhash -iquote external/jpeg_archive -iquote bazel-out/local-py3-opt/genfiles/external/jpeg_archive -iquote external/png_archive -iquote bazel-out/local-py3-opt/genfiles/external/png_archive -iquote external/zlib_archive -iquote bazel-out/local-py3-opt/genfiles/external/zlib_archive -isystem external/eigen_archive -isystem bazel-out/local-py3-opt/genfiles/external/eigen_archive -isystem external/bazel_tools/tools/cpp/gcc3 -isystem external/protobuf/src -isystem bazel-out/local-py3-opt/genfiles/external/protobuf/src -isystem external/farmhash_archive -isystem bazel-out/local-py3-opt/genfiles/external/farmhash_archive -isystem external/gif_archive -isystem bazel-out/local-py3-opt/genfiles/external/gif_archive -isystem external/highwayhash -isystem bazel-out/local-py3-opt/genfiles/external/highwayhash -isystem external/jpeg_archive -isystem bazel-out/local-py3-opt/genfiles/external/jpeg_archive -isystem external/png_archive -isystem bazel-out/local-py3-opt/genfiles/external/png_archive -isystem external/zlib_archive -isystem bazel-out/local-py3-opt/genfiles/external/zlib_archive -fno-exceptions -DEIGEN_AVOID_STL_ARRAY -pthread -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c tensorflow/core/kernels/avgpooling_op.cc -o bazel-out/local-py3-opt/bin/tensorflow/core/kernels/_objs/pooling_ops/tensorflow/core/kernels/avgpooling_op.pic.o)
)
I've a idea for it, use --subcommands and recover compile info from it. I'm trying this and if I success I will post it here.
Metadata
Metadata
Assignees
Labels
No labels
Activity
Yangff commentedon Oct 11, 2016
ogoffart commentedon Oct 13, 2016
I have no experience with Bazel.
Googling a bit i found some other people wanting to generate the compile_commands: for example https://gist.github.com/bsilver8192/0115ee5d040bb601e3b7
and cppit/jucipp#250
It would be nice if bazel could support that
However, it might be easier to do the build without compilation_command.json
Instead of passing the
-bargument tocodebrowser_generator, you can pass the compiler arguments in the command line after--So you can use simple something like this:
wangkuiyi commentedon Dec 6, 2016
Hi @ogoffart ,
I am wondering how did you get that very long line of compiler arguments for Tensorflow?
Thanks!
Yi
Yangff commentedon Dec 7, 2016
@wangkuiyi
I'm using bazel's verbose logs (with
--subcommands) and that script run bazel with--experimental_action_listener=//tools/actions:generate_compile_commands_listenerwangkuiyi commentedon Jun 8, 2017
Hi @Yangff , Thank you for the hint and the awesome work at http://yangff.coding.me/tf-doc/codebrowser/codebrowser/tensorflow !
But when I tried to follow your hint, I got an error complaining that the rule
//tools/actions:generate_compiler_commands_listenercouldn't be found. And I checked that there isn't a directoryactionsin~/work/tensorflow/tools/.siddharthab commentedon Oct 9, 2017
If this is still an issue, you may also try out https://github.com/grailbio/bazel-compilation-database as an alternative.