Can we use multi-thread support to build ports?

The "-j" flags doesn't work for every port I tried. Is there a way to use true multi-thread support for every port (even with a third party program)?

NOTE: For anyone seeing this and not reading the replies, I'm talking about using multiple jobs (hence the "-j" flag). I didn't even knew building multiple ports concurrently is even possible...
 

SirDice

Administrator
Staff member
Administrator
Moderator
It's not always possible to build things multi-threaded. In some cases you can't build something until something else was built first. They have to be built sequentially.

Do you have an example of a port where it doesn't work?
 
> In some cases you can't build something until something else was built first. They have to be built sequentially.
Oh, that's interesting! So do you think trying to build the dependencies first will work

> Do you have an example of a port where it doesn't work?
Sure! For starters, I will tell you three. x11/xorg,editors/neovim and lang/ldc.
I tried to build all of them using the following command: make -j7
 

SirDice

Administrator
Staff member
Administrator
Moderator
x11/xorg is a so-called meta port. It doesn't have anything of itself, it only depends on a bunch of other ports.
 

SirDice

Administrator
Staff member
Administrator
Moderator
The other two are not meta ports however, right?
They're 'proper' ports yes. The ports themselves look like they will build multi-threaded. But they do need to install their dependencies before the port itself can be built of course.
 

cy@

Developer
The "-j" flags doesn't work for every port I tried. Is there a way to use true multi-thread support for every port (even with a third party program)?

NOTE: For anyone seeing this and not reading the replies, I'm talking about using multiple jobs (hence the "-j" flag). I didn't even knew building multiple ports concurrently is even possible...
Ports builds are multithreaded by default, without the -j.

What if you want to disable multithreaded ports builds then? make -DDISABLE_MAKE_JOBS.

If a port doesn't support multithreaded builds you will see MAKE_JOBS_UNSAFE=yes in its Makefile.
 
Top