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

Compiler error on 64bit ubuntu #141

Closed
chetgnegy opened this issue Dec 4, 2016 · 2 comments
Closed

Compiler error on 64bit ubuntu #141

chetgnegy opened this issue Dec 4, 2016 · 2 comments

Comments

@chetgnegy
Copy link

I am trying to build glog on 64 bit Ubuntu 16.04. I am getting this error

ERROR: /home/chetgnegy/.cache/bazel/_bazel_chetgnegy/703b9800778fef35edeb624f262556cf/external/glog/BUILD:6:1: C++ compilation of rule '@glog//:glog' failed: linux-sandbox failed: error executing command /home/chetgnegy/.cache/bazel/_bazel_chetgnegy/703b9800778fef35edeb624f262556cf/execroot/Source/_bin/linux-sandbox ... (remaining 95 argument(s) skipped).
external/glog/src/utilities.cc:247:2: error: #error "Must define __NR_gettid for non-x86 platforms"
 #error "Must define __NR_gettid for non-x86 platforms"
  ^
external/glog/src/utilities.cc: In function 'pid_t google::glog_internal_namespace_::GetTID()':
external/glog/src/utilities.cc:254:25: error: '__NR_gettid' was not declared in this scope
     pid_t tid = syscall(__NR_gettid);
                         ^
Target //ThirdParty/Google/GLog:GLog failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.443s, Critical Path: 0.35s

I am attempting to build with bazel using the BUILD file that was posted here:
#61

I would expect that this symbol would get defined at some point, I believe it is in unistd.h. Does anyone know what might be wrong?

@breakds
Copy link

breakds commented Feb 2, 2017

I ran into the same problem, and for this particular one, I think it comes from sys/syscall.h. You need to specify "-DHAVE_SYS_SYSCALL_H" in order to let glog include the correct syscall.h in Ubuntu 16.04.

@chetgnegy
Copy link
Author

Thank you so much. That fixed my problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants