16 | | Open `/opt/local/etc/macports/macports.conf` in your favorite editor. Find the line |
| 18 | === On the command line === #commandline |
| 19 | |
| 20 | If 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 | |
| 27 | where PORT is the port name. |
| 28 | |
| 29 | If this succeeds, parallel building should probably be disabled in that port's Portfile. See below. |
| 30 | |
| 31 | === In the Portfile === #portfile |
| 32 | |
| 33 | If you find that the software being ported does not support parallel building, it can be disabled in the Portfile using this line: |
| 34 | |
| 35 | {{{ |
| 36 | use_parallel_build no |
| 37 | }}} |
| 38 | |
| 39 | The 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 | |
| 43 | You 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 | |
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. |