0

Need to build android source build with full CPU utilisation.
For that, how to calculate N in " make -jN " ?

Sample CPUinfo:

cpuinfo

Kumar
  • 108
  • 1
  • 12

2 Answers2

1

Your Linux distro should come with the command nprocs, or at least nprocs should be easily installable. If you don't want to require nprocs, this shell command will give you the number of cores in the box (including hyper-threaded ones): ls -d /sys/devices/system/cpu/cpu[0-9]*|wc -l

Michael Livshin
  • 401
  • 3
  • 4
0
cores=$(grep -c ^processor /proc/cpuinfo)
make -j${cores}
blackghost
  • 1,730
  • 11
  • 24