Version 4 (modified by ses@…, 16 years ago) (diff) |
---|
TODO: How to enable parallel building
- Audience: Users with multi-core systems
- Requires: MacPorts >=1.6.0
Introduction
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.
Configuration
Step 1: Edit macports.conf
Open /opt/local/etc/macports/macports.conf
in your favorite editor. Find the line
buildmakejobs 1
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.
That was it. From now on, port will use parallel build jobs.
Note
Please note that this feature is opt-in. It will only work with ports specifying
use_parallel_build yes
Some developers are concerned it might break ports which have insufficient dependencies in their Makefiles.
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.
Enable/disable from command line
This feature can also be enabled or disabled from command line.
$ port install $portname build.jobs=N
Where N is the number of parallel build jobs to use. If you specify build.jobs=1
it will be disabled.