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?

1 Answer 1


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.


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

  • Well that's a good start. I was more interested in speeding up compile time. Can you try the same compile on 2 with a make -j4 or make -j6 and see if its... 30 seconds to compile or better? :)
    – Piotr Kula
    Feb 17, 2015 at 22:25
  • @ppumkin Edited to add times.
    – joan
    Feb 17, 2015 at 22:52
  • Awesome. Looks like j4 is best suited due to I/O restrictions. What class SD card do you have?
    – Piotr Kula
    Feb 17, 2015 at 22:54
  • @ppumkin Edited to add more times and card details
    – joan
    Feb 17, 2015 at 23:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.