ports/81085: Processing of "-jN" flags for "make" builds
Isaac
connectionlive at gmail.com
Mon May 16 00:10:10 UTC 2005
>Number: 81085
>Category: ports
>Synopsis: Processing of "-jN" flags for "make" builds
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Mon May 16 00:10:01 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Isaac
>Release: 5.3-RELEASE 5.4-RELEASE 6.0-CURRENT
>Organization:
>Environment:
FreeBSD bsd3.osfsir.org 5.4-RELEASE FreeBSD 5.4-RELEASE #0: Sun May 15 09:39:43 PDT 2005 root at bsd3.osfsir.org:/usr/obj/usr/src/sys/kernel5 i386
>Description:
Hi, I'm having problems building the many of the ports with dependencies like Xorg, KDE, etc., when I use the -j8 flag inline with "make" command or set in the environment or "/etc/make.conf". For example, if I want to build "xorg" port or any of it's dependency (xorg-client, xorg-libraries, etc) where the port in question requires other port(s)/package(s) that are not installed, it proceeds to build that dependant port. If the -j8 flag is sent via command line or set in the environment, the build of the dependant build port will fail because of an error:
cd: can't cd to <path/to/go/in>
However, I can successfully6 build the port without the use of -j8 flag using any of the following commands:
# make
# make install
# make install clean
# make clean && FORCE_PKG_REGISTER=1 make install clean
# make clean && make install clean
Or in the bash shell:
# for bldport in <list of full path, like /usr/ports/x11/xorg, of ports to build >; do cd $bldport; FORCE_PKG_REGISTER=1 make install clean; done;
**** The breakdown approach:
If I did each step separately,
# cd /usr/ports/x11/xorg-clients
# make clean
# make extract
# make patch
# make configure
# make -j8 build or # make build -j8
I didn't get the "can't cd to" error but I got another error:
/usr/bin/ld: cannot find -llisp
Which the
# make -j8 configure
failed during the changing of the directory. But if I just do
# make build (without the -j8 flag)
it builds fine which brings back to all the in one step:
# make
**** On another note:
I've successfully with ccache and distcc running:
# cd /usr/src
# make -j12 buildkernel KERNCONF=kernel5
on 5.3-RELEASE and 5.4-RELEASE and on 6.0-CURRENT,
# make -j12 buildkernel KERNCONF=kernel6
The -j flag used in buildworld works too but buildworld opened a large can of worms with errors from Heimdal/Kerberos, and others (I can't remember off the top of my head). Buildworld is beyond this scope anyway... ;)
I have 3 systems running FreeBSD 5.3-RELEASE, 5.4-RELEASE, & 6.0-CURRENT. The use of -j8 flag on any of these systems will fail even if it's fresh minimal install and port build the rest. I have ccache and distcc running on all 3 systems. The use of -j8 flag will still fail even if I disabled both ccache and distcc via environment setting NOCCACHE=1 and removing the masquerated directories from the path. This can be confirmed that both ccache and distcc are not running when the make build happens, via ccache -s and DISTCC_VERBOSE=1.
I've read both the online man (pages) and the handbook regarding the use of -j flag. According the the man page, if the -j flag is not specified via command line or environment, the -B flag will be used which is sequential (1 job) processing. I've tried to understand port build process of handling the -j flag by reading the main.c in /usr/src/usr.bin/make and reading the bsd.port*.mk files in /usr/ports/Mk but I'm not having much luck since I'm a BSD n00b :( and haven't done much C/C++ programming in ages. If more information is needed, I'll try to provide as much as I can including dmesg, script capture of screen output, etc.
I really want to make full use of the -j flag for time saving (via SMP or parallel/distributing computing/compiling) since I want to start developing on FreeBSD :D.
Thanks,
Isaac
BSD n00b in the learning process
NOTE: The use of the -j flag will fail even if the port/package is already installed. All compilations are done as root and the compilers:
CC, cc, gcc, g++, c++
are version 3.4.2 [FreeBSD] 20040728
>How-To-Repeat:
# cd /usr/ports/x11/xorg-clients
then
# make clean
# make -j8 <<< even -j2 will fail
or
# make clean && make -j8
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list