Re: svn commit: r50880 - head/share/mk

Glen Barber <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
On Tue, Sep 19, 2017 at 10:03:26AM +0000, Wolfram Schneider wrote:
> Author: wosch
> Date: Tue Sep 19 10:03:26 2017
> New Revision: 50880
> URL: https://svnweb.freebsd.org/changeset/doc/50880
> 
> Log:
>   Implement workaround for a parallel doc build
>   
>   $ make p-all
>   
>   It works for the sub-directories in a given directory.
>   
>   On a standard quad core machine the build time goes down
>   from ca. 20min to 5 minutes.
>   
>   PR: 222322
> 
> Modified:
>   head/share/mk/doc.project.mk
> 
> Modified: head/share/mk/doc.project.mk
> ==============================================================================
> --- head/share/mk/doc.project.mk	Tue Sep 19 09:57:15 2017	(r50879)
> +++ head/share/mk/doc.project.mk	Tue Sep 19 10:03:26 2017	(r50880)
> @@ -104,3 +104,9 @@ DOC_LOCAL_MK=	${DOC_PREFIX}/${LANGCODE}/share/mk/doc.l
>  
>  # Subdirectory glue.
>  .include "doc.subdir.mk"
> +
> +# parallel build for target "all"
> +NCPU?= 8
> +p-all:
> +	make -V SUBDIR | sed -E 's/[ ]+$$//' | tr " " "\n" | sed -E 's/^/make -C /' | tr '\n' '\0' | xargs -0 -n1 -P${NCPU} /bin/sh -c
> +
> 

Would it be more preferable to use the number of CPUs available on the
system, instead of hard-coding a value?  Such as:

NCPU?= $$(sysctl -n hw.ncpu)

This would allow those with fewer than 8 CPUs to not need to specify
CPU=n when invoking make(1).

On an additional point, is there any reason in particular you did not
make parallel builds the default?

Glen
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAlnBKH0ACgkQAxRYpUeP
4pOh+w/7BcZ2JTYUlH2naL44Nm4C7UkakWJ2RS/mSKYcOQ23V3KvZSeIfA9Tu3E5
hIW5I6OXO38mvA6qgLhFZVc6uYhO4mkAFF3LCm8JKiSYfMVeQKbSWY4NROatqVpY
FZcSecnSUxwLYpQu+rCfavRm3BegOVaqdo3zsrawNf/EM6xAZvX6qh+Wxd4I0NII
4nCUyHM7s/xB5yEhpzjnD3R9yHuynNwLCaZeOJOe3FykX65yWcvLzrPZHaER8W/a
Q3Bw3k/fkY6udvZgDrCL/cLCWFE7tj3H0a7iZM4IXtDwOm/irSqBFgisO6arUMAm
K7fkY+bmxaJGSRcJipv5UuCxqBpDM0jEPi1irtLRBf/Xd1BEDpQrVvQBSOo2LIHv
omJ5a67fKQiE9SKkXi6Ger6WdULYKIndG0Ww++U0JyEs/2z2kEpZBK9d00ijEzOK
2yOqkD3nudLIeoAmucMbb5spvg1WGVl11/7M156aI1fzWNs9XQY7iKMAAjUisWDA
DHn3pSli8fN4Ls/A0xHhdr2k9G245w1LGndwkyim0jRSvSlO369Bj/JGGQ/BArDo
NGDT9CABuP8/7f+bzKki50ACiVbeZoalmJCu8eWFVH9fRO9IzO4yElDDjIo4Oi4h
RGPxCRwn/hvMmeFEVgkc8Pqa75aED/+ga3MQ2htupjCvHT9GIjw=
=qDzJ
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.