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: Build problem with db dependencies
From: Bruce Hill <bhill@slac.stanford.edu>
To: Gougnaud Françoise <francoise.gougnaud@cea.fr>
Cc: "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Wed, 28 Mar 2012 14:28:12 -0700
Hi Yves,
I've also seen this problem, but only with a handful of IOC's,
so I've been addressing it locally.    Near the top of your
Db/Makefile, after including $(TOP)/configure/CONFIG, try
adding the following line:

USR_VPATH += $(COMMON_DIR)

Adding $(TOP)/db to the vpath causes circular dependency
problems, but these generated db files are first created in
O.Common, which can be added to vpath without the circular
dependency.

I didn't add $(COMMON_DIR) to the vpath definition under
base as it seemed to be fairly rare at the time.    I've subsequently
done this for a couple more IOC's.   If you and others are also
seeing this, we may want to just add $(COMMON_DIR) to
the base vpath.

Regards,
- Bruce

P.S.  This may also explain why Francoise had trouble getting
my patch to solve his problem.


On 03/27/2012 01:45 AM, Gougnaud Françoise wrote:
Hi,

I tried to understand what difference between 3.14.12 and 3.14.12.2 could explain the emergence of this db dependencies problem.

If I look at the dependencies file (O.linux-x86/dbfile.db.d) generated by makeDbDepends.pl, with 3.14.12 this file contains no dependency while it contains all the db dependencies with 3.14.12.2. In fact the script makeDbDepends.pl has been changed. And the problem arises because the script now works!

Then I tried to modify the file RULES.Db so that the make command looks for db dependencies in $(TOP)/db:

-vpath %.db $(USR_VPATH) $(GENERIC_SRC_DIRS) $(dir $(DB))
+vpath %.db $(USR_VPATH) $(GENERIC_SRC_DIRS) $(dir $(DB)) $(TOP)/db

But this creates a circular dependency problem and it doesn't work.

I hope this problem will be solved. Meanwhile I run 'make rebuild' as suggested by Emma. I could also remove the dependencies file.

Regards,
Françoise.

-----Message d'origine-----
De : tech-talk-bounces@aps.anl.gov [mailto:tech-talk-bounces@aps.anl.gov] De la part de Bruce Hill
Envoyé : mercredi 21 mars 2012 23:57
À : tech-talk@aps.anl.gov
Objet : Re: Build problem with db dependencies

Hi Francoise,
Actually, now that you mention it, I only noticed this problem after I merged the 3.14.12.2 updates and the rules-db patch into our 3.14.12 base.

I haven't tried Ralph's one-liner perl fix, but the patch I
posted 2/17 works with our 3.14.12.2.   Just be sure to
get it from the original 2/17 post, as the quoted version in the replies below has extra linefeeds from being wrapped.

If it still doesn't work for you, take a look at the<db_substitution_filename_root>.db.d files created in the O.<target_arch>   directory.

It may also help to see what the generated RELEASE_DIRS_DB variable looks like, which you can do by adding these lines to the end of your Db/Makefile.

# After the include of $(TOP)/configure/RULES
install:   showvars
showvars:
       @echo RELEASE_DIRS_DB=$(RELEASE_DIRS_DB)

The character before the "@" must be a tab.
Then "make" or "make install" will print the value of RELEASE_DIRS_DB which should be a list of all the target db directories for the modules your ioc depends on.

If all else fails, try "make -d>   make.log" and examine the resulting make.log file which should show make searching for the missing db template in each directory on it's vpath.
That vpath should include the directories in $(RELEASE_DIRS_DB).

Regards,
- Bruce


On 03/21/2012 01:37 AM, Gougnaud Françoise wrote:
Hi,
I have exactly the same problem since I started using EPICS Base R3.14.12.2. I never had this problem before with R3.14.12.

None of the solutions discussed here works with R3.14.12.2. I also applied the patch contained in the R3.14.12.2 known problems without success.

Cheers,

-----Message d'origine-----
De : tech-talk-bounces@aps.anl.gov
[mailto:tech-talk-bounces@aps.anl.gov] De la part de Ralph Lange
Envoyé : mardi 20 mars 2012 08:47 À : tech-talk@aps.anl.gov Objet :
Re: Build problem with db dependencies

You can also try creating the dependencies correctly, e.g. by putting

$(COMMON_DIR)/%.db$(RAW)$(DEP): %.substitutions
          @$(RM) $@
          $(PERL) -e 'undef $$/; $$_=<>;
@d=m/(?:^|})\s*file\s+\"?([^\"{\s]*)\s*\{/mg; print
"$(COMMON_DIR)/$*.db$(RAW): @d\n";' $<   >   $@.tmp
          $(MV) $@.tmp $@

or something functionally equivalent into your RULES file.

Amazing how perl turns everything into an obvious one-liner, isn't it?

Cheers,
~Ralph


On Tue Mar 20 2012 07:00:45 GMT+0100 (CET), Emma Shepherd<Emma.Shepherd@synchrotron.org.au>   wrote:
Hi Bruce,

Good timing - I just ran into the same problem today!  I agree, it's a pain to have to run 'make rebuild' every time.  Thanks for the patch, that works for me too.

Cheers,

Emma

-----Original Message-----
From: tech-talk-bounces@aps.anl.gov
[mailto:tech-talk-bounces@aps.anl.gov] On Behalf Of Bruce Hill
Sent: Saturday, 18 February 2012 11:31 AM
To: tech-talk@aps.anl.gov
Subject: Build problem with db dependencies

Has anyone else run into a build dependency problem with base-3,14,12?

What I've been finding is that I can build an IOC or module that
depends on *.db or *.template files from another module successfully
the first time, but it fails on subsequent builds.

Example build output:
% make
perl /reg/g/pcds/package/epics/3.14/base/R3.14.12-0.4.0/bin/linux-x86_64/makeMakefile.pl O.linux-x86_64 ../../..
perl /reg/g/pcds/package/epics/3.14/base/R3.14.12-0.4.0/bin/linux-x86_64/makeMakefile.pl O.RTEMS-beatnik ../../..
perl /reg/g/pcds/package/epics/3.14/base/R3.14.12-0.4.0/bin/linux-x86_64/makeMakefile.pl O.linux-x86 ../../..
mkdir O.Common
/usr/bin/make -C O.linux-x86_64 -f ../Makefile TOP=../../..
T_A=linux-x86_64 install
make[1]: Entering directory `/reg/neh/home/bhill/wa2/epics/iocTest/test-R3.14.12/evr1/myEvrApp/Db/O.linux-x86_64'
perl
/reg/g/pcds/package/epics/3.14/base/R3.14.12-0.4.0/bin/linux-x86_64/m
a keDbDepends.pl ../O.Common/iocAdmin.db ../iocAdmin.substitutions>>
iocAdmin.db.d echo "../O.Common/iocAdmin.db : ">>   iocAdmin.db.d Inflating database from ../iocAdmin.substitutions
/reg/g/pcds/package/epics/3.14/extensions/current/bin/linux-x86/msi   -I. -I.. -I../O.Common -I ../../../db     -I/reg/g/pcds/package/epics/3.14/base/R3.14.12-0.4.0/db     -I/reg/g/pcds/package/epics/3.14/modules/autosave/R4.2.1.2-2.7.0/db -I/reg/g/pcds/package/epics/3.14/modules/iocAdmin/R3.0.0-1.6.0/db -I/reg/neh/home/bhill/wa2/trunk/pcds/epics/modules/event/current/db  -S../iocAdmin.substitutions>   iocAdmin.tmp
mv iocAdmin.tmp ../O.Common/iocAdmin.db perl
/reg/g/pcds/package/epics/3.14/base/R3.14.12-0.4.0/bin/linux-x86_64/m
a keDbDepends.pl ../O.Common/evr.db ../evr.substitutions>>   evr.db.d
echo "../O.Common/evr.db : ">>   evr.db.d Inflating database from ../evr.substitutions
/reg/g/pcds/package/epics/3.14/extensions/current/bin/linux-x86/msi   -I. -I.. -I../O.Common -I ../../../db     -I/reg/g/pcds/package/epics/3.14/base/R3.14.12-0.4.0/db     -I/reg/g/pcds/package/epics/3.14/modules/autosave/R4.2.1.2-2.7.0/db -I/reg/g/pcds/package/epics/3.14/modules/iocAdmin/R3.0.0-1.6.0/db -I/reg/neh/home/bhill/wa2/trunk/pcds/epics/modules/event/current/db  -S../evr.substitutions>   evr.tmp
mv evr.tmp ../O.Common/evr.db
Installing created db file ../../../db/iocAdmin.db Installing created
db file ../../../db/evr.db
make[1]: Leaving directory `/reg/neh/home/bhill/wa2/epics/iocTest/test-R3.14.12/evr1/myEvrApp/Db/O.linux-x86_64'
/usr/bin/make -C O.RTEMS-beatnik -f ../Makefile TOP=../../..
T_A=RTEMS-beatnik install
make[1]: Entering directory `/reg/neh/home/bhill/wa2/epics/iocTest/test-R3.14.12/evr1/myEvrApp/Db/O.RTEMS-beatnik'
make[1]: Nothing to be done for `install'.
make[1]: Leaving directory `/reg/neh/home/bhill/wa2/epics/iocTest/test-R3.14.12/evr1/myEvrApp/Db/O.RTEMS-beatnik'
/usr/bin/make -C O.linux-x86 -f ../Makefile TOP=../../..
T_A=linux-x86 install
make[1]: Entering directory `/reg/neh/home/bhill/wa2/epics/iocTest/test-R3.14.12/evr1/myEvrApp/Db/O.linux-x86'
make[1]: Nothing to be done for `install'.
make[1]: Leaving directory `/reg/neh/home/bhill/wa2/epics/iocTest/test-R3.14.12/evr1/myEvrApp/Db/O.linux-x86'
(232) 04:29 PM
psusr115:~/wa2/epics/iocTest/test-R3.14.12/evr1/myEvrApp/Db
% make
/usr/bin/make -C O.linux-x86_64 -f ../Makefile TOP=../../..
T_A=linux-x86_64 install
make[1]: Entering directory `/reg/neh/home/bhill/wa2/epics/iocTest/test-R3.14.12/evr1/myEvrApp/Db/O.linux-x86_64'
make[1]: *** No rule to make target `ioc.db', needed by `../O.Common/iocAdmin.db'.  Stop.
make[1]: Leaving directory `/reg/neh/home/bhill/wa2/epics/iocTest/test-R3.14.12/evr1/myEvrApp/Db/O.linux-x86_64'
make: *** [install.linux-x86_64] Error 2

The first build succeeds because RELEASE_DBFLAGS has a list of -I
directives which includes the released iocAdmin module's db dir, so
msi is able to use that to successfully build my iocAdmin.db file.

The problem arises because the first build also creates a dependency
file for iocAdmin.db using makeDbDepends.pl that looks like this.

% cat O.linux-x86_64/iocAdmin.db.d
../O.Common/iocAdmin.db: ioc.db access.db iocCluster.db
../O.Common/iocAdmin.db :


Subsequent builds fail because ioc.db is over in the released
iocAdmin module's db dir, which doesn't end up on the vpath for .db files.

I think I have a fix for it, but I can't figure out why this hasn't
been a problem for us and others before now.

I'd like to avoid customizing my base configure files to the extent
possible, but these changes seem to fix the problem.

% svn diff
Index: CONFIG_APP_INCLUDE
===================================================================
--- CONFIG_APP_INCLUDE  (revision 8621)
+++ CONFIG_APP_INCLUDE  (working copy)
@@ -16,6 +16,8 @@
      RELEASE_INCLUDES += $$(addprefix -I,$$(wildcard $$(strip $$($(1)))/include))
      RELEASE_DBDFLAGS += $$(addprefix -I,$$(wildcard $$(strip $$($(1)))/dbd))
      RELEASE_DBFLAGS += $$(addprefix -I,$$(wildcard $$(strip
$$($(1)))/db))
+  RELEASE_DIRS_DBD += $$(wildcard $$(strip $$($(1)))/dbd)
+ RELEASE_DIRS_DB  += $$(wildcard $$(strip $$($(1)))/db)
      RELEASE_PERL_MODULE_DIRS += $$(wildcard $$($(1)_LIB)/perl)
    endef
    $(foreach top, $(RELEASE_TOPS), $(eval $(call
RELEASE_FLAGS_template,$(top)) ))
Index: RULES.Db
===================================================================
--- RULES.Db    (revision 8757)
+++ RULES.Db    (working copy)
@@ -11,10 +11,10 @@
    #####################################################  vpath

    vpath %.dbd $(USR_VPATH) $(GENERIC_SRC_DIRS) $(dir $(DBD)) -vpath
%.db $(USR_VPATH) $(GENERIC_SRC_DIRS) $(dir $(DB)) -vpath %.vdb
$(USR_VPATH) $(GENERIC_SRC_DIRS) $(dir $(DB))
+vpath %.db $(USR_VPATH) $(GENERIC_SRC_DIRS) $(dir $(DB))
+$(RELEASE_DIRS_DB) vpath %.vdb $(USR_VPATH) $(GENERIC_SRC_DIRS)
+$(dir
+$(DB)) $(RELEASE_DIRS_DBD)
    vpath %.substitutions $(USR_VPATH) $(GENERIC_SRC_DIRS)
$(COMMON_DIR) -vpath %.template $(USR_VPATH) $(GENERIC_SRC_DIRS)
$(COMMON_DIR)
+vpath %.template $(USR_VPATH) $(GENERIC_SRC_DIRS) $(COMMON_DIR)
+$(RELEASE_DIRS_DB)
    vpath bpt%.data $(USR_VPATH) $(GENERIC_SRC_DIRS) $(COMMON_DIR)
    vpath %.acf $(USR_VPATH) $(GENERIC_SRC_DIRS) $(COMMON_DIR)
    vpath %.acs $(USR_VPATH) $(GENERIC_SRC_DIRS) $(COMMON_DIR)


Any comments would be appreciated.
Thanks,
- Bruce


<br>This message and any attachments may contain proprietary or confidential information. If you are not the intended recipient or you received the message in error, you must not use, copy or distribute the message. Please notify the sender immediately and destroy the original message. Thank you.
--
Bruce Hill
Member Technical Staff
SLAC National Accelerator Lab
2575 Sand Hill Road M/S 10
Menlo Park, CA  94025


--
Bruce Hill
Member Technical Staff
SLAC National Accelerator Lab
2575 Sand Hill Road M/S 10
Menlo Park, CA  94025


References:
Build problem with db dependencies Bruce Hill
RE: Build problem with db dependencies Emma Shepherd
Re: Build problem with db dependencies Ralph Lange
RE: Build problem with db dependencies Gougnaud Françoise
Re: Build problem with db dependencies Bruce Hill
RE: Build problem with db dependencies Gougnaud Françoise

Navigate by Date:
Prev: Keithley 2400 Christian Roehrig
Next: Re: Keithley 2400 Feng Laurence
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: Build problem with db dependencies Bruce Hill
Next: Re: Build problem with db dependencies Bruce Hill
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 ·