Re: RPi 4 build time

From: Mark Millard via freebsd-arm <freebsd-arm_at_freebsd.org>
Date: Fri, 21 May 2021 22:51:35 UTC
On 2021-May-21, at 15:26, tech-lists <tech-lists at zyxst.net> wrote:

> On Fri, May 21, 2021 at 11:07:35PM +0300, Evgeniy Khramtsov via freebsd-arm wrote:
> 
>> How long are compile times for aarch64 8 GB RPi? It is especially
>> interesting to know about overclocked results. I guess buildworld time
>> would describe it well, but any heavy port (ex. rust) would also be great.
> 
> It depends. I've got it down to about 4 1/2 hrs for the
> buildworld/buildkernel steps. But this is after all this has been done:
> 
> for stable/13:
> 
> 1. configuration and use of devel/ccache-static
> 2. clocking to 2.0 GHz with the following config.txt:
> 
> [...]
> % less /boot/msdos/config.txt arm_control=0x200
> dtparam=audio=on,i2c_arm=on,spi=on
> dtoverlay=mmc
> dtoverlay=pwm
> dtoverlay=disable-bt
> device_tree_address=0x4000
> kernel=u-boot.bin
> over_voltage=6
> arm_freq=2000
> sdram_freq_min=3200
> 
> *make SURE you have good cooling!!!!!* I have a flirc rpi4 case on this
> one.
> 
> 3. /usr/obj /usr/src and /var/cache/ccache on zfs on usb3-connected
> spinning rust
> 
> 4. /tmp as tmpfs (512mb)
> 
> 5. make -j6 buildworld && make -j6 buildkernel (after make -j10 cleanworld && make -j10 cleandir && make -j10 clean)
> 
> 6. having *already built* a new world and kernel and installed it all and
> rebooted, which had been built with the following /etc/src.conf :

So, if I read this right, you are reporting 4.5 hrs
for a "hot ccache" result, which I had mentioned as
one of the things leading to large variations in
reported build times.

But I've not done those experiments and so could not
report examples. Thanks for doing so.

> [...]
> WITH_MALLOC_PRODUCTION=
> WITHOUT_DEBUG_FILES=
> WITH_CCACHE_BUILD=
> WITH_OPENSSL_KTLS=
> 
> WITHOUT_APM=
> WITHOUT_ASSERT_DEBUG=
> WITHOUT_BLUETOOTH=
> WITHOUT_CUSE=
> WITHOUT_DICT=                                                                                                  WITHOUT_DMAGENT=                                                                                               WITHOUT_FLOPPY=                                                                                                WITHOUT_FREEBSD_UPDATE=                                                                                        WITHOUT_HAST=                                                                                                  WITHOUT_IPFILTER=                                                                                              WITHOUT_IPFW=                                                                                                  WITHOUT_ISCSI=                                                                                                 WITHOUT_KERNEL_SYMBOLS=                                                                                        WITHOUT_LLVM_TARGET_ALL=                                                                                       WITH_LLVM_TARGET_AARCH64=                                                                                      WITH_LLVM_TARGET_ARM=
> WITHOUT_LPR=
> WITHOUT_NDIS=
> WITHOUT_NETGRAPH=
> WITHOUT_NIS=
> WITHOUT_OFED=
> WITHOUT_PORTSNAP=
> WITHOUT_PPP=
> WITHOUT_RADIUS_SUPPORT=
> WITH_RATELIMIT=
> WITHOUT_RBOOTD=
> WITHOUT_ROUTED=
> WITH_SORT_THREADS=
> WITH_SVN=
> WITHOUT_TALK=
> WITHOUT_TESTS=
> WITHOUT_TFTP=
> WITHOUT_UNBOUND=
> #
> CFLAGS.clang+= -mcpu=cortex-a72
> CXXFLAGS.clang+= -mcpu=cortex-a72
> CPPFLAGS.clang+= -mcpu=cortex-a72
> ACFLAGS.arm64cpuid.S+= -mcpu=cortex-a72+crypto
> ACFLAGS.aesv8-armx.S+= -mcpu=cortex-a72+crypto
> ACFLAGS.ghashv8-armx.S+= -mcpu=cortex-a72+crypto

And the above points out that I also forgot
to mention the configuration selections as
a source of large variations --and to report
on what I used. I'll list that after the rest
of your message. I do avoid building the llvm
material for targeting MIPS, POWERPC, RISCV,
and X86. That is another fairly large block
of time avoided to get my "no hot ccache"
times that I reported.

> (and afterwards, make check-old (then) yes | make delete-old then yes|
> make delete-old-libs) then 
> 7. with the following in /etc/sysctl.conf :
> vfs.read_max=128 
> With regard to building ports (I use poudriere-devel) with jobs=4 I see
> the following build times for the largest five ports built subsequently:
> 
> rust-1.51.0 took 7hrs 46mins
> doxygen-1.9.1,2 took 1hr 36mins
> texlive-texmf-20150523_4 took 1hr 36mins
> llvm10-10.0.1_5 took 1hr 4mins
> binutils-2.33.1_4,1 took 57mins 37s
> 
> The poudriere jail instance for this rpi4 uses the same /usr/src as what
> has built the OS. This means it was built with the same /etc/src.conf
> parameters.
> 
> My other rpi4 (runs main/14, currently I'm testing it) will clock to 2.1GHz. I've not thoroughly tested buildtimes there yet.
> 
> I forgot to mention both my stable/13 rpi4 and main/14rpi4 run powerd
> with these lines in /etc/rc.conf:
> 
> powerd_enable="YES"
> powerd_flags="-r 1"

My build configuration file content:

# more ~/src.configs/src.conf.CA72-nodbg-clang.aarch64-host 
TO_TYPE=aarch64
#
KERNCONF=GENERIC-NODBG-CA72
TARGET=arm64
.if ${.MAKE.LEVEL} == 0
TARGET_ARCH=${TO_TYPE}
.export TARGET_ARCH
.endif
#
WITH_SYSTEM_COMPILER=
WITH_SYSTEM_LINKER=
#
WITH_ELFTOOLCHAIN_BOOTSTRAP=
#Disables avoiding bootstrap: WITHOUT_LLVM_TARGET_ALL=
WITH_LLVM_TARGET_AARCH64=
WITH_LLVM_TARGET_ARM=
WITHOUT_LLVM_TARGET_MIPS=
WITHOUT_LLVM_TARGET_POWERPC=
WITHOUT_LLVM_TARGET_RISCV=
WITHOUT_LLVM_TARGET_X86=
WITH_CLANG=
WITH_CLANG_IS_CC=
WITH_CLANG_FULL=
WITH_CLANG_EXTRAS=
WITH_LLD=
WITH_LLD_IS_LD=
WITH_LLDB=
#
WITH_BOOT=
#
#
WITHOUT_WERROR=
MALLOC_PRODUCTION=
WITH_MALLOC_PRODUCTION=
WITHOUT_ASSERT_DEBUG=
WITHOUT_LLVM_ASSERTIONS=
#
# Avoid stripping but do not control host -g status as well:
DEBUG_FLAGS+=
#
WITH_REPRODUCIBLE_BUILD=
WITH_DEBUG_FILES=
#
# Use of the .clang 's here avoids
# interfering with other C<?>FLAGS
# usage, such as ?= usage.
CFLAGS.clang+= -mcpu=cortex-a72
CXXFLAGS.clang+= -mcpu=cortex-a72
CPPFLAGS.clang+= -mcpu=cortex-a72
ACFLAGS.arm64cpuid.S+=  -mcpu=cortex-a72+crypto
ACFLAGS.aesv8-armx.S+=  -mcpu=cortex-a72+crypto
ACFLAGS.ghashv8-armx.S+=        -mcpu=cortex-a72+crypto


NOTE: in the above file, sometimes the notes have not
been checked for a change of status in a long time.
They just report what lead to the way things were done
at the time they were first done that way.

FYI: I do not run powerd.

I've had heat sinks, fans, cases, and good 5.1V 3.5A
power supplies for all the RPi4B's that I had access
to.

===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)