paulscherrerinstitute / ADZMQ

ZMQ ADDriver and NDPlugin for areaDetector
1 stars 3 forks source link

does this driver work with EPICS base 7.xx? #1

Closed LeeYangLBLBCS closed 3 years ago

LeeYangLBLBCS commented 3 years ago

Looks like you are using EPICS 3.14. I got linker error when tried to compile with EPICS 7.0.4:

DPluginZMQ.obj : error LNK2001: unresolved external symbol "declspec(dllimport) protected: virtual enum asynStatus cdecl NDPluginDriver::setArrayInterrupt(int)" (imp_?setArrayInterrupt@NDPluginDriver@@MEAA?AW4asynStatus@@H@Z) NDPluginZMQ.obj : error LNK2001: unresolved external symbol "declspec(dllimport) protected: virtual enum asynStatus cdecl NDPluginDriver::connectToArrayPort(void)" (_imp?connectToArrayPort@NDPluginDriver@@MEAA?AW4asynStatus@@XZ) NDPluginZMQ.obj : error LNK2001: unresolved external symbol "declspec(dllimport) protected: virtual enum asynStatus cdecl NDPluginDriver::endProcessCallbacks(class NDArray *,bool,bool)" (imp_?endProcessCallbacks@NDPluginDriver@@MEAA?AW4asynStatus@@PEAVNDArray@@_N1@Z) NDPluginZMQ.obj : error LNK2001: unresolved external symbol "declspec(dllimport) protected: virtual void cdecl NDPluginDriver::beginProcessCallbacks(class NDArray )" (imp_?beginProcessCallbacks@NDPluginDriver@@MEAAXPEAVNDArray@@@Z) NDPluginZMQ.obj : error LNK2001: unresolved external symbol "declspec(dllimport) public: virtual enum asynStatus cdecl NDPluginDriver::start(void)" (_imp?start@NDPluginDriver@@UEAA?AW4asynStatus@@XZ) NDPluginZMQ.obj : error LNK2001: unresolved external symbol "declspec(dllimport) public: virtual void cdecl NDPluginDriver::run(void)" (imp_?run@NDPluginDriver@@UEAAXXZ) NDPluginZMQ.obj : error LNK2001: unresolved external symbol "declspec(dllimport) public: virtual void cdecl NDPluginDriver::driverCallback(struct asynUser ,void )" (_imp?driverCallback@NDPluginDriver@@UEAAXPEAUasynUser@@PEAX@Z) NDPluginZMQ.obj : error LNK2001: unresolved external symbol "declspec(dllimport) public: virtual enum asynStatus cdecl NDPluginDriver::readInt32Array(struct asynUser ,int ,unsigned int64,unsigned int64 )" (_imp?readInt32Array@NDPluginDriver@@UEAA?AW4asynStatus@@PEAUasynUser@@PEAH_KPEA_K@Z) Hint on symbols that are defined and could potentially match:

leeyang1140 commented 3 years ago

Additional info: The error I got was from Windfows machine (Windows 10). It didn't have any error when I compiled it in Linux (ubuntu 18.04). Same Epics base 7.0.4.

xiaoqiangwang commented 3 years ago

Commit ae04129 should fix the issue. I have tested with epics base 7.0.3, asyn 4.40.1 and ADCore 3.7.

LeeYangLBLBCS commented 3 years ago

I'm using the exact same as you are, with minor differences of base 7.0.4 instead of 7.0.4.1. Linux build succeeded without much change at all. But the windows build keep complaining about NDPluginDriver related functions not found. I added the following lines to: ..\synApps_6_1_epics7\support\areaDetector-R3-7\Makefile i

fdef ADZMQDIRS := $(DIRS) $(ADZMQ)$(ADZMQ)_DEPEND_DIRS += $(ADCORE)endif

I also added to ..\synApps_6_1_epics7\support\areaDetector-R3-7\configure\RELEASE.local ADZMQ=$(AREA_DETECTOR)/ADZMQ

Did I miss anything else? =============================linker error output========================= NDPluginZMQ.obj : error LNK2001: unresolved external symbol "declspec(dllimport) protected: virtual enum asynStatus cdecl NDPluginDriver::setArrayInterrupt(int)" (imp_?setArrayInterrupt@NDPluginDriver@@MEAA?AW4asynStatus@@H@Z) NDPluginZMQ.obj : error LNK2001: unresolved external symbol "declspec(dllimport) protected: virtual enum asynStatus cdecl NDPluginDriver::connectToArrayPort(void)" (_imp?connectToArrayPort@NDPluginDriver@@MEAA?AW4asynStatus@@XZ) NDPluginZMQ.obj : error LNK2001: unresolved external symbol "declspec(dllimport) protected: virtual enum asynStatus cdecl NDPluginDriver::endProcessCallbacks(class NDArray *,bool,bool)" (imp_?endProcessCallbacks@NDPluginDriver@@MEAA?AW4asynStatus@@PEAVNDArray@ @_N1@Z) NDPluginZMQ.obj : error LNK2001: unresolved external symbol "declspec(dllimport) protected: virtual void cdecl NDPluginDriver::beginProcessCallbacks(class NDArray )" (imp_?beginProcessCallbacks@NDPluginDriver@@MEAAXPEAVNDArray@@@Z) NDPluginZMQ.obj : error LNK2001: unresolved external symbol "declspec(dllimport) public: virtual enum asynStatus cdecl NDPluginDriver::start(void)" (_imp?start@NDPluginDriver @@UEAA?AW4asynStatus@@XZ) NDPluginZMQ.obj : error LNK2001: unresolved external symbol "declspec(dllimport) public: virtual void cdecl NDPluginDriver::run(void)" (imp_?run@NDPluginDriver@@UEAAXXZ) NDPluginZMQ.obj : error LNK2001: unresolved external symbol "declspec(dllimport) public: virtual void cdecl NDPluginDriver::driverCallback(struct asynUser ,void )" (_imp?driverCallback@NDPluginDriver@@UEAAXPEAUasynUser@@PEAX@Z) NDPluginZMQ.obj : error LNK2001: unresolved external symbol "declspec(dllimport) public: virtual enum asynStatus cdecl NDPluginDriver::readInt32Array(struct asynUser ,int ,unsigned int64,unsigned int64 )" (_imp?readInt32Array@NDPluginDriver @@UEAA?AW4asynStatus@@PEAUasynUser@@PEAH_KPEA_K@Z)

On Mon, Dec 14, 2020 at 11:53 PM Xiaoqiang Wang notifications@github.com wrote:

Which verison of asyn and ADCore is it using? My build succeeds with the following combinations

  • base 7.0.4.1
  • asyn 4.39
  • ADCore 3.9

All are built as dynamically libraries (.dll).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/paulscherrerinstitute/ADZMQ/issues/1#issuecomment-745118767, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSYGNEAJ4EM6Q6PT4SZOPDSU4IZLANCNFSM4U3XGR3A .

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

xiaoqiangwang commented 3 years ago

Have you updated your ADZMQ source to the most recent, git pull?

LeeYangLBLBCS commented 3 years ago

Yes, it’s a git clone from the latest version from github.

On Tue, Dec 15, 2020 at 10:56 PM Xiaoqiang Wang notifications@github.com wrote:

Have you updated your ADZMQ source to the most recent, git pull?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/paulscherrerinstitute/ADZMQ/issues/1#issuecomment-745807203, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSYGNC2ZYJNODI44OX2IVDSVBKYLANCNFSM4U3XGR3A .

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

xiaoqiangwang commented 3 years ago

Puzzling, can you post the contents of the Makefile, where this error happens?

LeeYangLBLBCS commented 3 years ago

error output when building ADZMQ: ADZMQ_build_output.txt The Makefile for zmqApp directory is attached here, where the Makefiles for both zmqsrc and src are. They are the same file I cloned from Gibhub though. I didn't change anything there. zmqApp.zip

xiaoqiangwang commented 3 years ago

I pushed a fix yesterday and that is not in your copy zmqApp\src\Makefile. See the difference https://github.com/paulscherrerinstitute/ADZMQ/commit/ae0412912db5902c069e7579a199b374bbbdf40d

Can you do another git pull?

LeeYangLBLBCS commented 3 years ago

thanks for the git update. I didn't know you just pushed the new Makefile. The build succeeded after I git pull. I wonder why the linux build didn't need this change.

On Wed, Dec 16, 2020 at 7:31 AM Xiaoqiang Wang notifications@github.com wrote:

I pushed a fix yesterday and that is not in your copy zmqApp\src\Makefile. See the difference ae04129 https://github.com/paulscherrerinstitute/ADZMQ/commit/ae0412912db5902c069e7579a199b374bbbdf40d

Can you do another git pull?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/paulscherrerinstitute/ADZMQ/issues/1#issuecomment-746480810, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSYGNEZWPDD3VTNY65V7R3SVDHG5ANCNFSM4U3XGR3A .

-- 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 3 years ago

I'd like to publish images acquired by a real camera, such as from EPICSs ADAravis driver. Is it possible to do that with ADZMQ?

xiaoqiangwang commented 3 years ago

Place the following after ADAravis driver configuration,

NDZMQConfigure("NDZMQ1", "tcp://*:1234", 3, 0, "$(PORT)", 0)
dbLoadRecords("$(ADCORE)/ADApp/Db/NDPluginBase.template","P=$(PREFIX),R=ZMQ1:,PORT=NDZMQ1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT),NDARRAY_ADDR=0")

doAfterIocInit dbpf $(PREFIX)ZMQ1:EnableCallbacks 1

Then every ADAravis NDArray is published by a ZeroMQ PUB socket at "tcp://*.1234". Use the test client to subscribe and print the data.

$ python zmq_client.py
LeeYangLBLBCS commented 3 years ago

Thanks for the help. I added the suggested lines to the ADAravis config file, then I got these errors: NDZMQConfigure("NDZMQ1", "tcp://*:1234", 3, 0, "SP1", 0) st.cmd.base line 40: Command NDZMQConfigure not found. dbLoadRecords("/home/bl832user/epics/modules/synApps_6_1_epics7/support/areaDetector-R3-7/ADCore/ADApp/Db/NDPluginBase.template","P=13ARV1:,R=ZMQ1:,PORT=NDZMQ1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=SP1,NDARRAY_ADDR=0") doAfterIocInit dbpf 13ARV1:ZMQ1:EnableCallbacks 1 st.cmd.base line 42: Command doAfterIocInit not found.

I must be missing something in the Makefile for ADAravis IOC.

On Mon, Jan 4, 2021 at 11:23 PM Xiaoqiang Wang notifications@github.com wrote:

Place the following after ADAravis driver configuration,

NDZMQConfigure("NDZMQ1", "tcp://*:1234", 3, 0, "$(PORT)", 0) dbLoadRecords("$(ADCORE)/ADApp/Db/NDPluginBase.template","P=$(PREFIX),R=ZMQ1:,PORT=NDZMQ1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT),NDARRAY_ADDR=0")

doAfterIocInit dbpf $(PREFIX)ZMQ1:EnableCallbacks 1

Then every ADAravis NDArray is published by a ZeroMQ PUB socket at "tcp://*.1234". Use the test client to subscribe and print the data.

$ python zmq_client.py

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/paulscherrerinstitute/ADZMQ/issues/1#issuecomment-754455250, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSYGNEMREZYKYDI3EKXC2LSYK5ATANCNFSM4U3XGR3A .

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

xiaoqiangwang commented 3 years ago

doAfterIocInit is part of std module. If it is not part of your IOC, you can remove that line and enable the plugin later using a caput command.

$ caput 13ARV1:ZMQ1:EnableCallbacks 1
LeeYangLBLBCS commented 3 years ago

Thanks. How about the other error before that: NDZMQConfigure("NDZMQ1", "tcp://:1234", 3, 0, "SP1", 0) st.cmd.base line 40: Command NDZMQConfigure not found.*

On Tue, Jan 5, 2021 at 10:11 AM Xiaoqiang Wang notifications@github.com wrote:

doAfterIocInit is part of std module. If it is not part of your IOC, you can remove that line and enable the plugin later using a caput command.

$ caput 13ARV1:ZMQ1:EnableCallbacks 1

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/paulscherrerinstitute/ADZMQ/issues/1#issuecomment-754806417, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSYGNCE32LA7JPUJ45ODKLSYNI6RANCNFSM4U3XGR3A .

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

xiaoqiangwang commented 3 years ago

Oh, I did not see NDZMQConfigure command has an error too. In your IOC Makefile, you have to link ADZMQ library. e.g. https://github.com/paulscherrerinstitute/ADZMQ/blob/bf31e39158ebe672677c3bae2a2bb51b8b69fe7c/iocs/zmqIOC/zmqApp/src/Makefile#L16-L21

Also define ADZMQ in your RELEASE file,

ADZMQ=$(AREA_DETECTOR)/ADZMQ
LeeYangLBLBCS commented 3 years ago

I'm sorry to keep bothering you. I'm quite new to epics.

Would you mind taking a look at the Makefile attached? It's from the original ADAravis on Github with the only change for ZMQ related addition. I got link error, where it complains: make[5]: Entering directory '/home/bl832user/epics/modules/synApps_6_1_epics7/support/areaDetector-R3-7/ADAravis/iocs/aravisIOC/aravisApp/src/O.linux-x86_64' *make[5]: ** No rule to make target '../../../lib/linux-x86_64/libADZMQ.a', needed by 'ADAravisApp'. Stop.

The attached Makefile is from: areaDetector-R3-7/ADAravis/iocs/aravisIOC/aravisApp/src/Makefile ADZMQ has been defined in RELEASE file all along so that shouldn't be the reason.

By the way, I tried to add STD to this Makefile also, I got similar link error, where it couldn't find LibSTD.a

On Tue, Jan 5, 2021 at 10:23 AM Xiaoqiang Wang notifications@github.com wrote:

Oh, I did not see NDZMQConfigure command has an error too. In your IOC Makefile, you have to link ADZMQ library. e.g.

https://github.com/paulscherrerinstitute/ADZMQ/blob/bf31e39158ebe672677c3bae2a2bb51b8b69fe7c/iocs/zmqIOC/zmqApp/src/Makefile#L16-L21

Also define ADZMQ in your RELEASE file,

ADZMQ=$(AREA_DETECTOR)/ADZMQ

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/paulscherrerinstitute/ADZMQ/issues/1#issuecomment-754813752, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSYGNEMW7CTE57VZSQU7KDSYNKKPANCNFSM4U3XGR3A .

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

xiaoqiangwang commented 3 years ago

Did you forget to attach the file? especially areaDetector-R3-7/ADAravis/iocs/aravisIOC/aravisApp/src/Makefile and areaDetector-R3-7/ADAravis/iocs/aravisIOC/configure/RELEASE.

LeeYangLBLBCS commented 3 years ago

I forgot the files won't go through email. Here is the contents:

TOP=../.. include $(TOP)/configure/CONFIG

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

ADD MACRO DEFINITIONS AFTER THIS LINE

PROD_NAME = ADAravisApp PROD_IOC_Linux += $(PROD_NAME) PROD_IOC_Darwin += $(PROD_NAME)

.dbd will be created from Include.dbd

DBD += $(PROD_NAME).dbd $(PROD_NAME)_DBD += ADAravisSupport.dbd

_registerRecordDeviceDriver.cpp will be created from .dbd

PROD_SRCS += $(PROD_NAME)_registerRecordDeviceDriver.cpp $(PROD_NAME)Main.cpp

Add locally compiled object code

PROD_LIBS += ADAravis PROD_LIBS += ADGenICam PROD_LIBS += ADZMQ PROD_LIBS += STD

ifeq ($(OS_CLASS),WIN32) LIBZMQ = libzmq else LIBZMQ = zmq endif PROD_LIBS += $(LIBZMQ)

ifdef ARAVIS_LIB aravis-0.8_DIR = $(ARAVIS_LIB) PROD_LIBS += aravis-0.8 else PROD_SYS_LIBS += aravis-0.8 endif

PROD_SYS_LIBS += giomm-2.4 PROD_SYS_LIBS += gio-2.0 gobject-2.0 gthread-2.0 glib-2.0 PROD_SYS_LIBS += usb-1.0

include $(ADCORE)/ADApp/commonDriverMakefile

=============================

include $(TOP)/configure/RULES

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

ADD RULES AFTER THIS LINE

xiaoqiangwang commented 3 years ago

I wonder if ADZMQ has been built, what is content of

$ ls areaDetector-R3-7/ADZMQ/lib/linux-x86_64

Also the full output of make command would be helpful.

LeeYangLBLBCS commented 3 years ago

this is the zmq's output you'd like to see: -R3-7$ ls -ltr ADZMQ/lib/linux-x86_64/ total 3520 -r--r--r-- 1 bl832user bl832user 2389564 Jan  5 10:30 libzmq.a -r-xr-xr-x 1 bl832user bl832user 1035864 Jan  5 10:30 libADZMQ.so -r--r--r-- 1 bl832user bl832user  174074 Jan  5 10:30 libADZMQ.a

The make output for aravis is attached. (I assume you are interested in aravis and not ZMQ's make output?):

aravis_build_output.txt.gz

xiaoqiangwang commented 3 years ago

I don't see make searches ADZMQ path. Is ADZMQ defined in this file /home/bl832user/epics/modules/synApps_6_1_epics7/support/areaDetector-R3-7/ADAravis/iocs/aravisIOC/configure/RELEASE?

LeeYangLBLBCS commented 3 years ago

It compiled now. thanks. I'll try to run it and see if it works.

I defined ADZMQ in the wrong place, at here: /home/bl832user/epics/modules/synApps_6_1_epics7/support/areaDetector-R3-7/ADAravis/configure/RELEASE It worked after I put it in the place you sent me: /home/bl832user/epics/modules/synApps_6_1_epics7/support/areaDetector-R3-7/ADAravis/iocs/aravisIOC/configure/RELEASE

The configure/RELEASE under IOC is independent of the configure/RELEASE under App?

xiaoqiangwang commented 3 years ago

RELEASE files are independent. But an often used technique is to include upper level RELEASE files, see e.g. https://github.com/areaDetector/ADAravis/blob/master/iocs/aravisIOC/configure/RELEASE

LeeYangLBLBCS commented 3 years ago

Build succeeded but Now I'm back to the original problem. Started IOC and it can't find the NDZMQConfigure:

NDZMQConfigure("NDZMQ1", "tcp://*:1234", 3, 0, "SP1", 0) st.cmd.base line 40: Command NDZMQConfigure not found.

here is my st.cmd file: st.cmd.base.gz

xiaoqiangwang commented 3 years ago

In /home/bl832user/epics/modules/synApps_6_1_epics7/support/areaDetector-R3-7/ADAravis/iocs/aravisIOC/aravisApp/src/Makefile, add this line

$(PROD_NAME)_DBD += ADZMQSupport.dbd
LeeYangLBLBCS commented 3 years ago

it worked! so awesome. thanks you very much.

LeeYangLBLBCS commented 3 years ago

One more question: After I included libstd, The call doAfterIocInit dbpf 13ARV1:ZMQ1:EnableCallbacks 1 worked also. However it does not change the PV value. I have to manually change it. Does the location of this line matter? I attached the relevant ioc startup logs below:

dbLoadRecords("$(ALIVE)/aliveApp/Db/alive.db",

"P=$(PREFIX),RHOST=192.168.1.254")

Set the callback queue size to 5000, up from default of 2000 in base.

This can be needed to avoid errors "callbackRequest: cbLow ring buffer

full". callbackSetQueueSize(5000) set_requestfile_path("/home/bl832user/epics/modules/synApps_6_1_epics7/support/areaDetector-R3-7/ADGenICam/GenICamApp/Db") set_requestfile_path("/home/bl832user/epics/modules/synApps_6_1_epics7/support/areaDetector-R3-7/ADAravis/iocs/aravisIOC/../../aravisApp/Db") set_requestfile_path("/home/bl832user/epics/modules/synApps_6_1_epics7/support/calc-R3-7-4/calcApp/Db") NDZMQConfigure("NDZMQ1", "tcp://*:1234", 3, 0, "SP1", 0) dbLoadRecords("/home/bl832user/epics/modules/synApps_6_1_epics7/support/areaDetector-R3-7/ADCore/ADApp/Db/NDPluginBase.template","P=13ARV1:,R=ZMQ1:,PORT=NDZMQ1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=SP1,NDARRAY_ADDR=0") doAfterIocInit dbpf 13ARV1:ZMQ1:EnableCallbacks 1 iocInit() Starting iocInit ############################################################################

EPICS R7.0.4

Rev. 2020-08-24T21:24-0700

############################################################################ reboot_restore: entry for file 'auto_settings.sav' reboot_restore: Found filename 'auto_settings.sav' in restoreFileList. restoring from './autosave/auto_settings.sav' at initHookState 6 (before record/device init) reboot_restore: done with file 'auto_settings.sav'

reboot_restore: entry for file 'auto_settings.sav' reboot_restore: Found filename 'auto_settings.sav' in restoreFileList. restoring from './autosave/auto_settings.sav' at initHookState 7 (after record/device init) reboot_restore: done with file 'auto_settings.sav'

iocRun: All initialization complete dbpf Usage: dbpf "pv name", "value"

save things every thirty seconds

create_monitor_set("auto_settings.req", 30,"P=13ARV1:") 2021/01/05 21:32:28.707 Param[GC_TRIGGER_SOFTWARE] GenICamFeature::write: node TriggerSoftware is not writable

epics> auto_settings.sav: 2291 of 2291 PV's connected

epics> dbgf 13ARV1:ZMQ1:EnableCallbacks DBF_STRING: "Disable" epics>

On Tue, Jan 5, 2021 at 1:29 PM Xiaoqiang Wang notifications@github.com wrote:

In /home/bl832user/epics/modules/synApps_6_1_epics7/support/areaDetector-R3-7/ADAravis/iocs/aravisIOC/aravisApp/src/Makefile, add this line

$(PROD_NAME)_DBD += ADZMQSupport.dbd

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/paulscherrerinstitute/ADZMQ/issues/1#issuecomment-754910224, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSYGND6BL6P7SG2BGJPEFLSYOADDANCNFSM4U3XGR3A .

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

xiaoqiangwang commented 3 years ago

I did not get the syntax of doAfterIocInit right. The following should work

doAfterIocInit "dbpf 13ARV1:ZMQ1:EnableCallbacks,1"
LeeYangLBLBCS commented 3 years ago

thanks. that worked. I found this also works: doAfterIocInit ("dbpf 13ARV1:ZMQ1:EnableCallbacks,1")

Tinanuaa commented 3 years ago

Hi, I want to install ADZMQ with ADSimDetector, and I am using linux alpine, epics-base:3.14.12.6 for building areadetector, ADSimDetector and ADZMQ into a docker image.

I followed https://areadetector.github.io/master/install_guide.html to install everything except ADZMQ, I built areadetector and ADSimDetector successfully, but when I added ADZMQ into the dockerfile, I got an error as following when running docker build

20 1594.1 make[6]: warning: Clock skew detected. Your build may be incomplete.

20 1594.1 make[5]: warning: Clock skew detected. Your build may be incomplete.

20 1594.1 make[4]: warning: Clock skew detected. Your build may be incomplete.

20 1594.1 make[3]: warning: Clock skew detected. Your build may be incomplete.

20 1594.2 make[3]: *** /EPICS/support/areaDetector/ADZMQ: Is a directory. Stop.

20 1594.2 make[2]: *** [/EPICS/base/configure/RULES_DIRS:83: simDetectorIOC.install] Error 2

20 1594.2 make[1]: *** [/EPICS/base/configure/RULES_DIRS:83: iocs.install] Error 2

20 1594.2 make: *** [/EPICS/base/configure/RULES_DIRS:83: /EPICS/support/areaDetector/ADSimDetector.install] Error 2

my steps for adding ANZMQ is as following:

  1. create RELEASE.local and put into ADZMQ/configure/RELEASE.local
SUPPORT=/EPICS/support
EPICS_BASE=/EPICS/base

# asyn
ASYN=$(SUPPORT)/asyn
BUSY=$(SUPPORT)/busy
CALC=$(SUPPORT)/calc
SSCAN=$(SUPPORT)/sscan
AUTOSAVE=$(SUPPORT)/autosave

# AREA_DETECTOR is needed for base and plugins
AREA_DETECTOR=/EPICS/support/areaDetector
ADBINARIES=$(AREA_DETECTOR)/ADBinaries
ADCORE=$(AREA_DETECTOR)/ADCore
  1. change arch to linux in ADZMQ/iocs/zmqIOC/iocBoot/iocZMQ/Makefile ARCH = linux-x86_64

  2. add ADZMQ inside areaDetector/Makefile

    ifdef ADZMQ
    DIRS := $(DIRS) $(ADZMQ)
    $(ADZMQ)_DEPEND_DIRS += $(ADCORE)
    endif
  3. add ADZMQ in areaDetector/configure/RELEASE_PRODS.local

# ADZMQ  
ADZMQ=$(AREA_DETECTOR)/ADZMQ
  1. add ADZMQ in areaDetector/ADSimDetector/iocs/simDetectorIOC/configure/RELEASE

ADZMQ=$(AREA_DETECTOR)/ADZMQ

  1. add ADZMQ in areaDetector/ADSimDetector/iocs/simDetectorIOC/simDetectorApp/src/Makefile
PROD_LIBS += ADZMQ

ifeq ($(OS_CLASS),WIN32)
    LIBZMQ = libzmq
else
    LIBZMQ = zmq
endif
PROD_LIBS += $(LIBZMQ)
  1. add ADZMQ in areaDetector/ADSimDetector/iocs/simDetectorIOC/iocBoot/iocSimDetector/st_base.cmd
# add ADZMQ
NDZMQConfigure("NDZMQ1", "tcp://*:1234", 3, 0, "$(PORT)", 0)
dbLoadRecords("$(ADCORE)/ADApp/Db/NDPluginBase.template","P=$(PREFIX),R=ZMQ1:,PORT=NDZMQ1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT),NDARRAY_ADDR=0")

doAfterIocInit "dbpf 13SIM1:ZMQ1:EnableCallbacks,1"

am I missing something? I am quite new to areadetector and ADZMQ, so I just followed the Readme.md and the steps mentioned in this issue. Thanks for any help.

xiaoqiangwang commented 3 years ago

It is most likely the time inside the docker container is behind your host. Compare the date command output from your host and docker container.

Maybe changing the timezone is a fix, https://gitlab.alpinelinux.org/alpine/aports/-/issues/5543

Tinanuaa commented 3 years ago

I added the following code to change the timezone inside my dockerfile, but got the same error,

RUN apk upgrade --update \
  && apk add -U tzdata  \
  && cp /usr/share/zoneinfo/Australia/Melbourne /etc/localtime \
   && apk del tzdata  

may I know why the timezone matters? And why does make complain "#20 1594.2 make[3]: *** /EPICS/support/areaDetector/ADZMQ: Is a directory. Stop."?

Tinanuaa commented 3 years ago

Hi, I redo all the steps mentioned above and this time I got the error as

29 631.0 make[6]: *** No rule to make target '../../../lib/linux-x86_64/libADZMQ.a', needed by 'simDetectorApp'. Stop.

29 631.0 make[5]: *** [/EPICS/base/configure/RULES_ARCHS:61: install.linux-x86_64] Error 2

29 631.0 make[4]: *** [/EPICS/base/configure/RULES_DIRS:83: src.install] Error 2

29 631.0 make[3]: *** [/EPICS/base/configure/RULES_DIRS:83: simDetectorApp.install] Error 2

29 631.0 make[2]: *** [/EPICS/base/configure/RULES_DIRS:83: simDetectorIOC.install] Error 2

29 631.0 make[1]: *** [/EPICS/base/configure/RULES_DIRS:83: iocs.install] Error 2

29 631.0 make: *** [/EPICS/base/configure/RULES_DIRS:83: /EPICS/support/areaDetector/ADSimDetector.install] Error 2

I double checked the RELEASE(ADSimDetector/iocs/simDetectorIOC/configure/RELEASE) file and the Makefile(ADSimDetector/iocs/simDetectorIOC/simDetectorApp/src/Makefile) for simDetector, but still got the same error, do you have any idea about this problem? I attach the RELEASE and Makefile here.

config.zip

xiaoqiangwang commented 3 years ago

I just realised this does not relate to the titled issue and we are spamming LeeYangLBLBCS. Please start a new issue for further debugging.

It looks like ADZMQ may not be built yet. Can you check the contents of /EPICS/support/areaDetector/ADZMQ. There should be bin/linux-x86_64, dbd, lib/linux-86_64 directories.