The file ##build_files/build_environment/install_deps.sh## contains the following line:
THREADS=`cat /proc/cpuinfo | grep processor | wc -l`
The command within the backticks is a [[ http://catb.org/jargon/html/U/UUOC.html | Useless Use Of Cat ]].
A more compact way of writing the same thing (saving two subprocesses) is
THREADS=`grep -c processor /proc/cpuinfo`
or (using POSIX-preferred command-substitution parentheses instead of backticks)
THREADS=$(grep -c processor /proc/cpuinfo)
But the most compact, and least Linux-specific, way is to use the ##nproc##(1) command from the [[ http://www.gnu.org/software/coreutils/manual/html_node/nproc-invocation.html | GNU coreutils package ]]:
THREADS=$(nproc)
Reviewers: sergey, mont29
Reviewed by: mont29
Differential Revision: https://developer.blender.org/D255
This script was used to initialize build environment currently used
for glibc-2.11 builds.
It's supposed to be used on debian-based distros.
Usage is described in the top comment of the script.
It is highly recommended to use this script in the virtual machine
to prevent possible conflicts with your own configuration.
TODO:
- Add OSL configuration
- Script requires manual copying of some scripts still (see comments
at the top of the script)
I would prefer this script be edited only in cases when it's really
needed, meaning i wouldn't be fan of changes like "just use latest
version of library XXX". It's not so safe to do such changes and it's
easy to upgrade libraries after environment was set up.