Changes between Version 4 and Version 5 of howto/ParallelBuilding


Ignore:
Timestamp:
Oct 24, 2009, 7:04:55 AM (15 years ago)
Author:
ryandesign (Ryan Carsten Schmidt)
Comment:

Total rewrite because parallel building is on by default now

Legend:

Unmodified
Added
Removed
Modified
  • howto/ParallelBuilding

    v4 v5  
    11[wiki:howto <- Back to the HOWTO section]
    22
    3 = TODO: How to enable parallel building =
     3= How to disable parallel building =
    44
    5  * Audience: Users with multi-core systems
    6  * Requires: MacPorts >=1.6.0
     5 * Audience: Users with multi-processor or multi-core systems
     6 * Requires: MacPorts >=1.8.0
    77
    88== Introduction ==
    99
    10 Some ports in MacPorts ports tree can use make -j, a command which allows building parallel. This means, make will spawn multiple build jobs at the same time. With this, the full advantage of the multi core system can be utilized.
     10If you have a Mac with multiple processors or multiple processor cores, MacPorts will build each port in parallel.
     11This means `make` will spawn multiple build jobs at the same time.
    1112
    12 == Configuration ==
     13While this makes the build faster if it works, it can also cause problems if it doesn't.
     14Not all ports have been tested for parallel building, and some may intermittently or consistently fail to build with it.
    1315
    14 === Step 1: '''Edit macports.conf''' ===
     16== Ways to disable ==
    1517
    16 Open `/opt/local/etc/macports/macports.conf` in your favorite editor. Find the line
     18=== On the command line === #commandline
     19
     20If you suspect a build failure may be the result of parallel building, you can turn it off temporarily directly in the `port` command invocation:
     21
     22{{{
     23$ sudo port clean PORT
     24$ sudo port install PORT build.jobs=1
     25}}}
     26
     27where PORT is the port name.
     28
     29If this succeeds, parallel building should probably be disabled in that port's Portfile. See below.
     30
     31=== In the Portfile === #portfile
     32
     33If you find that the software being ported does not support parallel building, it can be disabled in the Portfile using this line:
     34
     35{{{
     36use_parallel_build  no
     37}}}
     38
     39The problem should also be reported to the developers of the software so that they can fix the problem and we can reenable parallel building in the future.
     40
     41=== In macports.conf === #conf
     42
     43You can disable parallel building entirely on your system if desired by changing the `buildmakejobs` line in `/opt/local/etc/macports/macports.conf`. By default its value is `0` which causes MacPorts to automatically determine an appropriate number of jobs to start (the number of processors or cores, or the number of GB of memory installed, whichever is less). You can also explicitly set it to a number of jobs. To disable parallel building, set it to `1`:
     44
    1745{{{
    1846buildmakejobs       1
    1947}}}
    20 and change it to the number of parallel build jobs you want to use. It is common to either use the number of cores or number of cores+1. If you set it to `0`, it will automatically take the number of cores you have.
    21 
    22 That was it. From now on, port will use parallel build jobs.
    23 
    24 === Note ===
    25 
    26 Please note that this feature is opt-in. It will only work with ports specifying
    27 {{{
    28 use_parallel_build  yes
    29 }}}
    30 Some developers are concerned it might break ports which have insufficient dependencies in their Makefiles.
    31 
    32 If any port still does not build with this feature, see below how to disable it from command line for a specific port and open a ticket in our bug tracker or report it upstream.
    33 
    34 == Enable/disable from command line ==
    35 
    36 This feature can also be enabled or disabled from command line.
    37 {{{
    38 $ port install $portname build.jobs=N
    39 }}}
    40 Where N is the number of parallel build jobs to use. If you specify `build.jobs=1` it will be disabled.
    4148
    4249[wiki:howto <- Back to the HOWTO section]