paulscherrerinstitute / s7plc

EPICS driver for communication with PLCs
GNU General Public License v3.0
6 stars 6 forks source link

Can't find file s7plc.dbd #5

Open jwlodek opened 3 years ago

jwlodek commented 3 years ago

Hello all,

this is my first time building s7plc as part of an automated pipeline we are working on for all the epics modules at NSLS2. I am building on RHEL 8, and when I clone the module into my support directory, edit the path in configure/RELEASE and run make, I get the following output:

[jwlodek@rhel8vm s7plc]$ make
If you are not using the PSI build environment, GNUmakefile can be removed.
make -C O.linux-x86_64 -f ../Makefile TOP=./.. \
    T_A=linux-x86_64 install
make[1]: Entering directory '/epics/src/support/s7plc/O.linux-x86_64'
Creating dbd file s7plcApp.dbd
perl -CSD /epics/src/base/bin/linux-x86_64/dbdExpand.pl   -I. -I.. -I../O.Common -I./../dbd -I/epics/src/base/dbd -o s7plcApp.dbd base.dbd s7plc.dbd
dbdExpand.pl: Can't find file 's7plc.dbd'
  while reading 's7plc.dbd' to create 's7plcApp.dbd'
  Your Makefile may need this dependency rule:
    $(COMMON_DIR)/s7plcApp.dbd: $(COMMON_DIR)/s7plc.dbd
dbdExpand.pl: Exiting due to errors
make[1]: *** [/epics/src/base/configure/RULES.Db:405: ../O.Common/s7plcApp.dbd] Error 2
make[1]: Leaving directory '/epics/src/support/s7plc/O.linux-x86_64'
make: *** [/epics/src/base/configure/RULES_ARCHS:58: install.linux-x86_64] Error 2

Likely I am just missing something since it is my first time. Base version is 7.0.5. Any help would be appreciated, Thanks!

dirk-zimoch commented 3 years ago

I have not tried this with EPICS 7 yet. Maybe I need to change something in the Makefile.

jwlodek commented 3 years ago

I was able to build the IOC application by editing the Makefile to the following:

TOP=.
# R3.14+
include $(TOP)/configure/CONFIG

# Want local functions non-static? Define DEBUG
#CFLAGS += -DDEBUG

# Suppress warning in EPICS 7
USR_CPPFLAGS += -DUSE_TYPED_RSET

# library

LIBRARY = s7plc
LIB_SRCS += drvS7plc.c
LIB_SRCS += devS7plc.c
HTMLS += s7plc.html
INSTALL_DBDS += $(INSTALL_DBD)/s7plcBase.dbd
INSTALL_DBDS += $(INSTALL_DBD)/s7plcCalcout.dbd
INSTALL_DBDS += $(INSTALL_DBD)/s7plcReg.dbd
# Uncomment this if you want a dynamically loadable module
#LIB_SRCS += s7plc_registerRecordDeviceDriver.cpp

# stand alone application program
PROD_DEFAULT = s7plcApp
PROD_vxWorks = -nil-
s7plcApp_SRCS += s7plcApp_registerRecordDeviceDriver.cpp
s7plcApp_SRCS += appMain.cc
s7plcApp_LIBS += s7plc
s7plcApp_LIBS += $(EPICS_BASE_IOC_LIBS)
s7plcApp_DBD += base.dbd
s7plcApp_DBD += s7plcBase.dbd
s7plcApp_DBD += s7plcCalcout.dbd
s7plcApp_DBD += s7plcReg.dbd
DBD += s7plcApp.dbd

include $(TOP)/configure/RULES

Though I am not sure if that would break compatibility with previous versions of EPICS base

jwlodek commented 3 years ago

I've put some time into re-organizing the module a bit to mimic some of the other epics modules I've been working with, the re-organized format builds OK on EPICS 7 as well. It is available on my fork

dkr-ri commented 2 years ago

Hello, everyone,

this is the first time i am building the s7plc with epics 7.0.6.1 and centos 8. Unfortunately, I get the following error message from the compiler. I downloaded the S7plc driver from jwlodek /s7plc. Since I very rarely work with epics, I always have a few difficulties at the beginning. I would be very grateful for hints on troubleshooting.

make[5]: Enter directory '/home/epics-ioc/epics-base/support/s7plc/iocs/s7plcIOC/s7plcApp/src/O.linux-x86_64' /usr/bin/g++ -o s7plcApp -L/home/epics-ioc/epics-base/support/s7plc/lib/linux-x86_64 -L/home/epics-ioc/epics-base/support/s7plc/iocs/ s7plcIOC/lib/linux-x86_64 -L/home/epics-ioc/epics-base/lib/linux-x86_64 -Wl,-rpath,/home/epics-ioc/epics-base/support/s7plc/lib/linux- x86_64 -Wl,-rpath,/home/epics-ioc/epics-base/support/s7plc/iocs/s7plcIOC/lib/linux-x86_64 -Wl,-rpath,/home/epics-ioc/epics-base/lib/ linux-x86_64 -rdynamic -m64 s7plcApp_registerRecordDeviceDriver.o s7plcAppMain.o -ls7plc -lcalc -ldbRecStd -ldbCore -lca -lCom s7plcApp_registerRecordDeviceDriver.o: In function __static_initialization_and_destruction_0': /home/epics-ioc/epics-base/support/s7plc/iocs/s7plcIOC/s7plcApp/src/O.linux-x86_64/s7plcApp_registerRecordDeviceDriver.cpp:107: undefined reference topvar_rset_swaitRSET' /home/epics-ioc/epics-base/support/s7plc/iocs/s7plcIOC/s7plcApp/src/O.linux-x86_64/s7plcApp_registerRecordDeviceDriver.cpp:107: undefined reference to `pvar_func_swaitRecordSizeOffset' /home/epics-ioc/epics-base/support/s7plc/iocs/s7plcIOC/s7plcApp/src/O.linux-x86_64/s7plcApp_registerRecordDeviceDriver.cpp:216: undefined reference to "pvar_dset_devSWaitIoEvent" /home/epics-ioc/epics-base/support/s7plc/iocs/s7plcIOC/s7plcApp/src/O.linux-x86_64/s7plcApp_registerRecordDeviceDriver.cpp:335: undefined reference to pvar_int_swaitRecordDebug collect2: error: ld returned 1 exit status make[5]: [/home/epics-ioc/epics-base/configure/RULES_BUILD:231:s7plcApp] Error 1 make[5]: Leave directory '/home/epics-ioc/epics-base/support/s7plc/iocs/s7plcIOC/s7plcApp/src/O.linux-x86_64' make[4]: [/home/epics-ioc/epics-base/configure/RULES_ARCHS:58:install.linux-x86_64] error 2 make[4]: Leave directory '/home/epics-ioc/epics-base/support/s7plc/iocs/s7plcIOC/s7plcApp/src' make[3]: [/home/epics-ioc/epics-base/configure/RULES_DIRS:85:src.install] error 2 make[3]: Leave directory '/home/epics-ioc/epics-base/support/s7plc/iocs/s7plcIOC/s7plcApp' make[2]: [/home/epics-ioc/epics-base/configure/RULES_DIRS:85: s7plcApp.install] Error 2 make[2]: Leave directory '/home/epics-ioc/epics-base/support/s7plc/iocs/s7plcIOC' make[1]: [/home/epics-ioc/epics-base/configure/RULES_DIRS:85: s7plcIOC.install] Error 2 make[1]: Leave directory '/home/epics-ioc/epics-base/support/s7plc/iocs' make: [/home/epics-ioc/epics-base/configure/RULES_DIRS:85: iocs.install] error 2

dirk-zimoch commented 2 years ago

The swait record is not part of s7plc. You probably added parts of the swait record support but not everything needed. Try to build the s7plc project without swait.

dkr-ri commented 2 years ago

Thanks Dirk, I think I got it working now

Von: Dirk Zimoch @.> Gesendet: Dienstag, 30. August 2022 15:06 An: paulscherrerinstitute/s7plc @.> Cc: Kraemer, Dirk @.>; Comment @.> Betreff: Re: [paulscherrerinstitute/s7plc] Can't find file s7plc.dbd (#5)

The swait record is not part of s7plc. You probably added parts of the swait record support but not everything needed. Try to build the s7plc project without swait.

- Reply to this email directly, view it on GitHubhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpaulscherrerinstitute%2Fs7plc%2Fissues%2F5%23issuecomment-1231641267&data=05%7C01%7Cdirk.kraemer%40research-instruments.de%7C9098c0dcf43e4d1bada508da8a88624a%7C5e27e469e17046cd838d7e6f7944402c%7C0%7C0%7C637974615616010558%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=IwkBumxrAZbVqT0sTZgxYUEZ3IPlbDQjNcKpUBXufU0%3D&reserved=0, or unsubscribehttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FA22GWUAI2OLQZJBJ4FJ3LOLV3YBLNANCNFSM43IGZPIQ&data=05%7C01%7Cdirk.kraemer%40research-instruments.de%7C9098c0dcf43e4d1bada508da8a88624a%7C5e27e469e17046cd838d7e6f7944402c%7C0%7C0%7C637974615616010558%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3eYMjeI9MsiaGiqVoSV6%2B%2BcJoxEU4HgxxHcvi85%2BHkE%3D&reserved=0. You are receiving this because you commented.Message ID: @.**@.>>