mirror of
https://github.com/openhwgroup/cva6.git
synced 2025-04-19 03:44:46 -04:00
[GCC toolchain builder] Provide means of throttling parallel builds. (#1680)
This commit is contained in:
parent
c0a30e1c85
commit
2745f3edcf
2 changed files with 18 additions and 4 deletions
|
@ -162,6 +162,14 @@ located under `util/gcc-toolchain-builder`. Please make sure beforehand that yo
|
|||
installed all the required *toolchain build* dependencies (see
|
||||
[the toolchain README file](file:util/gcc-toolchain-builder/README.md).)
|
||||
|
||||
To control the load of your host machine when building the toolchain, you can use
|
||||
the environment variable `NUM_JOBS` to limit the number of concurrent jobs launched
|
||||
by `make`:
|
||||
- if left undefined, `NUM_JOBS` will default to 1, resulting in a sequential execution
|
||||
of `make` jobs;
|
||||
- when setting `NUM_JOBS` to an explicit value, it is recommended not to exceed 2/3 of
|
||||
the total nuber of virtual cores available on your system.
|
||||
|
||||
```sh
|
||||
# Set environment variable RISCV to the desired installation location.
|
||||
# The toolchain can be installed in any user-writable directory.
|
||||
|
|
|
@ -37,6 +37,12 @@ ROOT_DIR=$(dirname $(readlink -f $0))
|
|||
# Builds of individual tools are performed under the matching
|
||||
# build/... subdirectories
|
||||
|
||||
# Provide a means of throttling parallel 'make' executions.
|
||||
# Use a conservative setting to avoid overloading the host machine.
|
||||
if [ -z "$NUM_JOBS" ]; then
|
||||
NUM_JOBS=1
|
||||
fi
|
||||
|
||||
# Helper function to print usage information.
|
||||
print_usage()
|
||||
{
|
||||
|
@ -163,7 +169,7 @@ cd $ROOT_DIR/build/binutils-gdb
|
|||
{ echo "Could not configure binutils-gdb, bailing out!" ; \
|
||||
exit 2 ; } ; } && \
|
||||
{ [ -d gas/doc ] || mkdir -p gas/doc; } && \
|
||||
make -j all && make install || \
|
||||
make -j"$NUM_JOBS" all && make install || \
|
||||
{ echo "*** Could not build binutils, bailing out!" ; exit 2; }
|
||||
cd -
|
||||
|
||||
|
@ -182,8 +188,8 @@ cd $ROOT_DIR/build/gcc
|
|||
../../$GCC_DIR/configure $GCC_CONFIGURE_OPTS || \
|
||||
{ echo "Could not configure GCC, bailing out!" ; \
|
||||
exit 2 ; } ; } && \
|
||||
make -j all || { rm -rf $TARGET && \
|
||||
make -j all ; } && make install || \
|
||||
make -j"$NUM_JOBS" all || { rm -rf $TARGET && \
|
||||
make -j"$NUM_JOBS" all ; } && make install || \
|
||||
{ echo "*** Could not build GCC (even after removing target dirs), bailing out!" ; exit 2; }
|
||||
cd -
|
||||
|
||||
|
@ -209,7 +215,7 @@ export CFLAGS="-mcmodel=medium"
|
|||
../../$NEWLIB_DIR/configure $NEWLIB_CONFIGURE_OPTS || \
|
||||
{ echo "Could not configure newlib, bailing out!" ; \
|
||||
exit 2 ; } ; } && \
|
||||
make -j all && make install || \
|
||||
make -j"$NUM_JOBS" all && make install || \
|
||||
{ echo "*** Could not build newlib, bailing out!" ; exit 2; }
|
||||
cd -
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue