From bcce0bbab28bf8f83675f10f2e2093a8c73acf10 Mon Sep 17 00:00:00 2001 From: koennecke Date: Fri, 12 Jan 2024 13:52:35 +0100 Subject: [PATCH] Changes necessary to compile the pyDevSup module for RHEL8 and EPICS 7.0.7 --- README.module | 22 ++++++++++++---------- configure/CONFIG_PY | 8 ++++---- configure/CONFIG_SITE | 4 ++-- configure/RELEASE | 2 +- devsupApp/src/dbdset.c | 6 +++--- 5 files changed, 22 insertions(+), 20 deletions(-) diff --git a/README.module b/README.module index 98e200f..22f52d0 100644 --- a/README.module +++ b/README.module @@ -8,26 +8,28 @@ require does not know about python and its modules at all. The good news is that it can be made to work but requires a few manual steps. -1) Build the pyDevSup extension in the normal EPICS way. +1) Build the pyDevSup extension in the normal EPICS way in the master branch. 2) This generates a pythonXX/$(EPICS_ARCH)/devsup directory. Copy this directory to a safe place. -3) Build the module using the GNUMakefile as normal and install it +3) Switch to the module branch and Build the module using the GNUMakefile as + normal and install it 4) Copy the saved devsup directory in some place into pyDevSup's module hierarchy. - For example: /ioc/modules/pyDevSup/koennecke/R3.14.12/lib/devsup - -5) Copy the library /ioc/modules/pyDevSup/koennecke/R3.14.12/lib/${EPICS_HOST_ARCH}/libDevSup.so to - /ioc/modules/pyDevSup/koennecke/R3.14.12/lib/devsup/_dbapi.so + For example: /ioc/modules/pyDevSup/1.2.sinq/R7.0.7/lib/RHEL8-x86_64/devsup 6) In order to successfuly load pyDevSup with require the directory underneath where ypu placed pydevsup needs to be on the python path. For example: - /ioc/modules/pyDevSup/koennecke/R3.14.12/lib/ - -With this, one can at least run the testmodule.cmd script and it workd at least -for me. + /ioc/modules/pyDevSup/1.2.sinq/R7.0.7/lib/RHEL8-x86_64 Please use the module branch, I had to hack the initialisation of pyDevSup to make it work as a module. +For RHEL8, I had to remove a few static statements in dbdSet.c in order to solve a missing +symbols problem. I also had to modify the files in configure somewhat in order to point to +the proper python version and to suppress the many cross compilations attempted by the default +build. + + + diff --git a/configure/CONFIG_PY b/configure/CONFIG_PY index f2edef8..c06ff44 100644 --- a/configure/CONFIG_PY +++ b/configure/CONFIG_PY @@ -23,11 +23,11 @@ PROD_DEPLIB_DIRS += $(PY_LIBDIRS) INCLUDES += $(PY_INCDIRS:%=-I%) -ifeq ($(HAVE_NUMPY),YES) +#ifeq ($(HAVE_NUMPY),YES) TARGET_CPPFLAGS += -DHAVE_NUMPY -else -$(error numpy required) -endif +#else +#$(error numpy required) +#endif #LIB_SYS_LIBS += python$(PY_LD_VER) #PROD_SYS_LIBS += python$(PY_LD_VER) diff --git a/configure/CONFIG_SITE b/configure/CONFIG_SITE index 49c12e8..47b10a7 100644 --- a/configure/CONFIG_SITE +++ b/configure/CONFIG_SITE @@ -19,7 +19,7 @@ CHECK_RELEASE = YES # Set this when you only want to compile this application # for a subset of the cross-compiled target architectures # that Base is built for. -#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040 +CROSS_COMPILER_TARGET_ARCHS = RHEL8-x86_64 # To install files into a location other than $(TOP) define # INSTALL_LOCATION here. @@ -33,7 +33,7 @@ CHECK_RELEASE = YES #IOCS_APPL_TOP = # Default python version. -PY_VER=2.7 +PY_VER=3.6.8 # Module will be build against this version of the # Python interpreter diff --git a/configure/RELEASE b/configure/RELEASE index ba1fc22..bd378ee 100644 --- a/configure/RELEASE +++ b/configure/RELEASE @@ -36,7 +36,7 @@ TEMPLATE_TOP=$(EPICS_BASE)/templates/makeBaseApp/top ## Required Modules ## # EPICS_BASE usually appears last so other apps can override stuff: -#EPICS_BASE=/usr/lib/epics +EPICS_BASE=/usr/local/epics/base-7.0.7 -include $(TOP)/configure/RELEASE.local -include $(TOP)/../RELEASE.local diff --git a/devsupApp/src/dbdset.c b/devsupApp/src/dbdset.c index badfb5c..3287b41 100644 --- a/devsupApp/src/dbdset.c +++ b/devsupApp/src/dbdset.c @@ -373,15 +373,15 @@ typedef struct { DEVSUPFUN linconv; } dset6; -static dset6 pydevsupComSpec = {{6, (DEVSUPFUN)&report, (DEVSUPFUN)&init, +dset6 pydevsupComSpec = {{6, (DEVSUPFUN)&report, (DEVSUPFUN)&init, (DEVSUPFUN)&init_record, (DEVSUPFUN)&get_iointr_info}, (DEVSUPFUN)&process_record}; -static dset6 pydevsupComOut = {{6, (DEVSUPFUN)&report, (DEVSUPFUN)&init, +dset6 pydevsupComOut = {{6, (DEVSUPFUN)&report, (DEVSUPFUN)&init, (DEVSUPFUN)&init_record2, (DEVSUPFUN)&get_iointr_info}, (DEVSUPFUN)&process_record}; -static dset6 pydevsupComIn = {{6, (DEVSUPFUN)&report, (DEVSUPFUN)&init, +dset6 pydevsupComIn = {{6, (DEVSUPFUN)&report, (DEVSUPFUN)&init, (DEVSUPFUN)&init_record, (DEVSUPFUN)&get_iointr_info}, (DEVSUPFUN)&process_record2};