Yes - the reason is: parallell make (make -j) is not supported for ports.ph0enix said:I have a quad-core system so I've tried using "make -j5 install distclean" with a few ports but most of them fail to compile that way. They compile fine with just "make install distclean". Is there a reason for this?
tingo said:Yes - the reason is: parallell make (make -j) is not supported for ports.
Think about it - there are well over 19000 (almost 20000 now) ports in the ports collection, and they use many different methods for building and installing. Even if we (FreeBSD users and developers) hda all the manpower we wanted, getting the ports to support parallel building and install would be almost impossible.
I suggest you do something more productive or fun the next time you compile a port; play a game, read a book or surf the net.
.if !(make(*install) || make(package))
MAKE_ARGS+=-j4
.endif
ph0enix said:Should I use -j4 or -j5 for a quad-core system? I always thought that the formula was:
number of CPUs +1
Is this not right?
vermaden said:Depends, you need to measure it, I would set it to 2 x CORES count, I remember I measured once time buildworld with -j and I got best results (fastest) with 4-5 jobs at dual core system, so I will set 8-9 at quad core.
ph0enix said:Can I test with buildkernel instead of buildworld? It'll be "a little" faster.
vermaden said:Yes, of course.
.if !empty(.CURDIR:M*/x11/kdebase3)
FORCE_MAKE_JOBS=yes
.endif
FORCE_MAKE_JOBS=yes
# These I know to be unsafe
UNSAFE_PORTS =audio/libsndfile
UNSAFE_PORTS+=audio/nas
UNSAFE_PORTS+=audio/xfce4-mixer
UNSAFE_PORTS+=devel/doxygen
UNSAFE_PORTS+=devel/gperf
UNSAFE_PORTS+=devel/libthai
UNSAFE_PORTS+=devel/nasm
UNSAFE_PORTS+=devel/pth
UNSAFE_PORTS+=devel/dbus-qt4
UNSAFE_PORTS+=editors/vim
UNSAFE_PORTS+=games/falconseye
UNSAFE_PORTS+=graphics/libart_lgpl
UNSAFE_PORTS+=lang/lua50
UNSAFE_PORTS+=lang/ocaml
UNSAFE_PORTS+=misc/e2fsprogs-libuuid
UNSAFE_PORTS+=net-mgmt/net-snmp
UNSAFE_PORTS+=print/ghostscript8
UNSAFE_PORTS+=security/libgpg-error
UNSAFE_PORTS+=security/nss
UNSAFE_PORTS+=textproc/xerces-c2
UNSAFE_PORTS+=www/lynx
UNSAFE_PORTS+=x11-clocks/kdetoys3
# Apply disabling make jobs
.for port in ${UNSAFE_PORTS}
.if !empty(.CURDIR:M*/${port})
DISABLE_MAKE_JOBS=yes
.endif
.endfor
Mel_Flynn said:pav@ committed initial support for parallel builds. See this PR for details.
At present it works as opt-in on a per port basis, meaning the port maintainer has to set MAKE_JOBS_SAFE in the Makefile to enable parallel builds. When set, the number of jobs is set to the number of cores in the machine, specifically the output of sysctl -n kern.smp.cpus....