0

When I compile a C project it can take about 90 seconds even though I use a fast Intel I7 CPU. Is it because compilation is a low-level task or why are my build times so long? My environment is the Nios 2 IDE for Altera DE2 FPGA.

Niklas Rosencrantz
  • 25,640
  • 75
  • 229
  • 424
  • 1
    Depends on the size of your project. The Linux kernel can take several minutes. Really big projects like Gnome or LibreOffice up to hours. – Bart Friederichs Oct 09 '13 at 06:29
  • 1
    Configuring cache options in the Makefile can help you to save time, but for small projects that you need to compile often, I recommend to use ramdrives. The compiler has to access the drive for each file and that takes time... – opalenzuela Oct 09 '13 at 06:31
  • 2
    Compiling and synthesizing a FPGA project surely takes a long time:). –  Oct 09 '13 at 06:35
  • 2
    It is quiet normal for programs made for soft core processors to take longer than the ones for a hard core CPU. In many cases, the time for compile/link is not as much as the actual download of the code, re-start of the CPU, load the new SW and re-starting it. – FarhadA Oct 09 '13 at 11:51

2 Answers2

2

if your project is managed by Makefile, try "make -jn" to trigger mul-threads in compiling, n is thread num for compiling, e.x. "make -j10"

1

Is it actually the compile taking the time? My experience of softcore processor (and other embedded development) is that the compile is quick (comparable with compiling host-based code) and the time is taken uploading the new code to the embedded system to test.

Martin Thompson
  • 16,395
  • 1
  • 38
  • 56