2

I was wondering if make would need extra parameters to make use of the 4 core A7 on the Raspberry Pi 2?

I have read that you can specify make -j# at a rate of cores x 1.5 to run parallel jobs within make. Will this decrease compile time for custom libraries or does make already detect the number of cores on the Pi and get on with it as fast as possible?

Piotr Kula
  • 17,336
  • 6
  • 66
  • 105

1 Answers1

2

A make which I do on a B+ takes 3 minutes. The identical make takes one minute on a Pi 2.

If your program uses threads you won't have to do anything special to use the extra cores. The main program or any of its threads which want to run will be given any available core.

I don't know if there are compilation flags which will make a difference to the build or execution of a program.


EDITED TO ADD

Times to make on Pi 2 with and without j flag with a class 6 SD card

time make: (real) 1m1.020s

time make -j4: (real) 0m46.762s

time make -j6: (real) 0m48.159s

Times to make on Pi 2 with and without j flag with a RAM disc

time make: (real) 0m59.017s

time make -j4: (real) 0m35.472s

time make -j6: (real) 0m38.509s

joan
  • 71,852
  • 5
  • 76
  • 108