Ticket #910 (new feature request)

Opened 7 years ago

Last modified 2 weeks ago

--make should have a -j flag for parallel building

Reported by: igloo Owned by:
Priority: normal Milestone: _|_
Component: Compiler Version: 6.4.2
Keywords: Cc: bos, hackage.haskell.org@…, dterei, idhameed@…, mail@…, jan.stolarek@…, rrnewton@…, chetant@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: N/A Blocked By:
Blocking: Related Tickets:

Description

It should be possible to give --make a -j flag, similar to make's, to tell it to use multiple proceses to build modules. This would allow executables, libraries and cabal packages to be built faster for people with multiple CPUs.

Attachments

ghc-parallel-comp.patch Download (67.2 KB) - added by simonmar 7 years ago.
FastString-MVar.patch Download (4.6 KB) - added by simonmar 11 months ago.

Change History

Changed 7 years ago by igloo

  • summary changed from --make should have a -j flag for paralel building to --make should have a -j flag for parallel building

Changed 7 years ago by simonmar

Changed 7 years ago by simonmar

This seems like a good place to hang my patch to implement ghc --make -jN, which was used for the experiments in the 2005 Haskell Workshop paper on SMP GHC, but almost certainly isn't ready for prime time.

Changed 7 years ago by igloo

  • testcase set to N/A

Changed 6 years ago by bos

  • cc bos added

Would love to have this.

Changed 6 years ago by simonmar

  • milestone changed from 6.8 to 6.1

Not for 6.8, probably.

Changed 5 years ago by simonmar

  • component changed from Driver to Compiler
  • milestone changed from 6.10 branch to _|_

We're not planning this for 6.10. It's more likely that Cabal will get parallel make support first, in which case there's less need for us to tackle this.

Changed 5 years ago by simonmar

  • architecture changed from Multiple to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Multiple to Unknown/Multiple

Changed 2 years ago by liyang

  • cc hackage.haskell.org@… added
  • failure set to None/Unknown

Changed 22 months ago by dterei

  • cc dterei added

Changed 11 months ago by orenbenkiki

Is this a dead ticket? Because I'd love to see it implemented. I'm working on a 32-core machine and compiling large Haskell packages (dozens of modules). A -j flag would make a real difference for me. Granted this isn't the most common case, but I'd expect a significant improvement even for smaller packages on a dual-core machine (and these days, which machine isn't at least that?). Faster builds => happier developers, and all that :-)

Changed 11 months ago by simonmar

Changed 11 months ago by simonmar

Attached a patch I had lying around to make FastString thread-safe. IIRC it had a small compile-time performance impact.

Changed 5 months ago by morabbin

  • status changed from new to closed
  • resolution set to wontfix

Cabal install now has -j flag, so closing this as wontfix.

Changed 5 months ago by orenbenkiki

  • status changed from closed to new
  • resolution wontfix deleted

Cabal install -j flag solves a different problem. It builds and installs different packages in parallel. This ticket is about GHC being able to build different modules in parallel in a single package, regardless of installing the results.

Changed 4 months ago by ihameed

  • cc idhameed@… added

Changed 2 months ago by nh2

  • cc mail@… added

Can somebody give an idea about the difficulty of this?

From an outsider's view, GHC has a very clear idea about module dependencies and in which order it has to build them so building independent modules in parallel shouldn't be too hard, should it?

Changed 5 weeks ago by jstolarek

  • cc jan.stolarek@… added

Changed 3 weeks ago by rrnewton

  • cc rrnewton@… added

Changed 2 weeks ago by chetant

  • cc chetant@… added
Note: See TracTickets for help on using tickets.