epics-modules / std

APS BCDA synApps module:
http://epics-modules.github.io/std/
Other
5 stars 9 forks source link

seeking help with std module compile error: "DBD files must be combined in the correct order" #18

Closed LeeYangLBLBCS closed 2 years ago

LeeYangLBLBCS commented 2 years ago

I'd like to add std module to ADSimDectector, but got the following error. base-7.0.6.1 ADSimDetector 2-0 std-R3-6-3 ================modified iocs/simDetectorIOC/simDetectorApp/src/Makefile=============== TOP=../.. include $(TOP)/configure/CONFIG

----------------------------------------



# The following gets rid of the -fno-implicit-templates flag on vxWorks, 
# so we get automatic template instantiation.
# This is what we want for miscellaneous/asynPortDriver.cpp
ifeq (vxWorks,$(findstring vxWorks, $(T_A)))
CODE_CXXFLAGS=
endif

PROD_NAME = simDetectorApp
PROD_IOC = $(PROD_NAME)

# <name>.dbd will be created from <name>Include.dbd
DBD += $(PROD_NAME).dbd
$(PROD_NAME)_DBD += simDetectorSupport.dbd
$(PROD_NAME)_DBD += stdSupport.dbd

# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
PROD_SRCS_DEFAULT += $(PROD_NAME)_registerRecordDeviceDriver.cpp $(PROD_NAME)Main.cpp
PROD_SRCS_vxWorks += $(PROD_NAME)_registerRecordDeviceDriver.cpp

PROD_LIBS += simDetector
PROD_LIBS += std

include $(ADCORE)/ADApp/commonDriverMakefile

#=============================

include $(TOP)/configure/RULES
#----------------------------------------
#  ADD RULES AFTER THIS LINE

================================================================
make -C O.linux-x86_64 -f ../Makefile TOP=../../.. \
    T_A=linux-x86_64 install
make[5]: Entering directory '/opt/epics/modules/support/areaDetector-R3-12-1/ADSimDetector/iocs/simDetectorIOC/simDetectorApp/src/O.linux-x86_64'
/usr/bin/g++  -D_GNU_SOURCE -D_DEFAULT_SOURCE           -D_X86_64_  -DUNIX  -Dlinux      -O3 -g   -Wall      -mtune=generic      -m64  -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/gcc -I../../../include/os/Linux -I../../../include   -I../../../../../include      -I/opt/epics/base-7.0.6.1/../modules/support/asyn-R4-43/include     -I/opt/epics/base-7.0.6.1/../modules/support/areaDetector-R3-12-1/ADSupport/include/os/Linux -I/opt/epics/base-7.0.6.1/../modules/support/areaDetector-R3-12-1/ADSupport/include   -I/opt/epics/base-7.0.6.1/../modules/support/areaDetector-R3-12-1/ADCore/include  -I/opt/epics/base-7.0.6.1/../modules/support/autosave-R5-10/include/os/Linux -I/opt/epics/base-7.0.6.1/../modules/support/autosave-R5-10/include   -I/opt/epics/base-7.0.6.1/../modules/support/busy-R1-7-2/include   -I/opt/epics/base-7.0.6.1/../modules/support/calc-R3-7-4/include   -I/opt/epics/base-7.0.6.1/../modules/support/seq-2-2-7/include   -I/opt/epics/base-7.0.6.1/../modules/support/sscan-R2-11-5/include  -I/opt/epics/base-7.0.6.1/../modules/support/iocStats-3-1-16/include/os/Linux -I/opt/epics/base-7.0.6.1/../modules/support/iocStats-3-1-16/include   -I/opt/epics/base-7.0.6.1/../modules/support/std-R3-6-3/include   -I/opt/epics/base-7.0.6.1/../modules/support/scaler-4-0/include -I/opt/epics/base-7.0.6.1/include/compiler/gcc -I/opt/epics/base-7.0.6.1/include/os/Linux -I/opt/epics/base-7.0.6.1/include        -MM -MF simDetectorAppMain.d  ../simDetectorAppMain.cpp
Creating dbd file simDetectorApp.dbd
perl -CSD /opt/epics/base-7.0.6.1/bin/linux-x86_64/dbdExpand.pl   -I. -I.. -I../O.Common -I../../../dbd -I../../../../../dbd -I/opt/epics/base-7.0.6.1/../modules/support/asyn-R4-43/dbd -I/opt/epics/base-7.0.6.1/../modules/support/areaDetector-R3-12-1/ADCore/dbd -I/opt/epics/base-7.0.6.1/../modules/support/autosave-R5-10/dbd -I/opt/epics/base-7.0.6.1/../modules/support/busy-R1-7-2/dbd -I/opt/epics/base-7.0.6.1/../modules/support/calc-R3-7-4/dbd -I/opt/epics/base-7.0.6.1/../modules/support/seq-2-2-7/dbd -I/opt/epics/base-7.0.6.1/../modules/support/sscan-R2-11-5/dbd -I/opt/epics/base-7.0.6.1/../modules/support/iocStats-3-1-16/dbd -I/opt/epics/base-7.0.6.1/../modules/support/std-R3-6-3/dbd -I/opt/epics/base-7.0.6.1/../modules/support/scaler-4-0/dbd -I/opt/epics/base-7.0.6.1/dbd -o simDetectorApp.dbd simDetectorSupport.dbd stdSupport.dbd base.dbd NDPluginSupport.dbd ADSupport.dbd NDFileNull.dbd NDFileNetCDF.dbd NDFileMagick.dbd NDFileTIFF.dbd NDFileNexus.dbd NDFileHDF5.dbd NDFileJPEG.dbd asyn.dbd asSupport.dbd busySupport.dbd calcSupport.dbd devIocStats.dbd sscanSupport.dbd
dbdExpand.pl: Device 'Time of Day' refers to unknown record type 'stringin'.
    DBD files must be combined in the correct order.
Context: file '/opt/epics/base-7.0.6.1/../modules/support/std-R3-6-3/dbd/stdSupport.dbd'
  while reading 'stdSupport.dbd' to create 'simDetectorApp.dbd'
dbdExpand.pl: Exiting due to errors
make[5]: *** [/opt/epics/base-7.0.6.1/configure/RULES.Db:405: ../O.Common/simDetectorApp.dbd] Error 255
make[5]: Leaving directory '/opt/epics/modules/support/areaDetector-R3-12-1/ADSimDetector/iocs/simDetectorIOC/simDetectorApp/src/O.linux-x86_64'
make[4]: *** [/opt/epics/base-7.0.6.1/configure/RULES_ARCHS:58: install.linux-x86_64] Error 2
make[4]: Leaving directory '/opt/epics/modules/support/areaDetector-R3-12-1/ADSimDetector/iocs/simDetectorIOC/simDetectorApp/src'
make[3]: *** [/opt/epics/base-7.0.6.1/configure/RULES_DIRS:85: src.install] Error 2
make[3]: Leaving directory '/opt/epics/modules/support/areaDetector-R3-12-1/ADSimDetector/iocs/simDetectorIOC/simDetectorApp'
make[2]: *** [/opt/epics/base-7.0.6.1/configure/RULES_DIRS:85: simDetectorApp.install] Error 2
make[2]: Leaving directory '/opt/epics/modules/support/areaDetector-R3-12-1/ADSimDetector/iocs/simDetectorIOC'
make[1]: *** [/opt/epics/base-7.0.6.1/configure/RULES_DIRS:85: simDetectorIOC.install] Error 2
make[1]: Leaving directory '/opt/epics/modules/support/areaDetector-R3-12-1/ADSimDetector/iocs'
make: *** [/opt/epics/base-7.0.6.1/configure/RULES_DIRS:85: iocs.install] Error 2
MarkRivers commented 2 years ago

You need to move this line:

$(PROD_NAME)_DBD += stdSupport.dbd

after this line:

include $(ADCORE)/ADApp/commonDriverMakefile

That is because commonDriverMakefile is what includes base.dbd, etc., and stdSupport.dbd needs to be included after base.dbd.

I am curious what you want to use from the std module?

LeeYangLBLBCS commented 2 years ago

thanks for the help. I wanted to use: doAfterIocInit(....) call in the st.cmd script. which requires std module. I havn't had trouble with base-7.0.4 including stdSupport.dbd this way, until I switched to base-7.0.6.1 recently.

MarkRivers commented 2 years ago

I havn't had trouble with base-7.0.4 including stdSupport.dbd this way, until I switched to base-7.0.6.1 recently.

I find that hard to believe. Are you sure you were doing that with areaDetector, which includes commonDriverMakefile? Those rules for the required order of dbd files have not changed for a long time.

LeeYangLBLBCS commented 2 years ago

I'll double check with base-7.0.4 build again.

On Fri, Apr 1, 2022 at 10:43 AM Mark Rivers @.***> wrote:

I havn't had trouble with base-7.0.4 including stdSupport.dbd this way, until I switched to base-7.0.6.1 recently.

I find that hard to believe. Are you sure you were doing that with areaDetector, which includes commonDriverMakefile? Those rules for the required order of dbd files have not changed for a long time.

— Reply to this email directly, view it on GitHub https://github.com/epics-modules/std/issues/18#issuecomment-1086174669, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSYGNAR7V6AOMZEZMVDSKTVC4YUNANCNFSM5SJI4ARQ . You are receiving this because you authored the thread.Message ID: @.***>

-- Lee Yang Lawrence Berkeley National Lab 1 Cyclotron Road, M/S 46R0161 Berkeley, California 97320 office:(510)486-7320 fax:(510) 486-4633

LeeYangLBLBCS commented 2 years ago

The only change I made is the lines related to stdSupport (in the wrong place).
I also attached the entire build output log file.
=====================iocs/simDetectorIOC/simDetectorApp/src/Makefile==============
TOP=../..
include $(TOP)/configure/CONFIG
#----------------------------------------
#  ADD MACRO DEFINITIONS AFTER THIS LINE

# The following gets rid of the -fno-implicit-templates flag on vxWorks, 
# so we get automatic template instantiation.
# This is what we want for miscellaneous/asynPortDriver.cpp
ifeq (vxWorks,$(findstring vxWorks, $(T_A)))
CODE_CXXFLAGS=
endif

PROD_NAME = simDetectorApp
PROD_IOC = $(PROD_NAME)

# <name>.dbd will be created from <name>Include.dbd
DBD += $(PROD_NAME).dbd
$(PROD_NAME)_DBD += simDetectorSupport.dbd
$(PROD_NAME)_DBD += stdSupport.dbd

# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
PROD_SRCS_DEFAULT += $(PROD_NAME)_registerRecordDeviceDriver.cpp $(PROD_NAME)Main.cpp
PROD_SRCS_vxWorks += $(PROD_NAME)_registerRecordDeviceDriver.cpp

PROD_LIBS += simDetector
PROD_LIBS += std

include $(ADCORE)/ADApp/commonDriverMakefile

#=============================

include $(TOP)/configure/RULES
#----------------------------------------
#  ADD RULES AFTER THIS LINE

[compile_output.txt](https://github.com/epics-modules/std/files/8400466/compile_output.txt)
MarkRivers commented 2 years ago

Your build with 7.0.4 actually had errors on lines 413,414,417,418,434, and 435, but they were not fatal:

Device using unknown record type 'stringin', declaration created
Device using unknown record type 'ai', declaration created

It looks like base 7.0.6 has made those fatal?

LeeYangLBLBCS commented 2 years ago

Yes I also noticed those, but ignored them since IOC runs starts up normal.

The error from 7.0.6.1 looks like a different kind.

On Fri, Apr 1, 2022, 1:13 PM Mark Rivers @.***> wrote:

Your build with 7.0.4 actually had errors on lines 413,414,417,418,434, and 435, but they were not fatal:

Device using unknown record type 'stringin', declaration created Device using unknown record type 'ai', declaration created

It looks like base 7.0.6 has made those fatal?

— Reply to this email directly, view it on GitHub https://github.com/epics-modules/std/issues/18#issuecomment-1086285657, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSYGNCNZJMXUV65VXWN76TVC5KHDANCNFSM5SJI4ARQ . You are receiving this because you authored the thread.Message ID: @.***>

MarkRivers commented 2 years ago

I think 7.0.6.1 is reporting the same error, that you are using the stringin and ai records before they are defined. It is just being treated as a fatal error in 7.0.6.1, while it was a warning in 7.0.4.

You really do need to include dbd files in the correct order, starting with base.dbd.

LeeYangLBLBCS commented 2 years ago

thanks.