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

Compiles with GCC 4.8.3 but find the headers under GCC 5 and reports an error #6971

Closed
medivh-x opened this issue Dec 20, 2018 · 4 comments
Closed
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Rules-CPP Issues for C++ rules under investigation

Comments

@medivh-x
Copy link

Description of the problem / feature request:

I used bazel's default host crosstools top to compile tensorflow. GCC version is 4.8.3. At compile time, bazel reports that the dependency declaration of the following header file could not be found.

  '/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h'
  '/usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h'
  '/usr/lib/gcc/x86_64-linux-gnu/5/include/stdint.h'

Under the /usr/lib/ GCC /x86_64-linux-gnu/ folder, there are the following files

4.8/
4.8.4 -> 4.8/
4.9/
4.9.3 -> 4.9/
5/

I'm sure these environmental variables were not set:

C_INCLUDE_PATH,
CPLUS_INCLUDE_PATH,
OBJC_INCLUDE_PATH

I also executed the

gcc-print-search-dirs 

and determined that the search path did not contain /usr/lib/gcc/x86_64-linux-gnu/5/

My question is, who searches for header files in this directory?
In bazel's default crosstool file,
I see the configuration

cxx_builtin_include_directory: "/usr/lib/gcc/"

This establishes a dependency on the header file, but does not specify the version under x86_64-linux-gnu,How is the final search path determined?
I don't want to restrict the version of GCC to dead. How should I deal with it? Please give me some Suggestions

What operating system are you running Bazel on?

0.19.2

@irengrig irengrig added team-Rules-CPP Issues for C++ rules untriaged labels Dec 20, 2018
@irengrig
Copy link
Contributor

/cc @hlopko

@medivh-x
Copy link
Author

medivh-x commented Dec 22, 2018

My problem is similar to this #4558 . Is there any solution now?

@hlopko
Copy link
Member

hlopko commented Dec 27, 2018

This is weird. Can you reproduce after calling bazel clean --expunge? It seems bazel is using gcc 5 to build, but has toolchain configured for gcc 4. What other cxx_builtin_include_directory entries are there in the CROSSTOOL cc_configure generated?

@hlopko hlopko added under investigation P3 We're not considering working on this, but happy to review a PR. (No assignee) and removed untriaged labels Dec 27, 2018
@medivh-x
Copy link
Author

This is caused by remote cache. The cache on the remote server uses 5.4.0 GCC. My problem is similar to this #4558

@medivh-x medivh-x closed this as completed Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Rules-CPP Issues for C++ rules under investigation
Projects
None yet
Development

No branches or pull requests

3 participants