-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Having trouble compiling bazel from source locally on Redhat #1122
Comments
Can you try spelling out the full path to gcc (not using
|
@kchodorow This is the full path: /home/dkl524/jbang/gcc-4.8.5 I'm not sure if the following info would help but here it is! |
I mean: use the full path in the CROSSTOOL file's tool path that you customized. The CROSSTOOL isn't going to resolve |
@kchodorow Replacing ~ with full path worked! However, it led me to anther error . ERROR: /home/dkl524/jbang/bazel/src/main/cpp/util/BUILD:4:1: undeclared inclusion(s) in rule '//src/main/cpp/util:util': I checked that I have both '/home/dkl524/jbang/gcc-4.8.5/lib/gcc/x86_64-unknown-linux-gnu/4.8.5/include/stddef.h' and '/home/dkl524/jbang/gcc-4.8.5/include/getopt.h'. |
Generally this means that you have system includes in non-standard locations, so you'll need to add |
@kchodorow Thanks. That helped me get passed the error, but of course a new one. This one, I really can't seem to figure it out. ERROR: /home/dkl524/jbang/bazel/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/BUILD:107:1: error executing shell command: 'set -e;rm -rf bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libbootstrap_invalid_command_line_exception.jar.build_output bazel-out/host/bin/src/java_tools/build...' failed: bash failed: error executing command |
What may be causing this error? I've been having no luck at all. |
This means that the JVM running Bazel is running out of memory. A couple things you could try:
|
Thanks! But I thought 'build' should only work when Bazel is compiled and I'm still having difficulty compiling bazel from source. ERROR: No toolchain found for cpu 'piii'. Valid cpus are: [ The CROSSTOOL file from the fresh new clone had a default-toolchain with 'piii' as the cpu. This default-toolchain didn't exist in previous versions of Bazel. What is 'piii'? I tried compiling bazel again with the following lines below from the CROSSTOOL removed but still got the same error. default_toolchain { |
Also, please let me know what "more information" you need |
We should rename that label. |
piii is the identifier bazel use to identify x86_32, I understand the bug. |
Even with the bug fix(0b26f44), I'm still getting the same error: Can we reopen the issue? |
what does |
can you try to replace |
Replacing
|
It says "no space left on device" |
Oops. Hmm, the issue is persistent. I've tried adding |
Uname says your machine is 64 b it should not use piii |
X86_32("x86_32", ImmutableSet.of("i386", "i486", "i586", "i686", "i786", "x86")),
X86_64("x86_64", ImmutableSet.of("amd64", "x86_64", "x64")),
...
private static CPU determineCurrentCpu() {
String currentArch = OS_ARCH.value();
for (CPU cpu : CPU.values()) {
if (cpu.archs.contains(currentArch)) {
return cpu;
}
}
return CPU.UNKNOWN;
} Seriously? It means that os.arch contains x86_64 it returns x86_32 because of x86... It depends on the order of iteration of CPU.values() of course, but this code seems wrong. I guess that's the problem |
Could you run the following bash script on your machine and tells me what it prints out? #!/bin/bash
cat >/tmp/CPU.java <<EOF
public enum CPU {
X86_32("x86_32", "i386", "i486", "i586", "i686", "i786", "x86"), //
X86_64("x86_64", "amd64", "x86_64", "x64"), //
UNKNOWN("unknown");
private final String canonicalName;
private final String[] archs;
CPU(String canonicalName, String... archs) {
this.canonicalName = canonicalName;
this.archs = archs;
}
private static CPU determineCurrentCpu() {
String currentArch = System.getProperty("os.arch");
System.out.println("os.arch = " + currentArch);
for (CPU cpu : CPU.values()) {
for (String arch : cpu.archs) {
if (arch.equals(currentArch)) {
return cpu;
}
}
}
return CPU.UNKNOWN;
}
public static void main(String[] args) {
System.out.println("CPU = " + determineCurrentCpu().canonicalName);
}
}
EOF
(cd /tmp && javac CPU.java && java CPU)
rm -f /tmp/CPU.java |
After running the script, I get the following: |
Oh I see you have a 32-bit JDK on a 64-bit machine... Can you change to a 64 bit JDK? |
As noticed in #1122. -- MOS_MIGRATED_REVID=120315240
I Installed 64 bit JDK and bazel no longer complains about 'piii'. I'm back to JVM memory errory: "Error occurred during initialization of VM. Cannot create VM thread. Out of system resources." I'm assuming the error has to do with how my JVM is configured. |
The source of error was the max user process limit. I increased ulimit - u and I can compile bazel now. |
\o/ |
Fixes #1122. -- MOS_MIGRATED_REVID=120223970
As noticed in #1122. -- MOS_MIGRATED_REVID=120315240
Fixes #1122. -- MOS_MIGRATED_REVID=120223970
As noticed in #1122. -- MOS_MIGRATED_REVID=120315240
@jinhoonbang , I have a question for you. what value do you set for 'max user process limit' to compile bazel? Thanks in advance |
@flanciskinho I have just successfully bootstrapped bazel 0.4.2 (just released) on RHEL6 with:
The ulimit -a shows:
Regards |
https://people.centos.org/~tru/bazel-centos6/ contains the spec file, source and binary bazel 0.4.5 rpms. It's just a POC, the packages are unsigned on purpose. You can rebuild yourself with rpmbuild -ba bazel.spec (cf https://wiki.centos.org/HowTos/SetupRpmBuildEnvironment) |
I am trying to compile bazel from source (in order to tryout tensorflow) on a cluster. I don't have root rights, so I'm trying to compile it locally. I've read from other issues that compiling bazel from source locally isn't supported so I modified the crossfile a bit. I cloned bazel from the master branch. I'm using Red Hat 6.7.
Some information about the system:
$uname -a
Linux $CLUTERNAME 2.6.32-573.18.1.el6.x86_64 #1 SMP Wed Jan 6 11:20:49 EST 2016 x86_64 x86_64 x86_64 GNU/Linux
gcc and java are installed locally as well.
$which gcc
~/jbang/gcc-4.8.5/bin/gcc
$which java
~/jbang/jdk1.8.0_73/bin/java
I've made some modifications to the CROSSTOOL:
When I run compile.sh, I get the following error:
INFO: Found 1 target...
ERROR: /home/dkl524/jbang/bazel/src/main/tools/BUILD:3:1: C++ compilation of rule '//src/main/tools:network-tools' failed: gcc failed: error executing command
(cd /tmp/bazel.b560SISc/out/bazel &&
exec env -
PATH=/home/dkl524/jbang/Python-2.7.11:/home/dkl524/jbang/jdk1.8.0_73/bin:/home/dkl524/jbang/gcc-4.8.5/bin:/opt/intel/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin
'external/bazel_tools/tools/cpp/
/jbang/gcc-4.8.5/bin/gcc' -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -iquote . -iquote bazel-out/local_linux-fastbuild/genfiles -iquote external/bazel_tools -iquote bazel-out/local_linux-fastbuild/genfiles/external/bazel_tools -isystem external/bazel_tools/tools/cpp/gcc3 '-std=c99' -no-canonical-prefixes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/local_linux-fastbuild/bin/src/main/tools/_objs/network-tools/src/main/tools/network-tools.pic.o' -MD -MF bazel-out/local_linux-fastbuild/bin/src/main/tools/_objs/network-tools/src/main/tools/network-tools.pic.d -fPIC -c src/main/tools/network-tools.c -o bazel-out/local_linux-fastbuild/bin/src/main/tools/_objs/network-tools/src/main/tools/network-tools.pic.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 127./jbang/gcc-4.8.5/bin/gcc: No such file or directory/tmp/bazel.b560SISc/out/bazel/_bin/process-wrapper: line 12: external/bazel_tools/tools/cpp/
Target //src:bazel failed to build
ERROR: /home/dkl524/jbang/bazel/src/BUILD:125:2 C++ compilation of rule '//src/main/tools:namespace-sandbox' failed: gcc failed: error executing command
(cd /tmp/bazel.b560SISc/out/bazel &&
exec env -
PATH=/home/dkl524/jbang/Python-2.7.11:/home/dkl524/jbang/jdk1.8.0_73/bin:/home/dkl524/jbang/gcc-4.8.5/bin:/opt/intel/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin
'external/bazel_tools/tools/cpp/~/jbang/gcc-4.8.5/bin/gcc' -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -iquote . -iquote bazel-out/local_linux-fastbuild/genfiles -iquote external/bazel_tools -iquote bazel-out/local_linux-fastbuild/genfiles/external/bazel_tools -isystem external/bazel_tools/tools/cpp/gcc3 '-std=c99' -no-canonical-prefixes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/local_linux-fastbuild/bin/src/main/tools/_objs/namespace-sandbox/src/main/tools/namespace-sandbox.pic.o' -MD -MF bazel-out/local_linux-fastbuild/bin/src/main/tools/_objs/namespace-sandbox/src/main/tools/namespace-sandbox.pic.d -fPIC -c src/main/tools/namespace-sandbox.c -o bazel-out/local_linux-fastbuild/bin/src/main/tools/_objs/namespace-sandbox/src/main/tools/namespace-sandbox.pic.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 127.
INFO: Elapsed time: 4.254s, Critical Path: 1.24s
I'm assuming the error has to do with the way I've changed the crossfile. Bazel is clearly searching for a wrong directory.
The text was updated successfully, but these errors were encountered: