Menu

Dev-cpp Dual core compiling

d3jake
2009-01-09
2012-09-26
  • d3jake

    d3jake - 2009-01-09

    I was told by a friend that I could pass -j 4 to the make which would let me take advantage of my new (new to me) dual core processor. I have tried to pass -j 3 to my make but it then complains about not seeing sh.exe:
    make.exe: Do not specify -j or --jobs if sh.exe is not available.
    make.exe: Resetting make for single job mode.

    I am on Windows XP Pro SP2 using version 4.9.9.2 of Dev-cpp.

     
    • cpns

      cpns - 2009-01-10

      GCC is originally developed on Linux. sh is a Linux command shell and supports the ability to start multiple processes simultaneously. Make uses the command shell to launch build commands, so using the -j switch allows it to compile multiple modules simultaneously. It is only any real advantage if you have a significant number of modules. If your builds take less than a minute already, I would not bother.

      MinGW GCC uses the windows cmd shell. It is possible to launch independent processes with this, but make presumably does not support it, or cannot for some technical reason.

      You might try installing a Windows build of sh.exe from http://gnuwin32.sourceforge.net/ or http://unxutils.sourceforge.net/

      Of course, rather than relying on a friend, you should read teh manual: http://www.gnu.org/software/make/manual/make.html#Parallel to get the full skinny.

      It will have no affect on the generated code, which is why it is seldom that important except for large projects with multiple developers changing many files simultaneously, and using continuous integration techniques (or if you are building the Linux kernel, or the GNU toolchain for example). It may take longer to get it to work than the time you will save!

      Clifford

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.