# Installing ports with multicore machine



## Henu (Jun 2, 2010)

Hi

I have a multicore machine and I would like to compile ports packages in multiple threads. I checked manual page of make and it says that -j <max jobs> is the correct option for me. But when I try to install ports packages using it, the make gives errors. For example if I try to install gmake, it says this:


```
# cd /usr/ports/devel/gmake/
# make -j 5 install
cd: can't cd to /usr/ports/devel/gmake/work/make-3.81
*** Error code 2
1 error
```

Does this mean that ports must be compiled in one thread only? Or is the good amount of threads somehow autodetected and the user does not need to worry about threads when compiling ports?


----------



## nekoexmachina (Jun 2, 2010)

You will run multiple 'make' jobs with that command, that obviouslly will run make all & install & clean in parallel.
You should set it up with something like NUMJOBS in make.conf
Find the option by
`$ man make.conf|grep -i jobs && grep -i jobs /path/to/make.conf.example`


----------



## SirDice (Jun 2, 2010)

Some additional info: Porter's handbook: 6.3 Building mechanisms.


----------

