EPICS Home

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  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Build problem with db dependencies
From: Bruce Hill <[email protected]>
To: Gougnaud Françoise <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Tue, 27 Mar 2012 20:48:33 -0700
Hi Francoise,
Your vpath line in RULES.Db should look like this:
vpath %.db $(USR_VPATH) $(GENERIC_SRC_DIRS) $(dir $(DB)) $(RELEASE_DIRS_DB)

with RELEASE_DIRS_DB defined in CONFIG_APP_INCLUDE as
RELEASE_DIRS_DB  += $$(wildcard $$(strip $$($(1)))/db)

I've also attached a patch file with all the changes needed for this
to work for db files, dbd files, and template files.
You should be able to apply the patch from your base $TOP/configure directory via

% patch -i db-dependencies.patch

Regards,
- Bruce


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 : [email protected] [mailto:[email protected]] De la part de Bruce Hill
Envoyé : mercredi 21 mars 2012 23:57
À : [email protected]
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 : [email protected]
[mailto:[email protected]] De la part de Ralph Lange
Envoyé : mardi 20 mars 2012 08:47 À : [email protected] 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";' $<   >   [email protected]
          $(MV) [email protected] $@

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<[email protected]>   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: [email protected]
[mailto:[email protected]] On Behalf Of Bruce Hill
Sent: Saturday, 18 February 2012 11:31 AM
To: [email protected]
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

--- CONFIG_APP_INCLUDE	2012-03-27 20:32:21.807077824 -0700
+++ CONFIG_APP_INCLUDE	2012-03-21 13:56:56.003176136 -0700
@@ -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)) ))
--- RULES.Db	2012-03-27 20:32:21.848076956 -0700
+++ RULES.Db	2012-03-21 13:56:56.007176052 -0700
@@ -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)

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: Re: About "dbCaMonitorLink" ? jun-ichi.odagiri
Next: Re: Proposed support for additional Modbus data types haquin
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: Build problem with db dependencies Gougnaud Françoise
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  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024