# Parallel port building and dependencies.



## akregator (Dec 30, 2011)

Hello,

We all know it is possible to build different ports at the same time, but there is one problem.

For example, when building databases/mysql55-server and databases/phpmyadmin, we have theses dependencies (just those interesting for the example):

databases/mysql55-server -> devel/cmake

databases/phpmyadmin -> databases/mysql55-client -> devel/cmake

Then, cmake will be building when mysql55-server started to do this!

I don't know if there is something to handle this problem or if it is something on study for FreeBSD 9, but what about the idea of creating a file named, for example, <portname>/__building__, and check existence of this file before make dependency ?

I would like to develop this, but no time for the moment. (And I also don't know how works ports!)


----------



## jb_fvwm2 (Dec 31, 2011)

```
portmaster -d -B -P -i databases/phpmyadmin databases/mysql55-server
```
 *might* handle this particular instance easily.  I know it has eased ports updates vs what I used to go through.


----------



## akregator (Jan 7, 2012)

Hum, you are right, but why not implement this Â« natively Â» in ports ?


----------



## cakersq (Jan 8, 2012)

akregator,

I've written several of my own Parallel Port building scripts, and am just now writing a distributed port building variant, to build all ports in parallel.

Please take a look at my post, and give that script a shot.

I don't have enough time now, but if anyone feels like it, they can adapt this for use in Ports natively.

http://forums.freebsd.org/showthread.php?t=24204


----------



## cakersq (Jan 8, 2012)

Sorry akregator,  I forgot to mention, that you are correct, there is no NATIVE way to build multiple ports like that.  I have resulted in writing my own scripts to achieve the same effect, which will actually build all of the DEPENDENCIES for given port(s) in parallel, thus making better use of all those processors.

For example, if A depends on B and C, and B and C are "leaves" not depending on other ports, the script will build B and C at the same time, and wait to build A until they are completed.

This works well for large builds like Xorg and KDE, but other types of builds that have a very linear dependency tree like portmanager it doesn't help as much.


----------

