Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 May 2014 10:57:49 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Benjamin Kaduk <kaduk@MIT.EDU>
Cc:        svn-doc-head@freebsd.org, svn-doc-all@freebsd.org, doc-committers@freebsd.org, Warner Losh <imp@freebsd.org>
Subject:   Re: svn commit: r44734 - head/en_US.ISO8859-1/books/handbook/cutting-edge
Message-ID:  <4D3E993B-0C34-40AB-B0B3-7D1C900B862A@bsdimp.com>
In-Reply-To: <alpine.GSO.1.10.1405062252260.9713@multics.mit.edu>
References:  <201405011850.s41Iojk5091857@svn.freebsd.org> <alpine.GSO.1.10.1405062252260.9713@multics.mit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_128A5961-6794-45E7-B6E4-2B0BD890579C
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=windows-1252


On May 6, 2014, at 9:09 PM, Benjamin Kaduk <kaduk@MIT.EDU> wrote:

> Warner, can you please double-check the facts about make variables?
> I am not confident I have the new world order correct.
>=20
> On Thu, 1 May 2014, Dru Lavigne wrote:
>=20
>>=20
>> Modified: =
head/en_US.ISO8859-1/books/handbook/cutting-edge/chapter.xml
>> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
>> --- head/en_US.ISO8859-1/books/handbook/cutting-edge/chapter.xml	=
Thu May  1 18:12:22 2014	(r44733)
>> +++ head/en_US.ISO8859-1/books/handbook/cutting-edge/chapter.xml	=
Thu May  1 18:50:44 2014	(r44734)
>> @@ -1396,6 +1396,25 @@ before running "/usr/sbin/freebsd-update
>> 	sequence  described in
>> 	the following procedure.</para>
>>=20
>> +      <note>
>> +      <para>It is a good idea to save the output from running
>> +	<command>make</command> to a file.  If something goes wrong, a =
copy of
>> +	the error message can be posted to one of the &os; mailing
>> +	lists.</para>
>> +
>> +      <para>The easiest way to do this is to use =
<command>script</command> with a
>> +	parameter that specifies the name of the file to save all
>> +	output to.  Do not save the output to
>> +	<filename>/tmp</filename> as this directory may be cleared at
>> +	next reboot.  A better place to save the file is
>> +	<filename>/var/tmp</filename>.  Run this command immediately =
before rebuilding
>> +	the world, and then type <userinput>exit</userinput> when the
>> +	process has finished:</para>
>> +
>> +      <screen>&prompt.root; <userinput>script =
<replaceable>/var/tmp/mw.out</replaceable></userinput>
>> +Script started, output file is /var/tmp/mw.out</screen>
>> +      </note>
>> +
>=20
> (I mentioned on IRC that this could be "script /var/tmp/mw.out make =
buildworld", but only on BSD boxes -- Linux's script(1) has a different =
syntax.  This is more portable as-is, so I don't think we should change =
it.)

make buildworld |& tee foo.log

is what I use, but that=92s csh/tcsh syntax and only catches one =
command. when I have to do multiples, I=92ll add -a to the tee command. =
Sometimes I use emacs=92 shell to get the same effect.

>> @@ -1597,140 +1620,70 @@ before running "/usr/sbin/freebsd-update
>> 	behavior of the <filename>Makefile</filename> is controlled by
>> -	these variables.  These are the same variables as are set in
>> -	<filename>/etc/make.conf</filename>, and this provides
>> -	another way of setting them.  For example:</para>
>> +	variables.  These can either be set in
>> +	<filename>/etc/make.conf</filename> or they can be specified
>=20
> I think we must also mention /etc/src.conf here, in the file entitled =
"make world=94.

src.conf is used for all builds in /usr/src (no matter where /usr/src is =
located). If you are building things like ls from hand, you=92ll need to =
also define MAKESYSPATH to be/have =93=85/share/mk=94 in it.

>> +	when using <command>make</command>.  For example, this
>> +	variable specifies that profiled libraries
>> +	should not be built:</para>
>>=20
>>      <screen>&prompt.root; <userinput>make -DNO_PROFILE =
<replaceable>target</replaceable></userinput></screen>
>=20
> Using the NO_FOO form of variables is highly deprecated at this point, =
at least in HEAD.  (I think we're trying to deprecate it on the other =
branches, too.)  While reviewing some of Warner's commits to look at the =
current state of things, I saw a comment in src.opts.mk that "Old =
instances [of NO_FOO] should be removed since they were just to bridge =
the gap between FreeBSD 4 and FreeBSD 5."  The normal way to disable the =
building of profiled libraries would be to set WITHOUT_PROFILE in =
/etc/src.conf; I think that -DWITHOUT_PROFILE on the command line should =
also work, but would like confirmation from Warner.

In 11 and forward, his is correct. Set WITHOUT_PROFILE=3Dyes somewhere =
and all profiling is disabled. In some rare cases you may need to set =
MK_PROFILE=3Dno. This replaces the NO_FOO syntax that was supposed to be =
a stop-gap measure between 4 and 5, but the gap never stopped. NO_FOO is =
limited to CTF, DEBUG_FILES, INSTALLLIB, MAN and profile, and so was =
irregular with the rest of things. A few more NO items may be added to =
the list in my next round of changes, but that=92s likely a ways away.

WITHOUT_PROFILE should work in 10 and earlier too, but that should be =
tested. I don=92t plan on MFCing the NO_foo deprecation warning, and in =
fact realize that it is premature in head.

>> -      <para>is another way of specifying that profiled libraries
>> -	should not be built, and corresponds with the</para>
>> +      <para>It corresponds with this setting in
>> +	<filename>/etc/make.conf</filename>:</para>
>>=20
>>      <programlisting>NO_PROFILE=3D    true     #    Avoid compiling =
profiled libraries</programlisting>
>=20
> (Per the above, this is WITHOUT_PROFILE=3Dtrue in /etc/src.conf.  =
Maybe we should note that it doesn't matter if it's set to true or false =
of arglebarglepants; the fact that it's set is the only thing that =
matters. The inverse of WITHOUT_PROFILE is setting WITH_PROFILE =
explicitly.)

Yes.

>> -      <para>line in <filename>/etc/make.conf</filename>.</para>
>> -
> [...]
>> -      <para>On a multi-CPU machine using an SMP configured kernel, =
try
>> -	values between 6 and 10 and see how they speed things
>> +      <screen>&prompt.root; <userinput>make -j4 =
buildworld</userinput></screen>
>> +
>> +      <para>On a multi-<acronym>CPU</acronym> machine, try
>> +	values between <literal>6</literal> and <literal>10</literal> to =
see how they speed things
>=20
> -j10 is suboptimal on a 32-core machine, surely.  The last advice I =
remember seeing on the mailing lists was that the limit was about 1.5 =
times the number of cores.

Somewhere between 1.5x and 2.0x is where we saturate. 10 used to be a =
very optimistic number, in that the typical parallelism rarely got above =
5 jobs running at any time. Now, however, running around #CPUs jobs =
tends to approach optimal, although some small but worthwhile gains can =
be had at 1.5 to 2.0 times the number of CPUs, especially if hyper =
threading is disabled. However, this massive parallelism is relatively =
recent, and problems exist starting in the -j 15-20 range and getting =
really bad in the 30 and up range.

I=92ll be hacking a bit in this area for some time to come, so maybe it =
would be good to do a review when I=92m done?

Warner

> -Ben
>=20
>> 	up.</para>
>>=20
>>      <indexterm>


--Apple-Mail=_128A5961-6794-45E7-B6E4-2B0BD890579C
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJTanQeAAoJEGwc0Sh9sBEAgQoQAKNQfLWnfCYdMhi2rTYsUl3A
0ZJN8H0P+VlMYBDB5Kgs+SykFo4VL3urA11Fpjsb3Lqscq48JKTvjhhndrlOHWD1
IFnhNDcAWQell5WA4tVfjjHn7j4zSdKsWdaV+e3B3Ipy/udrX+HhtqwAz/9LLP52
fEzYVYNbNjitc6NCKX8AW+DOKzya3pN6JBVWI6o1LbPaoZr5fMROxNpdqy7r0L3T
GXcwbcEC6Oe+aYP0q8uud4mQSY/29WoT3DDzZBjmybfDF1H0VWjfH/dbMTfrygwi
0+wdje+CBbbEXxvhdDhvHU/AmJXTFAOgkHmySdH8SOf6TmEAhb379NWhnB9kqOIh
ye3oAGsveVK0ePjPgMtliEXPkTRFPKLrKkBS7exNjABevco1pVy/Xc18wbI8d65h
D2kHWNvIMGhqQ2O94Ts0Qsa3xE1G7kOq0E0Xwpt5IsM07i+VwPBBnF5K4Tmz7ImJ
ITKUMhzEWpP1jt02Wn4FDUHXOFT3pRSmN/MrvgE6ayKL2tGHw6HoxSuOj8KFjRXB
JWXejCCenk4arl9KQ80FWQfXEE90Ta2W6MGuRZjgYVEDwTe4LeJCcPkik5fuRanO
iWlSrMbufvV6PLb6MD391QCJ5cvYAsLoAvpLrWk79xDI44xjzOF3XBzRbONWj0pk
v55FogfRUg7u0uS2Bm2F
=6SQ+
-----END PGP SIGNATURE-----

--Apple-Mail=_128A5961-6794-45E7-B6E4-2B0BD890579C--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4D3E993B-0C34-40AB-B0B3-7D1C900B862A>