g+
g+ Communities
Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014 
<== Date ==> <== Thread ==>

Subject: Re: Problems with parallel make on seq-2-1-7
From: Andrew Johnson <anj@aps.anl.gov>
To: tech-talk@aps.anl.gov
Date: Fri, 6 Jul 2012 10:41:00 -0500
Hi Benjamin,

On 2012-07-06 Benjamin Franksen wrote:
> 
> Exactly. This time the problem is in RULES.Db:
> 
> $(COMMON_DIR)/%Record.h: $(COMMON_DIR)/%Record.dbd
> 	@$(RM) $(notdir $@)$(DEP)
> 	@$(DBDDEPENDS_CMD)
> 	echo "$< : ../Makefile" >> $(notdir $@)$(DEP)
> 	@$(RM) $(notdir $@)
> 	$(DBTORECORDTYPEH) $(DBDFLAGS) $< $(notdir $@)
> 	@$(MV) $(notdir $@) $@
> 
> (and five other similar rules in the same file).

There are lots of changes to the build and dependency rules in the 3.15 
branch; for example the above rule is replaced by these:

%Record.h$(DEP): $(COMMON_DIR)/%Record.dbd
	@$(RM) $@
	@$(DBTORECORDTYPEH) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@
	@echo "$(COMMONDEP_TARGET): ../Makefile" >> $@

$(COMMON_DIR)/%Record.h: $(COMMON_DIR)/%Record.dbd
	@$(RM) $(notdir $@)
	$(DBTORECORDTYPEH) $(DBDFLAGS) -o $(notdir $@) $<
	@$(MV) $(notdir $@) $@

Unfortunately with the 3.15 rules it is sometimes necessary to manually add 
dependencies for the $(DEP) files to an application Makefile.  These replace 
the $(OBJ) dependency rule that Mark posted, so for parallel build to work 
properly with the 3.15 rules his example rule

vmeRecord$(OBJ): $(COMMON_DIR)/vmeRecord.h

will have to become

vmeRecord$(DEP): $(COMMON_DIR)/vmeRecord.h

or if you build multiple record types in the same source directory you could 
replace multiple copies of the above line with this pattern:

%Record$(DEP): $(COMMON_DIR)/%Record.h

These are necessary because the vmeRecord.d file can't be generated until the 
vmeRecord.h file exists.  vmeRecord.d tells GNUmake what files must be up to 
date before vmeRecord.o can be compiled; the .d file gets generated by passing 
vmeRecord.c through the C pre-processor with some special flags, and for that 
to find all of the header files referenced by the vmeRecord.c file we must 
have already converted the vmeRecord.dbd file into vmeRecord.h.

- Andrew
-- 
Never interrupt your enemy when he is making a mistake.
-- Napoleon Bonaparte

References:
RE: Problems with parallel make on seq-2-1-7 Mark Rivers
Re: Problems with parallel make on seq-2-1-7 Benjamin Franksen

Navigate by Date:
Prev: Problem in SNL santosh aditya
Next: RE: Problem in SNL Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014 
Navigate by Thread:
Prev: Re: Problems with parallel make on seq-2-1-7 Benjamin Franksen
Next: sequencer release 2.1.8 Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICSv4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·