From 140845fb14734e00f815bb926c4e199c1a8fef20 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 27 Feb 2012 14:40:07 -0600 Subject: [PATCH 01/11] configure: Cleanup MacOS and iOS build settings Makes it easy for users to select which compiler to use. --- configure/os/CONFIG.Common.iosCommon | 19 ++++++++++-------- configure/os/CONFIG.darwinCommon.darwinCommon | 5 ----- configure/os/CONFIG_SITE.Common.ios-arm | 7 ------- configure/os/CONFIG_SITE.Common.iosCommon | 20 +++++++++++++++---- 4 files changed, 27 insertions(+), 24 deletions(-) diff --git a/configure/os/CONFIG.Common.iosCommon b/configure/os/CONFIG.Common.iosCommon index 40f80cb86..1a2521985 100644 --- a/configure/os/CONFIG.Common.iosCommon +++ b/configure/os/CONFIG.Common.iosCommon @@ -42,10 +42,6 @@ ARCH_DEP_LDFLAGS += $(ARCH_DEP_FLAGS) # Operating system flags OP_SYS_CFLAGS += -isysroot $(SDK_DIR) -D__IPHONE_OS_VERSION_MIN_REQUIRED=30200 -#-------------------------------------------------- -# Don't try to use precompiled headers when converting sequencer files -CPPSNCFLAGS += -no-cpp-precomp - #-------------------------------------------------- # Always compile in debugging symbol table information # @@ -54,13 +50,20 @@ OPT_CXXFLAGS_YES += -g #------------------------------------------------------- # Compiler definitions: -# Use clang instead of gcc -CC = $(GNU_BIN)/clang -CCC = $(GNU_BIN)/clang++ -GNU_LDLIBS_YES = + +CC_GNU = gcc +CCC_GNU = g++ +CC_LLVM = llvm-gcc +CCC_LLVM = llvm-g++ +CC_CLANG = clang +CCC_CLANG = clang++ + +CC = $(firstword $(wildcard $(GNU_BIN)/$(CC_$(COMPILER))) $(CC_$(COMPILER))) +CCC = $(firstword $(wildcard $(GNU_BIN)/$(CCC_$(COMPILER))) $(CCC_$(COMPILER))) #------------------------------------------------------- # Linker flags +GNU_LDLIBS_YES = OP_SYS_LDFLAGS += -dynamic -Z -L$(SDK_DIR)/usr/lib -L$(SDK_DIR)/usr/lib/system #------------------------------------------------------- diff --git a/configure/os/CONFIG.darwinCommon.darwinCommon b/configure/os/CONFIG.darwinCommon.darwinCommon index dd794a02d..454dfaf20 100644 --- a/configure/os/CONFIG.darwinCommon.darwinCommon +++ b/configure/os/CONFIG.darwinCommon.darwinCommon @@ -36,11 +36,6 @@ ARCH_DEP_LDFLAGS += $(ARCH_DEP_FLAGS) # OP_SYS_CFLAGS += -fno-common -# -# Don't try to use precompiled headers when converting sequencer files -# -CPPSNCFLAGS += -no-cpp-precomp - # # Darwin os definition # diff --git a/configure/os/CONFIG_SITE.Common.ios-arm b/configure/os/CONFIG_SITE.Common.ios-arm index 43874fe41..462db67f8 100644 --- a/configure/os/CONFIG_SITE.Common.ios-arm +++ b/configure/os/CONFIG_SITE.Common.ios-arm @@ -19,10 +19,3 @@ ARCH_CLASS = armv7 #ARCH_CLASS = armv6 armv7 #ARCH_CLASS = armv6 - - -# Uncomment these two definitions to use g++ instead of clang++ -# which may be needed in some circumstances: -# -#CCC = $(GNU_BIN)/c++ -#GNU_LDLIBS_YES = -lgcc diff --git a/configure/os/CONFIG_SITE.Common.iosCommon b/configure/os/CONFIG_SITE.Common.iosCommon index 121857c27..a41721621 100644 --- a/configure/os/CONFIG_SITE.Common.iosCommon +++ b/configure/os/CONFIG_SITE.Common.iosCommon @@ -10,17 +10,29 @@ #IOS_VERSION = 3.2 #IOS_VERSION = 4.1 +#IOS_VERSION = 4.2 #IOS_VERSION = 4.3 IOS_VERSION = 5.0 -# Most sites will want shared libraries +# Which compiler to use: +# CLANG is preferred for recent versions of Xcode +# LLVM uses the llvm-gcc and llvm-g++ compilers +# GNU is needed for older versions of Xcode -STATIC_BUILD=NO -SHARED_LIBRARIES=YES +COMPILER = CLANG +#COMPILER = LLVM +#COMPILER = GNU -# Platform path, this is probably correct +# Most sites will want to build shared libraries (which is the +# default), but if you get an error from ld while building libCom, +# try uncommenting this, which is needed for some compiler versions: + +#SHARED_LIBRARIES = NO + + +# Get platform path from OS, these are usually correct: XCODE_PATH := $(shell xcode-select -print-path) PLATFORM_DIR = $(XCODE_PATH)/Platforms/$(IOS_PLATFORM).platform From df7fa22a151c74240f51f1b27b4ef9bc01ed9bc6 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 29 Feb 2012 17:11:08 -0600 Subject: [PATCH 02/11] libCom/test: Add more tests of the CALC engine Some of the isnan(Inf) tests were failing on mingw. This change doesn't fix them, it adds related examples. --- src/libCom/test/epicsCalcTest.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libCom/test/epicsCalcTest.cpp b/src/libCom/test/epicsCalcTest.cpp index df30e68a5..f5492e749 100644 --- a/src/libCom/test/epicsCalcTest.cpp +++ b/src/libCom/test/epicsCalcTest.cpp @@ -238,7 +238,7 @@ MAIN(epicsCalcTest) const double a=1.0, b=2.0, c=3.0, d=4.0, e=5.0, f=6.0, g=7.0, h=8.0, i=9.0, j=10.0, k=11.0, l=12.0; - testPlan(566); + testPlan(570); /* LITERAL_OPERAND elements */ testExpr(0); @@ -325,11 +325,15 @@ MAIN(epicsCalcTest) testExpr(isinf(NaN)); testExpr(isnan(0)); testExpr(isnan(Inf)); + testExpr(isnan(-Inf)); testExpr(isnan(NaN)); testCalc("isnan(0,1,2)", 0); testCalc("isnan(0,1,NaN)", 1); testCalc("isnan(0,NaN,2)", 1); testCalc("isnan(NaN,1,2)", 1); + testCalc("isnan(0,1,Inf)", 0); + testCalc("isnan(0,Inf,2)", 0); + testCalc("isnan(Inf,1,2)", 0); testCalc("isnan(0,1,-Inf)", 0); testCalc("isnan(0,-Inf,2)", 0); testCalc("isnan(-Inf,1,2)", 0); From 10e7bced84a93382e03b83d7b5150f6456440753 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 6 Mar 2012 12:54:54 -0600 Subject: [PATCH 03/11] libCom/test: epicsTimeTest reworked a bit Report throw from first call to epicsTime::getCurrent(). Reorganized test order so a bad time provider doesn't stop all tests from being run. Also cleaned up a few extraneous variables. --- src/libCom/test/epicsTimeTest.cpp | 114 +++++++++++++++--------------- 1 file changed, 58 insertions(+), 56 deletions(-) diff --git a/src/libCom/test/epicsTimeTest.cpp b/src/libCom/test/epicsTimeTest.cpp index 98cedd4bd..c89d13a5c 100644 --- a/src/libCom/test/epicsTimeTest.cpp +++ b/src/libCom/test/epicsTimeTest.cpp @@ -38,22 +38,17 @@ struct l_fp { /* NTP time stamp */ epicsUInt32 l_uf; /* fractional seconds */ }; -epicsTime useSomeCPU; - static const unsigned mSecPerSec = 1000u; static const unsigned uSecPerSec = 1000u * mSecPerSec; static const unsigned nSecPerSec = 1000u * uSecPerSec; - +static const double precisionEPICS = 1.0 / nSecPerSec; MAIN(epicsTimeTest) { - const unsigned wasteTime = 100000u; + const int wasteTime = 100000; const int nTimes = 10; - const double precisionEPICS = 1.0 / nSecPerSec; - testPlan(15 + nTimes * 18); - - const epicsTime begin = epicsTime::getCurrent(); + testPlan(16 + nTimes * 18); { const epicsTimeStamp epochTS = {0, 0}; @@ -66,16 +61,6 @@ MAIN(epicsTimeTest) testOk1(epicsEpoch.ansi_tm.tm_year == 90); } - { - epicsTime tsi = epicsTime::getCurrent (); - l_fp ntp = tsi; - epicsTime tsf = ntp; - const double diff = fabs ( tsf - tsi ); - // the difference in the precision of the two time formats - static const double precisionNTP = 1.0 / ( 1.0 + 0xffffffff ); - testOk1(diff <= precisionEPICS + precisionNTP); - } - { // badNanosecTest static const char * pFormat = "%a %b %d %Y %H:%M:%S.%4f"; try { @@ -90,7 +75,7 @@ MAIN(epicsTimeTest) } } - { + { // strftime() output char buf[80]; epicsTime et; @@ -125,70 +110,87 @@ MAIN(epicsTimeTest) pFormat = "%%S.%%05f"; et.strftime(buf, sizeof(buf), pFormat); testOk(strcmp(buf, "%S.%05f") == 0, "'%s' => '%s'", pFormat, buf); + + char bigBuf [512]; + memset(bigBuf, '\a', sizeof(bigBuf)); + bigBuf[ sizeof(bigBuf) - 1] = '\0'; + et.strftime(buf, sizeof(buf), bigBuf); + testOk(strcmp(buf, "") == 0, "bad format => '%s'", buf); } - { // invalidFormatTest - char bigBuf [512]; - char buf [32]; - memset(bigBuf, '\a', sizeof(bigBuf )); - bigBuf[ sizeof(bigBuf) - 1] = '\0'; - begin.strftime(buf, sizeof(buf), bigBuf); - testOk(strcmp(buf, "") == 0, "bad format => '%s'", buf); + epicsTime now; + try { + now = epicsTime::getCurrent(); + testPass("default time provider"); + } + catch ( ... ) { + testFail("epicsTime::getCurrent() throws"); + testAbort("Can't continue, check your time provider"); + } + + { + l_fp ntp = now; + epicsTime tsf = ntp; + const double diff = fabs(tsf - now); + // the difference in the precision of the two time formats + static const double precisionNTP = 1.0 / (1.0 + 0xffffffff); + testOk1(diff <= precisionEPICS + precisionNTP); } testDiag("Running %d loops", nTimes); - for (int iTimes=0; iTimes < nTimes; ++iTimes) { - for (unsigned i=0; i= end); + epicsTime copy = now; + testOk1(copy == now); + testOk1(copy <= now); + testOk1(copy >= now); - testOk1(end > begin); - testOk1(end >= begin); - testOk1(begin != end); - testOk1(begin < end); - testOk1(begin <= end); + testOk1(now > begin); + testOk1(now >= begin); + testOk1(begin != now); + testOk1(begin < now); + testOk1(begin <= now); - testOk1(end - end == 0); - testOk(fabs((end - begin) - diff) < precisionEPICS * 0.01, - "end - begin ~= diff"); + testOk1(now - now == 0); + testOk(fabs((now - begin) - diff) < precisionEPICS * 0.01, + "now - begin ~= diff"); testOk1(begin + 0 == begin); - testOk1(begin + diff == end); - testOk1(end - 0 == end); - testOk1(end - diff == begin); + testOk1(begin + diff == now); + testOk1(now - 0 == now); + testOk1(now - diff == begin); - epicsTime end2 = begin; - end2 += diff; - testOk(end2 == end, "(begin += diff) == end"); + epicsTime end = begin; + end += diff; + testOk(end == now, "(begin += diff) == now"); - end2 = end; - end2 -= diff; - testOk(end2 == begin, "(end -= diff) == begin"); + end = now; + end -= diff; + testOk(end == begin, "(now -= diff) == begin"); // test struct tm round-trip conversion local_tm_nano_sec ansiDate = begin; epicsTime beginANSI = ansiDate; - testOk1(beginANSI + diff == end); + testOk1(beginANSI + diff == now); // test struct timespec round-trip conversion struct timespec ts = begin; epicsTime beginTS = ts; - testOk1(beginTS + diff == end); + testOk1(beginTS + diff == now); } return testDone(); From 7435a9831b5ec1beba03ff49f030e5fb9d3928e2 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 6 Mar 2012 14:14:39 -0600 Subject: [PATCH 04/11] db: Reject trailing space in numeric => enum/menu/device conversion This is really a workaround for a Win32/MinGW bug in sscanf, which will only set the %n argument for the format "%u %n" when there is a space following the unsigned number. This changes the IOC's behavior very slightly. --- src/db/dbConvert.c | 6 +++--- src/db/dbFastLinkConv.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/db/dbConvert.c b/src/db/dbConvert.c index 4b7ad7da1..d99cf7f33 100644 --- a/src/db/dbConvert.c +++ b/src/db/dbConvert.c @@ -2600,7 +2600,7 @@ static long putStringEnum( status = (*prset->get_enum_strs)(paddr,&enumStrs); if(!status) { nchoices = enumStrs.no_str; - nargs = sscanf(pbuffer," %u %n",&ind,&nchars); + nargs = sscanf(pbuffer,"%u%n",&ind,&nchars); if(nargs==1 && nchars==strlen(pbuffer) && indget_enum_strs)(paddr,&enumStrs); if(!status) { nchoices = enumStrs.no_str; - nargs = sscanf(from," %u %n",&ind,&nchars); + nargs = sscanf(from,"%u%n",&ind,&nchars); if(nargs==1 && nchars==strlen(from) && ind Date: Thu, 8 Mar 2012 09:47:38 -0600 Subject: [PATCH 05/11] rec: Fix timestamps from calcout and seq records Update record timestamp before calling db_post_events() --- documentation/RELEASE_NOTES.html | 16 ++++++++++++++++ src/rec/calcoutRecord.c | 5 ++++- src/rec/seqRecord.c | 10 +++++----- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index 14203fb03..761c6030a 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -28,6 +28,22 @@ fixed in this release:

RHEL5 nss ldap update cause stack size related failure +

Calcout and Seq record timestamps

+ +

Both the calcout and seq record types were not updating the record's +timestamp before calling db_post_events() for some field updates. The calcout +record type will now update the record's timestamp before it posts a channel +access monitor on the DLYA field; this happens twice during record processing if +the ODLY field is larger than 0.

+ +

Timestamps from all seq record monitor events have been wrong since 1995 or +earlier, the time being provided was from the last time the record processed. +Now the record timestamp will be updated between reading each DOL1..DOLA link +and posting the monitor on the associated DO1..DOA field. The VAL field is +never given a value by the record processing code, but is used for posting +monitors when the alarm status or severity gets updated at the end of record +processing. Alarm monitors are now timestamped properly at that time.

+

Comments in iocsh scripts

The IOC shell was very particular about comments in previous versions of diff --git a/src/rec/calcoutRecord.c b/src/rec/calcoutRecord.c index 062580c76..0b7c78323 100644 --- a/src/rec/calcoutRecord.c +++ b/src/rec/calcoutRecord.c @@ -252,6 +252,7 @@ static long process(calcoutRecord *prec) if (doOutput) { if (prec->odly > 0.0) { prec->dlya = 1; + recGblGetTimeStamp(prec); db_post_events(prec, &prec->dlya, DBE_VALUE); callbackRequestProcessCallbackDelayed(&prpvt->doOutCb, prec->prio, prec, (double)prec->odly); @@ -263,9 +264,11 @@ static long process(calcoutRecord *prec) prec->pact = TRUE; } } + recGblGetTimeStamp(prec); } else { /* pact == TRUE */ if (prec->dlya) { prec->dlya = 0; + recGblGetTimeStamp(prec); db_post_events(prec, &prec->dlya, DBE_VALUE); /* Make pact FALSE for asynchronous device support*/ prec->pact = FALSE; @@ -274,9 +277,9 @@ static long process(calcoutRecord *prec) prec->pact = TRUE; } else {/*Device Support is asynchronous*/ writeValue(prec); + recGblGetTimeStamp(prec); } } - recGblGetTimeStamp(prec); monitor(prec); recGblFwdLink(prec); prec->pact = FALSE; diff --git a/src/rec/seqRecord.c b/src/rec/seqRecord.c index 67e2518d8..5b43d34e8 100644 --- a/src/rec/seqRecord.c +++ b/src/rec/seqRecord.c @@ -90,8 +90,6 @@ typedef struct callbackSeq { int index; }callbackSeq; -int processNextLink(); - /***************************************************************************** * @@ -327,7 +325,9 @@ static long asyncFinish(seqRecord *prec) if (seqRecDebug > 5) printf("asyncFinish(%s) completing processing\n", prec->name); prec->udf = FALSE; - + + recGblGetTimeStamp(prec); + MonitorMask = recGblResetAlarms(prec); if (MonitorMask) @@ -336,8 +336,6 @@ static long asyncFinish(seqRecord *prec) /* process the forward scan link record */ recGblFwdLink(prec); - recGblGetTimeStamp(prec); - /* tsLocalTime(&prec->time); */ prec->pact = FALSE; return(0); @@ -377,6 +375,8 @@ static void processCallback(CALLBACK *arg) dbGetLink(&(pcb->plinks[pcb->index]->dol), DBR_DOUBLE, &(pcb->plinks[pcb->index]->dov),0,0); + recGblGetTimeStamp(prec); + /* Dump the value to the destination field */ dbPutLink(&(pcb->plinks[pcb->index]->lnk), DBR_DOUBLE, &(pcb->plinks[pcb->index]->dov),1); From 6f8f61db6446eb29ec37bd8cb7aec6382cce736a Mon Sep 17 00:00:00 2001 From: Jason Abernathy Date: Fri, 9 Mar 2012 11:55:20 -0600 Subject: [PATCH 06/11] Only remove last occurrence of shrlib version string. --- configure/RULES_BUILD | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index a455f064a..982de28cd 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -387,7 +387,7 @@ $(INSTALL_SHRLIBS): $(INSTALL_SHRLIB)/%: % ifneq ($(SHRLIB_SUFFIX),.dll) ifneq (,$(strip $(SHRLIB_VERSION))) @$(RM) $(subst .$(SHRLIB_VERSION),,$@) - ln -s $< $(subst .$(SHRLIB_VERSION),,$@) + ln -s $< $(@:.$(SHRLIB_VERSION)=) endif # SHRLIB_VERSION endif # SHRLIB_SUFFIX @@ -410,7 +410,7 @@ $(INSTALL_LOADABLE_SHRLIBS): $(INSTALL_SHRLIB)/%: % @$(INSTALL_LIBRARY) -d -m 555 $< $(INSTALL_SHRLIB) ifneq (,$(strip $(LOADABLE_SHRLIB_VERSION))) @$(RM) $(subst .$(LOADABLE_SHRLIB_VERSION),,$@) - ln -s $< $(subst .$(LOADABLE_SHRLIB_VERSION),,$@) + ln -s $< $(@:.$(LOADABLE_SHRLIB_VERSION)=) endif # LOADABLE_SHRLIB_VERSION $(INSTALL_CONFIG)/%: % From dffe203856de558cefeccf882e36e4d956fcf556 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 19 Mar 2012 12:31:11 -0500 Subject: [PATCH 07/11] db: Another modification to fix lp:907761 From Dirk Zimoch. --- src/db/dbConvert.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/db/dbConvert.c b/src/db/dbConvert.c index d99cf7f33..303c1e1a8 100644 --- a/src/db/dbConvert.c +++ b/src/db/dbConvert.c @@ -416,7 +416,7 @@ static long getCharChar( char *pbuffer = (char *)pto; char *psrc=(char *)(paddr->pfield); - if (paddr->pfldDes->field_type == DBF_STRING) { + if (paddr->pfldDes && paddr->pfldDes->field_type == DBF_STRING) { /* This is a DBF_STRING field being read as a long string. * The buffer we return must be zero-terminated. */ @@ -443,7 +443,7 @@ static long getCharUchar( unsigned char *pbuffer = (unsigned char *)pto; char *psrc=(char *)(paddr->pfield); - if (paddr->pfldDes->field_type == DBF_STRING) { + if (paddr->pfldDes && paddr->pfldDes->field_type == DBF_STRING) { /* This is a DBF_STRING field being read as a long string. * The buffer we return must be zero-terminated. */ From bcd604e40bc43b039370b78c8c20d515616107a2 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 30 Mar 2012 13:53:45 -0500 Subject: [PATCH 08/11] configure: Expand description of the LINKER_USE_RPATH setting --- configure/CONFIG_SITE | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/configure/CONFIG_SITE b/configure/CONFIG_SITE index 7812b0cab..45f2f5917 100644 --- a/configure/CONFIG_SITE +++ b/configure/CONFIG_SITE @@ -183,7 +183,9 @@ EPICS_SITE_VERSION = # between the various stages of compilation. GCC_PIPE = NO -# Include RPATH when linking executables and libraries. -# must be either YES or NO -LINKER_USE_RPATH=YES +# Set RPATH when linking executables and libraries. +# Must be either YES or NO. If you set this to NO you must also provide a +# way for Base executables to find their shared libraries when they are +# run at build-time, e.g. set the LD_LIBRARY_PATH environment variable. +LINKER_USE_RPATH = YES From 129710f14934b79eb8f7c584c116b683bdb6b1a1 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 30 Mar 2012 14:40:58 -0500 Subject: [PATCH 09/11] configure: Redo Jason Abernathy's SHRLIB fix Now works properly on Darwin where the version number comes before the .dylib extension. This also makes Windows-specific conditional tests fully generic. --- configure/RULES_BUILD | 12 +++++++----- configure/os/CONFIG.Common.UnixCommon | 5 +++-- configure/os/CONFIG.Common.cygwin-x86 | 9 +++++---- configure/os/CONFIG.Common.iosCommon | 3 ++- configure/os/CONFIG.Common.win32-x86-cygwin | 9 +++++---- configure/os/CONFIG.Common.win32-x86-mingw | 9 +++++---- configure/os/CONFIG.darwinCommon.darwinCommon | 3 ++- .../os/CONFIG.win32-x86-borland.win32-x86-borland | 3 ++- configure/os/CONFIG.win32-x86.win32-x86 | 3 ++- 9 files changed, 33 insertions(+), 23 deletions(-) diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index 982de28cd..38f89f5da 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -384,10 +384,10 @@ $(INSTALL_LIB)/%.lib: %.lib $(INSTALL_SHRLIBS): $(INSTALL_SHRLIB)/%: % $(ECHO) "Installing shared library $@" @$(INSTALL_LIBRARY) -d -m $(LIB_PERMISSIONS) $< $(INSTALL_SHRLIB) -ifneq ($(SHRLIB_SUFFIX),.dll) +ifneq ($(SHRLIB_SUFFIX),$(SHRLIB_SUFFIX_BASE)) ifneq (,$(strip $(SHRLIB_VERSION))) - @$(RM) $(subst .$(SHRLIB_VERSION),,$@) - ln -s $< $(@:.$(SHRLIB_VERSION)=) + @$(RM) $(subst $(SHRLIB_SUFFIX),$(SHRLIB_SUFFIX_BASE),$@) + ln -s $< $(subst $(SHRLIB_SUFFIX),$(SHRLIB_SUFFIX_BASE),$@) endif # SHRLIB_VERSION endif # SHRLIB_SUFFIX @@ -408,10 +408,12 @@ $(INSTALL_TCLLIB)/$(TCLINDEX): $(INSTALL_TCLLIBS) $(INSTALL_LOADABLE_SHRLIBS): $(INSTALL_SHRLIB)/%: % $(ECHO) "Installing loadable shared library $@" @$(INSTALL_LIBRARY) -d -m 555 $< $(INSTALL_SHRLIB) +ifneq ($(LOADABLE_SHRLIB_SUFFIX),$(SHRLIB_SUFFIX_BASE)) ifneq (,$(strip $(LOADABLE_SHRLIB_VERSION))) - @$(RM) $(subst .$(LOADABLE_SHRLIB_VERSION),,$@) - ln -s $< $(@:.$(LOADABLE_SHRLIB_VERSION)=) + @$(RM) $(subst $(LOADABLE_SHRLIB_SUFFIX),$(SHRLIB_SUFFIX_BASE),$@) + ln -s $< $(subst $(LOADABLE_SHRLIB_SUFFIX),$(SHRLIB_SUFFIX_BASE),$@) endif # LOADABLE_SHRLIB_VERSION +endif # LOADABLE_SHRLIB_SUFFIX $(INSTALL_CONFIG)/%: % $(ECHO) "Installing config file $@" diff --git a/configure/os/CONFIG.Common.UnixCommon b/configure/os/CONFIG.Common.UnixCommon index fff5a5ee5..24f9a6d9a 100644 --- a/configure/os/CONFIG.Common.UnixCommon +++ b/configure/os/CONFIG.Common.UnixCommon @@ -19,8 +19,9 @@ OBJ = .o #Library prefix and suffixes LIB_PREFIX = lib LIB_SUFFIX = .a -SHRLIB_SUFFIX = .so$(addprefix .,$(SHRLIB_VERSION)) -LOADABLE_SHRLIB_SUFFIX = .so$(addprefix .,$(LOADABLE_SHRLIB_VERSION)) +SHRLIB_SUFFIX_BASE = .so +SHRLIB_SUFFIX = $(SHRLIB_SUFFIX_BASE).$(SHRLIB_VERSION) +LOADABLE_SHRLIB_SUFFIX = $(SHRLIB_SUFFIX_BASE).$(LOADABLE_SHRLIB_VERSION) LOADABLE_SHRLIB_PREFIX = lib #------------------------------------------------------- diff --git a/configure/os/CONFIG.Common.cygwin-x86 b/configure/os/CONFIG.Common.cygwin-x86 index 63eec2768..d31ad2fda 100644 --- a/configure/os/CONFIG.Common.cygwin-x86 +++ b/configure/os/CONFIG.Common.cygwin-x86 @@ -48,11 +48,12 @@ STATIC_CXXFLAGS_NO= $(VISC_DLL) -D_DLL # But: if there are no objects LIBRARY_LD_OBJS to include # in this library (may be for e.g. base/src/libCompat # on some archs), don't define (and build) any library! -SHRLIB_PREFIX= -SHRLIB_SUFFIX=.dll +SHRLIB_PREFIX = +SHRLIB_SUFFIX_BASE = .dll +SHRLIB_SUFFIX = $(SHRLIB_SUFFIX_BASE) SHRLIBNAME_YES = $(BUILD_LIBRARY:%=%$(SHRLIB_SUFFIX)) -LOADABLE_SHRLIB_PREFIX= -LOADABLE_SHRLIB_SUFFIX=.dll +LOADABLE_SHRLIB_PREFIX = +LOADABLE_SHRLIB_SUFFIX = $(SHRLIB_SUFFIX_BASE) LOADABLE_SHRLIBNAME = $(LOADABLE_BUILD_LIBRARY:%=%$(LOADABLE_SHRLIB_SUFFIX)) # diff --git a/configure/os/CONFIG.Common.iosCommon b/configure/os/CONFIG.Common.iosCommon index 1a2521985..0bd045027 100644 --- a/configure/os/CONFIG.Common.iosCommon +++ b/configure/os/CONFIG.Common.iosCommon @@ -73,7 +73,8 @@ SHRLIB_LDFLAGS = -dynamiclib -flat_namespace -undefined suppress \ -install_name $(shell perl $(TOOLS)/fullPathName.pl $(INSTALL_LIB))/$@ \ -compatibility_version $(EPICS_VERSION).$(EPICS_REVISION) \ -current_version $(SHRLIB_VERSION) -SHRLIB_SUFFIX = .$(SHRLIB_VERSION).dylib +SHRLIB_SUFFIX_BASE = .dylib +SHRLIB_SUFFIX = .$(SHRLIB_VERSION)$(SHRLIB_SUFFIX_BASE) LOADABLE_SHRLIB_LDFLAGS = -bundle -flat_namespace -undefined suppress diff --git a/configure/os/CONFIG.Common.win32-x86-cygwin b/configure/os/CONFIG.Common.win32-x86-cygwin index 4ee133578..4994ea682 100644 --- a/configure/os/CONFIG.Common.win32-x86-cygwin +++ b/configure/os/CONFIG.Common.win32-x86-cygwin @@ -55,11 +55,12 @@ STATIC_CXXFLAGS_NO= $(VISC_DLL) -D_DLL # But: if there are no objects LIBRARY_LD_OBJS to include # in this library (may be for e.g. base/src/libCompat # on some archs), don't define (and build) any library! -SHRLIB_PREFIX= -SHRLIB_SUFFIX=.dll +SHRLIB_PREFIX = +SHRLIB_SUFFIX_BASE = .dll +SHRLIB_SUFFIX = $(SHRLIB_SUFFIX_BASE) SHRLIBNAME_YES = $(BUILD_LIBRARY:%=%$(SHRLIB_SUFFIX)) -LOADABLE_SHRLIB_PREFIX= -LOADABLE_SHRLIB_SUFFIX=.dll +LOADABLE_SHRLIB_PREFIX = +LOADABLE_SHRLIB_SUFFIX = $(SHRLIB_SUFFIX_BASE) LOADABLE_SHRLIBNAME = $(LOADABLE_BUILD_LIBRARY:%=%$(LOADABLE_SHRLIB_SUFFIX)) # diff --git a/configure/os/CONFIG.Common.win32-x86-mingw b/configure/os/CONFIG.Common.win32-x86-mingw index 3eda940a8..a229902a7 100644 --- a/configure/os/CONFIG.Common.win32-x86-mingw +++ b/configure/os/CONFIG.Common.win32-x86-mingw @@ -49,11 +49,12 @@ STATIC_CXXFLAGS_NO= $(VISC_DLL) -D_DLL # But: if there are no objects LIBRARY_LD_OBJS to include # in this library (may be for e.g. base/src/libCompat # on some archs), don't define (and build) any library! -SHRLIB_PREFIX= -SHRLIB_SUFFIX=.dll +SHRLIB_PREFIX = +SHRLIB_SUFFIX_BASE = .dll +SHRLIB_SUFFIX = $(SHRLIB_SUFFIX_BASE) SHRLIBNAME_YES = $(BUILD_LIBRARY:%=%$(SHRLIB_SUFFIX)) -LOADABLE_SHRLIB_PREFIX= -LOADABLE_SHRLIB_SUFFIX=.dll +LOADABLE_SHRLIB_PREFIX = +LOADABLE_SHRLIB_SUFFIX = $(SHRLIB_SUFFIX_BASE) LOADABLE_SHRLIBNAME = $(LOADABLE_BUILD_LIBRARY:%=%$(LOADABLE_SHRLIB_SUFFIX)) # diff --git a/configure/os/CONFIG.darwinCommon.darwinCommon b/configure/os/CONFIG.darwinCommon.darwinCommon index 454dfaf20..7e02bbf82 100644 --- a/configure/os/CONFIG.darwinCommon.darwinCommon +++ b/configure/os/CONFIG.darwinCommon.darwinCommon @@ -70,7 +70,8 @@ SHRLIB_LDFLAGS = -dynamiclib -flat_namespace -undefined suppress \ -install_name $(shell perl $(TOOLS)/fullPathName.pl $(INSTALL_LIB))/$@ \ -compatibility_version $(EPICS_VERSION).$(EPICS_REVISION) \ -current_version $(SHRLIB_VERSION) -SHRLIB_SUFFIX = .$(SHRLIB_VERSION).dylib +SHRLIB_SUFFIX_BASE = .dylib +SHRLIB_SUFFIX = .$(SHRLIB_VERSION)$(SHRLIB_SUFFIX_BASE) LOADABLE_SHRLIB_LDFLAGS = -bundle -flat_namespace -undefined suppress diff --git a/configure/os/CONFIG.win32-x86-borland.win32-x86-borland b/configure/os/CONFIG.win32-x86-borland.win32-x86-borland index c2c93e106..5be025f73 100644 --- a/configure/os/CONFIG.win32-x86-borland.win32-x86-borland +++ b/configure/os/CONFIG.win32-x86-borland.win32-x86-borland @@ -176,7 +176,8 @@ LINK.shrlib+= $(DLL_DEF_FLAG),$(LIBRARY_LD_RESS) # But: if there are no objects LIBRARY_LD_OBJS to include # in this library (may be for e.g. base/src/libCompat # on some archs), don't define (and build) any library! -SHRLIB_SUFFIX=.dll +SHRLIB_SUFFIX_BASE = .dll +SHRLIB_SUFFIX = $(SHRLIB_SUFFIX_BASE) SHRLIBNAME_YES = $(BUILD_LIBRARY:%=%$(SHRLIB_SUFFIX)) LOADABLE_SHRLIBNAME = $(LOADABLE_BUILD_LIBRARY:%=%$(SHRLIB_SUFFIX)) diff --git a/configure/os/CONFIG.win32-x86.win32-x86 b/configure/os/CONFIG.win32-x86.win32-x86 index 65a2be4eb..a9fa77ca8 100644 --- a/configure/os/CONFIG.win32-x86.win32-x86 +++ b/configure/os/CONFIG.win32-x86.win32-x86 @@ -212,7 +212,8 @@ MUNCH_CMD = $(CCC) /Fo $@ $^ # But: if there are no objects LIBRARY_LD_OBJS to include # in this library (may be for e.g. base/src/libCompat # on some archs), don't define (and build) any library! -SHRLIB_SUFFIX=.dll +SHRLIB_SUFFIX_BASE = .dll +SHRLIB_SUFFIX = $(SHRLIB_SUFFIX_BASE) SHRLIBNAME_YES = $(BUILD_LIBRARY:%=%$(SHRLIB_SUFFIX)) LOADABLE_SHRLIBNAME = $(LOADABLE_BUILD_LIBRARY:%=%$(SHRLIB_SUFFIX)) From 8ed86967d1ae300945114f682014ba72cf0e42e0 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 30 Mar 2012 15:52:19 -0500 Subject: [PATCH 10/11] Don't build command-line programs for iOS targets. --- src/catools/Makefile | 1 + src/softIoc/Makefile | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/catools/Makefile b/src/catools/Makefile index 2d18c9411..d5929b340 100644 --- a/src/catools/Makefile +++ b/src/catools/Makefile @@ -25,6 +25,7 @@ catools_LIBS += ca Com PROD_DEFAULT += caget camonitor cainfo caput PROD_vxWorks = -nil- PROD_RTEMS = -nil- +PROD_iOS = -nil- PROD_LIBS += catools ca Com catools_DIR = . diff --git a/src/softIoc/Makefile b/src/softIoc/Makefile index 80989a450..c3e867963 100644 --- a/src/softIoc/Makefile +++ b/src/softIoc/Makefile @@ -9,7 +9,8 @@ TOP=../.. include $(TOP)/configure/CONFIG -PROD_IOC = softIoc +PROD_IOC_DEFAULT = softIoc +PROD_IOC_iOS = -nil- DBD += softIoc.dbd softIoc_DBD += base.dbd From 0a0302daad41ec2407e0863299d2970c6f42b140 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 4 Apr 2012 11:57:45 -0500 Subject: [PATCH 11/11] documentation: Update the Converting from 3.13 document. --- documentation/ConvertingR3.13AppsToR3.14.html | 170 +++++++++--------- 1 file changed, 88 insertions(+), 82 deletions(-) diff --git a/documentation/ConvertingR3.13AppsToR3.14.html b/documentation/ConvertingR3.13AppsToR3.14.html index ec95db2f0..824720bf1 100644 --- a/documentation/ConvertingR3.13AppsToR3.14.html +++ b/documentation/ConvertingR3.13AppsToR3.14.html @@ -19,7 +19,7 @@ builds with release R3.14. It describes procedures such that:

  • The application uses the configure rules which are new to R3.14.
  • The OSI (Operating System Independent) features of R3.14 are available, i.e. iocCore products can be build for vxWorks as well as other - platforms, e.g. solaris and linux.
  • + platforms, e.g. Solaris and Linux.

    Gnumake clean uninstall

    @@ -47,10 +47,14 @@ find *App iocBoot -print | cpio -pvmd /path/to/new/top

    Modify top/configure/RELEASE

    -

    Copy definitions of external modules excluding EPICS_BASE and -TEMPLATES_TOP from old application RELEASE file.
    -If sequence programs (*.st or *.stt files) exist in your application, add the -SNCSEQ location definition for the R3.14 sncseq external module

    +

    Copy definitions of external modules excluding EPICS_BASE and +TEMPLATE_TOP from your old application config/RELEASE file. In many +cases the modules you actually use under R3.14 will be different to the R3.13 +modules, but the old module names here give you a starting-point for what there +replacements will be.

    + +

    If any sequence programs (*.st or *.stt files) exist in your application, add +the SNCSEQ location definition for the R3.14 sncseq external module.

    SNCSEQ = /path/to/sncseq
    @@ -107,7 +111,7 @@ still to convert):

    This new Makefile has comments explaining how to build the various host -and ioc products. Lets consider some examples

    +and IOC products. Lets consider some examples

    • Host programs

      Makefile.Host contains definitions like:

      @@ -149,7 +153,7 @@ DBDNAME = exampleApp.dbd

      NOTES: Change exampleApp.dbd to example.dbd in all st.cmd files. Also this definition assumes that file exampleInclude.dbd exists.

    • -
    • Create the ioc application: +
    • Create the IOC application:

      Makefile.Vx contains statements like:

      SRCS.c += ../xxxRecord.c
      @@ -198,21 +202,22 @@ baseLIBOBJS, Makefile.Host, and Makefile.Vx

      to your appnameInclude.dbd file and remove the file -nameApp/src/base.dbd from your src directory. The base.dbd from base/dbd -will be used instead. If you only want to load a subset of the record -definitions from base you can keep your own copy of base.dbd, but you should -copy the one from your R3.14 base and edit that rather than trying to re-use the -R3.13 version from your old application.

      +nameApp/src/base.dbd from your src directory. The base.dbd file from +$(EPICS_BASE)/dbd will be used instead. If you only want to load a subset of the +record definitions from base you can keep a local edited copy of the base.dbd +file but you should copy it from $(EPICS_BASE)/dbd and edit that rather than +trying to re-use the R3.13 version from your old application area.

      Record support

      -

      Add the following line after all existing #includes

      +

      Add the following header file inclusion after all other #include + statements:

      #include "epicsExport.h"
      -

      The structure rset is now a typedef so change

      +

      The struct rset is now available as a typedef so change

      struct rset recordnameRSET = { ... };
      @@ -224,65 +229,68 @@ R3.13 version from your old application.

      rset recordnameRSET = { ... };
      -

      and add the following line after the rset recordnameRSET = { ... -}; definition.

      +

      and add the following line immediately after that definition:

      -
      epicsExportAddress(rset,recordnameRSET);
      +
      epicsExportAddress(rset, recordnameRSET);

      Device support

      -

      Add the following line after all existing #includes

      +

      Add the following header file inclusion after all other #include + statements:

      #include "epicsExport.h"
      -

      and add the following line after the dset definition struct { ... } -devname = { ... };

      +

      and add the following line after every dset definition struct { ... } + devname = { ... }; in the file.

      -
      epicsExportAddress(dset,devname);
      +
      epicsExportAddress(dset, devname);

      Driver support

      -

      Add the following line after all existing #includes

      +

      Add the following header file inclusion after all other #include + statements:

      #include "epicsExport.h"
      -

      and add the following line after the drvet drvname definition

      +

      and add the following line after the drvet drvname + definition:

      -
      epicsExportAddress(drvet,drvname);
      +
      epicsExportAddress(drvet, drvname);

      Registration code changed

      Registration code for application specific functions, e.g. subroutine record -init and process functions, must be changed as follows

      + init and process functions, must be changed as follows

        -
      1. Include the following header files after all existing #includes: +
      2. Add the following header file inclusions after all other #include + statements:
        #include "registryFunction.h"
         #include "epicsExport.h"
      3. -
      4. Make the application specific functions static functions, e.g. +
      5. Mark the application specific functions as static, e.g.
        static long mySubInit(subRecord *precord)
         static long mySubProcess(subRecord *precord)
      6. -
      7. Add an epicsExportFunction statement for each of the functions to be - registered, e.g. +
      8. Add an epicsRegisterFunction statement for each of the functions + to be registered, e.g.
        -
        epicsExportFunction(mySubInit);
        -epicsExportFunction(mySubProcess);
        +
        epicsRegisterFunction(mySubInit);
        +epicsRegisterFunction(mySubProcess);
      9. Add a function statement for each of the functions to be registered in a @@ -293,6 +301,21 @@ function("mySubProcess")
      +

      Additional Headers

      + +

      It may be necessary to add one or more of the following header file + inclusions to any C source file if you get warnings or errors from the + compilation process. The most likely file missing is errlog.h.

      + +
        +
      • #include <stdarg.h>
      • +
      • #include "errlog.h"
      • +
      • #include "errMdef.h"
      • +
      • #include "ellLib.h"
      • +
      • #include "epicsTypes.h"
      • +
      + +

      Modify the Makefiles in top/iocBoot directory.

      Change include $(TOP)/config/CONFIG_APP to include @@ -351,14 +374,13 @@ $(TOP)/configure/RULES.ioc

      ld < iocCore -

      Change ld < nameLib to +

      The ld command in vxWorks 5.5.2 doesn't clean up its standard input +stream properly, so we now recommend passing the filename to it as an argument +instead. Change ld < nameLib to

      ld 0,0, "name.munch"
      - -

      (The ld command in vxWorks 5.5.2 doesn't clean up its standard - input properly, so we now recommend passing the filename to it directly - instead.)

      +

      Change cd appbin to cd topbin

      @@ -381,58 +403,42 @@ to

      If any source file makes calls to recGbl routines make sure it includes recGbl.h. If it doesn't the compiler will issue warning messages and -the ioc may issue the message: undefined symbol: _recGblSetSevr.

      +the IOC may not compile properly, or on vxWorks you could see the load-time +error: undefined symbol: _recGblSetSevr.

      Record support changes

      -

      The steppermotor, scan, and pid records are no longer in base. If these -records are not used in your application, comment out references to them in -base.dbd. If these record types are used at your site, they should be -downloaded and built with base R3.14 by your EPICS administrator. To update -the R3.14 location of these record types in your application you must add -appropriate module definitions to your application's config/RELEASE file and -add LIBOBJS definitions to the src Makefile.

      +

      The steppermotor, scan, and pid records are no longer in base. If these +record types are used at your site, their unbundled modules should be downloaded +from the EPICS website and built with base R3.14 by your EPICS administrator. To +use these record types in your application you must add them to the application +just like any other external support module. Most modules provide instructions +on how to use them in an IOC application.

      -

      For example add

      - -
      -
      PID = /path/to/modules/pid
      -
      - -

      to config/RELEASE and add

      - -
      -
      LIBOBJS += $(PID_BIN)/pidRecord.o
      -
      - -

      to your application src/Makefile.

      - -

      You should consider changing any existing old steppermotor records to the -new EPICS motor record module supported by Beamline Controls and Data -Acquisition at APS.

      +

      Consider changing any existing old steppermotor records to the EPICS motor +record module supported by the Beamline Controls and Data Acquisition group at +APS.

      RecDynLink.o and devPtSoft changes

      recDynLink.o and devPtSoft.o are no longer in EPICS base and now exist as -separate EPICS modules.You must now add the appropriate module full path -definitions to your application config/RELEASE file, and change -LIBOBJS location definition $(EPICS_BASE_BIN) to the module -definition bin directory in your application src directory files. See -Hardware support changes below for instructions.

      +separate unbundled EPICS modules. As with the three record types described +above these must now be built separately and added as support modules to any +applications that need them.

      Hardware support changes

      All hardware support (dev, drv and dbd files) except soft support has been unbundled from base R3.14. This support includes the files symb.dbd, drvHp1404a.o, drvEpvxiMsg.o, and drvEpvxi.o. If these are not used by your -application, comment out references to them in base.dbd.

      +application, remove any references to them from your dbd files.

      -

      Hardware support now exists as separate EPICS modules. The hardware -support for your site should be downloaded and built with base R3.14 by your -EPICS administrator. You must now add the appropriate module full path -definitions to your application config/RELEASE file, and change -LIBOBJS location from $(EPICS_BASE_BIN) to the module bin -directory in your application src directory files.

      +

      Hardware support now exists as separate EPICS modules. The hardware support +modules used at your site should be downloaded and built with base R3.14 by your +EPICS administrator. To use them, add the appropriate module full path +definitions to your application configure/RELEASE file, and make the documented +changes to your Makefile to link their binaries into the your IOC +executable.

      For example, remove

      @@ -440,7 +446,7 @@ directory in your application src directory files.

      LIBOBJS += $(EPICS_BASE_BIN)/symb
      -

      from baseLIBOBJS and add

      +

      from baseLIBOBJS and add

      LIBOBJS += $(SYMB_BIN)/symb
      @@ -452,25 +458,25 @@ directory in your application src directory files.

      SYMB = <full path definition for the built module SYMB>
      -

      into your application config/RELEASE file.

      +

      into your application configure/RELEASE file.

      dbLoadtemplate tool changes

      -

      The host tool dbLoadTemplate has been replace by a new EPICS extension, +

      The host tool dbLoadTemplate has been replace by a new EPICS extension called msi, which should be downloaded and built with base R3.14 by your EPICS -administrator. dbLoadTemplate is still supported on iocs. If, in your -application, db files are created from template and substitution files you -should add the definition

      +administrator. dbLoadTemplate is still supported on IOCs. If the msi executable +is not in your default search path and in your application db files are created +from template and substitution files, you should add the definition

      MSI = <full path name to msi executable>
      -

      to your application config/RELEASE file.

      - +

      to your application's configure/RELEASE file.

      -

      Optional top/configure/CONFIG_SITE changes.

      +

      Optional top/configure/CONFIG_SITE changes

      Review and optionally modify site build settings.

      +