[BRLTTY] Problems building with parallel make

Stepan Kasal kasal at ucw.cz
Fri Sep 12 15:36:36 EDT 2008


Hello,
  I have problems building brltty-3.9 in the Fedora build system,
which uses prallel make, in this case "make -j8".

The problem might be relevant to current version of brltty as well,
so I'm reporting it.

The error message was something like
   "ranlib:brlapi_client.o file not recognized"

I deduced that the problem might be a race condition between two
instances of make running in subdirectory Programs, both trying to
build target "api".

The second instance gets started trrough a nested make running in
BrailleDrivers/BrlAPI or BrailleDrivers/VisioBraille; in both of
these, Makefile.in calls target "brlapi".

A (cludge) fix is to add prerequisity "api" to braille-drivers, so
that it is built before the recursion starts.
(See the attached brltty-3.9-parallel.patch; I have verified that it
solves the issue.)

I checked the currnt svn tree, it seems that the whole bunch of
drivers is not built from "all" anymore.  But anyway, it still seems
safer to add the pre-requisite to the same place, to prevent
unppleasant surprises.  See the attached brltty-parallel.patch (not
tested at all).

You might want to add an explaining comment above that, I'm leaving
the decision on you.

("brlapi" is also called from Bindings/Python/Makefile.in, but "api"
is already a prerequisity of all-api-bindings.)

I hope this report is useful,
	Stepan Kasal
-------------- next part --------------
2008-09-12  Stepan Kasal  <skasal at redhat.com>

	* Programs/Makefile.in (braille-drivers): Depend on `api';
	without this, make -j8 failed, because some of the drivers
	call target `brlapi'.  Recursive make is harmful.

diff -up brltty-3.9/Programs/Makefile.in.parallel brltty-3.9/Programs/Makefile.in
--- brltty-3.9/Programs/Makefile.in.parallel	2007-10-17 17:19:24.000000000 +0200
+++ brltty-3.9/Programs/Makefile.in	2008-09-12 17:44:54.000000000 +0200
@@ -381,7 +381,7 @@ apitest.$O:
 
 ###############################################################################
 
-braille-drivers: txt2hlp
+braille-drivers: txt2hlp api
 	for driver in $(BRAILLE_EXTERNAL_DRIVER_NAMES); \
 	do (cd $(BLD_TOP)$(BRL_DIR)/$$driver && $(MAKE) braille-driver braille-help) || exit 1; \
 	done
-------------- next part --------------
2008-09-12  Stepan Kasal  <skasal at redhat.com>

	* Programs/Makefile.in (braille-drivers, all-braille): Add
	prerequisity `all' to prevent race of this make with nested
	"make brlapi" when parallel make is used.  Recursive make is
	harmful.

Index: Programs/Makefile.in
===================================================================
--- Programs/Makefile.in	(revision 3925)
+++ Programs/Makefile.in	(working copy)
@@ -416,12 +416,12 @@
 
 ###############################################################################
 
-braille-drivers: txt2hlp$X
+braille-drivers: txt2hlp$X api
 	for driver in $(BRAILLE_EXTERNAL_DRIVER_NAMES); \
 	do (cd $(BLD_TOP)$(BRL_DIR)/$$driver && $(MAKE) braille-driver braille-all) || exit 1; \
 	done
 
-all-braille: txt2hlp$X $(BRAILLE_DRIVERS)
+all-braille: txt2hlp$X api $(BRAILLE_DRIVERS)
 	for driver in $(BRAILLE_DRIVER_NAMES); \
 	do (cd $(BLD_TOP)$(BRL_DIR)/$$driver && $(MAKE) braille-all) || exit 1; \
 	done


More information about the BRLTTY mailing list