Install with local toolchain?
I'm working on a RHEL5 cluster with outdated compilers, etc. I have installed an updated toolchain locally, but I am not sure how to force compile.sh to use these updated tools.
From looking at some of the other issues it seems like the solution might be to change all of the hardcoded paths in CROSSTOOL, but it seems like there should be an easier way to respect environment variables...
Any ideas?
Here's what I have to do for building with outdated compilers in the system.
- Make sure you have a newer compiler somewhere and glibc and libstdc++ to go with it.
- Update CROSSTOOL to use the newer toolchain. I added linker_flags for -L to find newer glibc and -Wl,rpath to use the newer glibc in runtime.
- CC="newer-gcc" CXX="newer-g++" CFLAGS="-I/usr/lib" JNI_LD_ARGS="-L/where/to/find/glibc -Wl,rpath,/where/to/find/glibc -B/newer-toolchain" compile.sh build
These above will build a bazel binary that will use the toolchain specified in CROSSTOOL by default. If you're okay with that then you can stop. Otherwise if you want to use the system toolchain for compilation, proceed.
< optional > 4. Revert the changes to CROSSTOOL. 5. ./compile.sh build /where/to/find/bazel/you/just/built/bazel
The optional steps are needed because Bazel packages the CROSSTOOL in the binary. It would be easier if compile.sh allows a way to specify a customized CROSSTOOL for building Bazel but packages with the original CROSSTOOL.
Alpha
2015-10-26 12:34 GMT-04:00 Steven Kearnes [email protected]:
I'm working on a RHEL5 cluster with outdated compilers, etc. I have installed an updated toolchain locally, but I am not sure how to force compile.sh to use these updated tools.
From looking at some of the other issues it seems like the solution might be to change all of the hardcoded paths in CROSSTOOL, but it seems like there should be an easier way to respect environment variables...
Any ideas?
— Reply to this email directly or view it on GitHub https://github.com/bazelbuild/bazel/issues/531.
Hi there, we have an experimental feature to do so: https://groups.google.com/d/msg/bazel-discuss/MSunz2ZUOq0/U5tE7uQLJQAJ
Can you try and tell me if it worked for you?
It has been rolled-out