Compare commits
49 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a7826646c0 | ||
|
|
f103a0b376 | ||
|
|
a249561677 | ||
|
|
96887926bf | ||
|
|
c8647ffab7 | ||
|
|
4b884c15b1 | ||
|
|
0ace4e4a30 | ||
|
|
3cf2d3737f | ||
|
|
7c168f20f4 | ||
|
|
5cddcea829 | ||
|
|
9b69e63a69 | ||
|
|
422513990e | ||
|
|
3313860691 | ||
|
|
2b8eb97b79 | ||
|
|
9842bd1b20 | ||
|
|
e7ea81c7a2 | ||
|
|
c528948f45 | ||
|
|
00e9ecf7b5 | ||
|
|
65b34874bd | ||
|
|
939d84f31a | ||
|
|
67fcd65656 | ||
|
|
3be67aca3c | ||
|
|
ebf4a155d7 | ||
|
|
28531b0dbb | ||
|
|
5c3ecf9054 | ||
|
|
e8c5748f89 | ||
|
|
857527280b | ||
|
|
d1ddbad053 | ||
|
|
b55c019f10 | ||
|
|
31584e52be | ||
|
|
2eb5af3167 | ||
|
|
fa069b0845 | ||
|
|
c78db512f2 | ||
|
|
29e9843056 | ||
|
|
0c4ab7b24a | ||
|
|
d831c2b384 | ||
|
|
34d06b6e36 | ||
|
|
b2f7f4e173 | ||
|
|
3c7fb7990f | ||
|
|
c359b49aed | ||
|
|
c140a0a804 | ||
|
|
0bc2a3e999 | ||
|
|
8e7702c8a5 | ||
|
|
5f94ab6d9f | ||
|
|
6ac10d43b1 | ||
|
|
c6af4a245d | ||
|
|
9184983cf0 | ||
|
|
30172226f9 | ||
|
|
2ea0994507 |
2
.ci
2
.ci
Submodule .ci updated: ad8dd4a136...20f8e05393
32
.github/workflows/ci-scripts-build.yml
vendored
32
.github/workflows/ci-scripts-build.yml
vendored
@@ -17,6 +17,12 @@ on:
|
|||||||
- '**/*.html'
|
- '**/*.html'
|
||||||
- '**/*.md'
|
- '**/*.md'
|
||||||
pull_request:
|
pull_request:
|
||||||
|
paths-ignore:
|
||||||
|
- 'documentation/*'
|
||||||
|
- 'startup/*'
|
||||||
|
- '.appveyor/*'
|
||||||
|
- '**/*.html'
|
||||||
|
- '**/*.md'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
SETUP_PATH: .ci-local:.ci
|
SETUP_PATH: .ci-local:.ci
|
||||||
@@ -57,11 +63,6 @@ jobs:
|
|||||||
extra: "CMD_CXXFLAGS=-std=c++11"
|
extra: "CMD_CXXFLAGS=-std=c++11"
|
||||||
name: "Ub-20 gcc-9 C++11, static"
|
name: "Ub-20 gcc-9 C++11, static"
|
||||||
|
|
||||||
- os: ubuntu-16.04
|
|
||||||
cmp: clang
|
|
||||||
configuration: default
|
|
||||||
name: "Ub-16 clang-9"
|
|
||||||
|
|
||||||
- os: ubuntu-20.04
|
- os: ubuntu-20.04
|
||||||
cmp: clang
|
cmp: clang
|
||||||
configuration: default
|
configuration: default
|
||||||
@@ -80,18 +81,6 @@ jobs:
|
|||||||
rtems: "4.9"
|
rtems: "4.9"
|
||||||
name: "Ub-20 gcc-9 + RT-4.9"
|
name: "Ub-20 gcc-9 + RT-4.9"
|
||||||
|
|
||||||
- os: ubuntu-16.04
|
|
||||||
cmp: gcc-4.8
|
|
||||||
utoolchain: true
|
|
||||||
configuration: default
|
|
||||||
name: "Ub-16 gcc-4.8"
|
|
||||||
|
|
||||||
- os: ubuntu-16.04
|
|
||||||
cmp: gcc-4.9
|
|
||||||
utoolchain: true
|
|
||||||
configuration: default
|
|
||||||
name: "Ub-16 gcc-4.9"
|
|
||||||
|
|
||||||
- os: ubuntu-20.04
|
- os: ubuntu-20.04
|
||||||
cmp: gcc-8
|
cmp: gcc-8
|
||||||
utoolchain: true
|
utoolchain: true
|
||||||
@@ -129,10 +118,12 @@ jobs:
|
|||||||
if: runner.os == 'Linux'
|
if: runner.os == 'Linux'
|
||||||
- name: "apt-get install ${{ matrix.cmp }}"
|
- name: "apt-get install ${{ matrix.cmp }}"
|
||||||
run: |
|
run: |
|
||||||
|
export GCC_NAME="${{ matrix.cmp }}"
|
||||||
|
sudo apt-get update
|
||||||
sudo apt-get -y install software-properties-common
|
sudo apt-get -y install software-properties-common
|
||||||
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get -y install ${{ matrix.cmp }}
|
sudo apt-get -y install g++-${GCC_NAME#gcc-}
|
||||||
if: matrix.utoolchain
|
if: matrix.utoolchain
|
||||||
- name: Prepare and compile dependencies
|
- name: Prepare and compile dependencies
|
||||||
run: python .ci/cue.py prepare
|
run: python .ci/cue.py prepare
|
||||||
@@ -141,9 +132,12 @@ jobs:
|
|||||||
- name: Run main module tests
|
- name: Run main module tests
|
||||||
run: python .ci/cue.py test
|
run: python .ci/cue.py test
|
||||||
- name: Upload tapfiles Artifact
|
- name: Upload tapfiles Artifact
|
||||||
uses: actions/upload-artifact@v2
|
if: ${{ always() }}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: tapfiles ${{ matrix.name }}
|
name: tapfiles ${{ matrix.name }}
|
||||||
path: '**/O.*/*.tap'
|
path: '**/O.*/*.tap'
|
||||||
|
if-no-files-found: ignore
|
||||||
- name: Collect and show test results
|
- name: Collect and show test results
|
||||||
|
if: ${{ always() }}
|
||||||
run: python .ci/cue.py test-results
|
run: python .ci/cue.py test-results
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ EPICS_VERSION = 3
|
|||||||
EPICS_REVISION = 15
|
EPICS_REVISION = 15
|
||||||
|
|
||||||
# EPICS_MODIFICATION must be a number >=0 and <256
|
# EPICS_MODIFICATION must be a number >=0 and <256
|
||||||
EPICS_MODIFICATION = 8
|
EPICS_MODIFICATION = 9
|
||||||
|
|
||||||
# EPICS_PATCH_LEVEL must be a number (win32 resource file requirement)
|
# EPICS_PATCH_LEVEL must be a number (win32 resource file requirement)
|
||||||
# Not included if zero
|
# Not included if zero
|
||||||
@@ -35,10 +35,6 @@ EPICS_PATCH_LEVEL = 1
|
|||||||
|
|
||||||
# This will end in -DEV between official releases
|
# This will end in -DEV between official releases
|
||||||
EPICS_DEV_SNAPSHOT=-DEV
|
EPICS_DEV_SNAPSHOT=-DEV
|
||||||
#EPICS_DEV_SNAPSHOT=-pre1
|
|
||||||
#EPICS_DEV_SNAPSHOT=-pre1-DEV
|
|
||||||
#EPICS_DEV_SNAPSHOT=-rc1
|
|
||||||
#EPICS_DEV_SNAPSHOT=-rc1-DEV
|
|
||||||
#EPICS_DEV_SNAPSHOT=
|
#EPICS_DEV_SNAPSHOT=
|
||||||
|
|
||||||
# No changes should be needed below here
|
# No changes should be needed below here
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ cleanArchTargets = $(foreach arch,$(BUILD_ARCHS), clean$(DIVIDER)$(arch))
|
|||||||
-include $(TOP)/configure/CONFIG_APP_INCLUDE
|
-include $(TOP)/configure/CONFIG_APP_INCLUDE
|
||||||
|
|
||||||
all: install
|
all: install
|
||||||
ifeq ($(EPICS_HOST_ARCH),$T_A)
|
ifeq ($(EPICS_HOST_ARCH),$(T_A))
|
||||||
host: install
|
host: install
|
||||||
else
|
else
|
||||||
# Do nothing
|
# Do nothing
|
||||||
@@ -187,7 +187,8 @@ endif
|
|||||||
|
|
||||||
##################################################### build dependancies, clean rule
|
##################################################### build dependancies, clean rule
|
||||||
|
|
||||||
inc : $(COMMON_INC) $(INSTALL_INC)
|
inc : $(COMMON_INC) $(INSTALL_INC) $(COMMON_DBDS) $(COMMON_DBDCATS) \
|
||||||
|
$(INSTALL_DBDS) $(INSTALL_DBD_INSTALLS)
|
||||||
|
|
||||||
build : $(COMMON_DBDS) $(COMMON_DBS) $(COMMON_DBDCATS) \
|
build : $(COMMON_DBDS) $(COMMON_DBS) $(COMMON_DBDCATS) \
|
||||||
$(INSTALL_DBDS) $(INSTALL_DBS) \
|
$(INSTALL_DBDS) $(INSTALL_DBS) \
|
||||||
@@ -428,26 +429,26 @@ $(foreach file, $(DBD_INSTALLS), $(eval $(call DBD_INSTALLS_template, $(file))))
|
|||||||
##################################################### HTML files
|
##################################################### HTML files
|
||||||
|
|
||||||
$(COMMON_DIR)/%.html: %.dbd.pod $(TOOLS)/dbdToHtml.pl
|
$(COMMON_DIR)/%.html: %.dbd.pod $(TOOLS)/dbdToHtml.pl
|
||||||
@$(RM) $(notdir $@)
|
@$(RM) $@ $(notdir $@)
|
||||||
$(PERL) $(TOOLS)/dbdToHtml.pl $(DBDFLAGS) -o $(notdir $@) $<
|
$(PERL) $(TOOLS)/dbdToHtml.pl $(DBDFLAGS) -o $(notdir $@) $<
|
||||||
@$(MV) $(notdir $@) $@
|
@$(MV) $(notdir $@) $@
|
||||||
|
|
||||||
$(COMMON_DIR)/%.html: %.pod $(TOOLS)/podToHtml.pl
|
$(COMMON_DIR)/%.html: %.pod $(TOOLS)/podToHtml.pl
|
||||||
@$(RM) $(notdir $@)
|
@$(RM) $@ $(notdir $@)
|
||||||
$(PERL) $(TOOLS)/podToHtml.pl -o $(notdir $@) $<
|
$(PERL) $(TOOLS)/podToHtml.pl -o $(notdir $@) $<
|
||||||
@$(MV) $(notdir $@) $@
|
@$(MV) $(notdir $@) $@
|
||||||
|
|
||||||
$(COMMON_DIR)/%.html: %.pm $(TOOLS)/podToHtml.pl
|
$(COMMON_DIR)/%.html: %.pm $(TOOLS)/podToHtml.pl
|
||||||
@$(RM) $(notdir $@)
|
@$(RM) $@ $(notdir $@)
|
||||||
$(PERL) $(TOOLS)/podToHtml.pl -o $(notdir $@) $<
|
$(PERL) $(TOOLS)/podToHtml.pl -o $(notdir $@) $<
|
||||||
@$(MV) $(notdir $@) $@
|
@$(MV) $(notdir $@) $@
|
||||||
|
|
||||||
$(COMMON_DIR)/%.html: ../%.pm $(TOOLS)/podToHtml.pl
|
$(COMMON_DIR)/%.html: ../%.pm $(TOOLS)/podToHtml.pl
|
||||||
@$(RM) $(notdir $@)
|
@$(RM) $@ $(notdir $@)
|
||||||
$(PERL) $(TOOLS)/podToHtml.pl -o $(notdir $@) $<
|
$(PERL) $(TOOLS)/podToHtml.pl -o $(notdir $@) $<
|
||||||
@$(MV) $(notdir $@) $@
|
@$(MV) $(notdir $@) $@
|
||||||
|
|
||||||
.PRECIOUS: $(COMMON_DIR)/%.html %.html
|
.PRECIOUS: $(COMMON_DIR)/%.html
|
||||||
|
|
||||||
##################################################### DB files
|
##################################################### DB files
|
||||||
|
|
||||||
|
|||||||
@@ -86,17 +86,20 @@ endif
|
|||||||
#---------------------------------------------------------------
|
#---------------------------------------------------------------
|
||||||
# Include defines and rules for prod, library and test* targets
|
# Include defines and rules for prod, library and test* targets
|
||||||
|
|
||||||
#ifneq (,$(strip $(PROD) $(TESTPROD) $(LIBRARY) $(TESTLIBRARY) $(LOADABLE_LIBRARY) ))
|
ifneq (,$(strip $(PROD) $(TESTPROD) $(LIBRARY) $(TESTLIBRARY) \
|
||||||
|
$(LOADABLE_LIBRARY)))
|
||||||
include $(CONFIG)/RULES_TARGET
|
include $(CONFIG)/RULES_TARGET
|
||||||
#endif
|
endif
|
||||||
|
|
||||||
#---------------------------------------------------------------
|
#---------------------------------------------------------------
|
||||||
# Read dependency files
|
# Read dependency files
|
||||||
|
|
||||||
|
ifneq (inc,$(strip $(MAKECMDGOALS)))
|
||||||
ifneq (,$(strip $(HDEPENDS_FILES)))
|
ifneq (,$(strip $(HDEPENDS_FILES)))
|
||||||
$(filter-out $(wildcard *$(DEP)), $(HDEPENDS_FILES)): | $(COMMON_INC)
|
$(filter-out $(wildcard *$(DEP)), $(HDEPENDS_FILES)): | $(COMMON_INC)
|
||||||
-include $(HDEPENDS_FILES)
|
-include $(HDEPENDS_FILES)
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
#---------------------------------------------------------------
|
#---------------------------------------------------------------
|
||||||
# Products and Object libraries
|
# Products and Object libraries
|
||||||
@@ -144,14 +147,14 @@ build: inc
|
|||||||
build: $(OBJSNAME) $(LIBTARGETS) $(PRODTARGETS) $(TESTPRODTARGETS) \
|
build: $(OBJSNAME) $(LIBTARGETS) $(PRODTARGETS) $(TESTPRODTARGETS) \
|
||||||
$(TARGETS) $(TESTSCRIPTS) $(INSTALL_LIB_INSTALLS)
|
$(TARGETS) $(TESTSCRIPTS) $(INSTALL_LIB_INSTALLS)
|
||||||
|
|
||||||
inc : $(COMMON_INC) $(INSTALL_INC) $(INSTALL_CONFIGS)
|
inc : $(COMMON_INC) $(INSTALL_INC) $(INSTALL_CONFIGS) \
|
||||||
|
$(INSTALL_HTMLS)
|
||||||
|
|
||||||
buildInstall : \
|
buildInstall : \
|
||||||
$(INSTALL_SCRIPTS) $(INSTALL_PROD) $(INSTALL_MUNCHS) \
|
$(INSTALL_SCRIPTS) $(INSTALL_PROD) $(INSTALL_MUNCHS) \
|
||||||
$(INSTALL_TCLLIBS) $(INSTALL_TCLINDEX) \
|
$(INSTALL_TCLLIBS) $(INSTALL_TCLINDEX) \
|
||||||
$(INSTALL_OBJS) \
|
$(INSTALL_OBJS) \
|
||||||
$(INSTALL_DOCS) \
|
$(INSTALL_DOCS) \
|
||||||
$(INSTALL_HTMLS) \
|
|
||||||
$(INSTALL_TEMPLATE) \
|
$(INSTALL_TEMPLATE) \
|
||||||
$(INSTALL_BIN_INSTALLS)
|
$(INSTALL_BIN_INSTALLS)
|
||||||
|
|
||||||
@@ -495,6 +498,10 @@ $(INSTALL_DOC)/%: ../%
|
|||||||
$(ECHO) "Installing doc $@"
|
$(ECHO) "Installing doc $@"
|
||||||
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(INSTALL_DOC)
|
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(INSTALL_DOC)
|
||||||
|
|
||||||
|
$(INSTALL_HTML)/$(HTMLS_DIR)/%: $(COMMON_DIR)/%
|
||||||
|
$(ECHO) "Installing generated html $@"
|
||||||
|
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
|
||||||
|
|
||||||
$(INSTALL_HTML)/$(HTMLS_DIR)/%: %
|
$(INSTALL_HTML)/$(HTMLS_DIR)/%: %
|
||||||
$(ECHO) "Installing html $@"
|
$(ECHO) "Installing html $@"
|
||||||
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
|
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
|
||||||
@@ -503,10 +510,6 @@ $(INSTALL_HTML)/$(HTMLS_DIR)/%: ../%
|
|||||||
$(ECHO) "Installing html $@"
|
$(ECHO) "Installing html $@"
|
||||||
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
|
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
|
||||||
|
|
||||||
$(INSTALL_HTML)/$(HTMLS_DIR)/%: $(COMMON_DIR)/%
|
|
||||||
$(ECHO) "Installing generated html $@"
|
|
||||||
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
|
|
||||||
|
|
||||||
$(INSTALL_TEMPLATES_SUBDIR)/%: ../%
|
$(INSTALL_TEMPLATES_SUBDIR)/%: ../%
|
||||||
$(ECHO) "Installing $@"
|
$(ECHO) "Installing $@"
|
||||||
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
|
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ $(foreach target, $(PROD) $(TESTPROD) $(LIBRARY) $(TESTLIBRARY) $(LOADABLE_LIBRA
|
|||||||
|
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
|
|
||||||
# This define block requires GNU make 3.81
|
|
||||||
define PROD_template
|
define PROD_template
|
||||||
ifeq ($$(strip $$($(1)_OBJS) $$($(1)_SRCS) $$(PRODUCT_OBJS)),)
|
ifeq ($$(strip $$($(1)_OBJS) $$($(1)_SRCS) $$(PRODUCT_OBJS)),)
|
||||||
$(1)_OBJS = $(1)$$(OBJ)
|
$(1)_OBJS = $(1)$$(OBJ)
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ help:
|
|||||||
@echo "Usage: gnumake [options] [target] ..."
|
@echo "Usage: gnumake [options] [target] ..."
|
||||||
@echo "Targets supported by all Makefiles:"
|
@echo "Targets supported by all Makefiles:"
|
||||||
@echo " all - Same as install (default rule)"
|
@echo " all - Same as install (default rule)"
|
||||||
@echo " inc - Installs header files"
|
@echo " inc - Installs header, dbd and html files"
|
||||||
@echo " build - Builds and installs all targets"
|
@echo " build - Builds and installs all targets"
|
||||||
@echo " install - Builds and installs all targets"
|
@echo " install - Builds and installs all targets"
|
||||||
@echo " buildInstall - Same as install (deprecated)"
|
@echo " buildInstall - Same as install (deprecated)"
|
||||||
|
|||||||
14
configure/os/CONFIG.Common.darwin-aarch64
Normal file
14
configure/os/CONFIG.Common.darwin-aarch64
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# CONFIG.Common.darwin-aarch64
|
||||||
|
#
|
||||||
|
# This file is maintained by the build community.
|
||||||
|
#
|
||||||
|
# Definitions for darwin-aarch64 target builds
|
||||||
|
# Sites may override these definitions in CONFIG_SITE.Common.darwin-aarch64
|
||||||
|
#-------------------------------------------------------
|
||||||
|
|
||||||
|
#
|
||||||
|
# To build universal binaries, configure ARCH_CLASS
|
||||||
|
# in the file CONFIG_SITE.Common.darwin-aarch64
|
||||||
|
|
||||||
|
# Include definitions common to all Darwin targets
|
||||||
|
include $(CONFIG)/os/CONFIG.darwinCommon.darwinCommon
|
||||||
8
configure/os/CONFIG.darwin-aarch64.Common
Normal file
8
configure/os/CONFIG.darwin-aarch64.Common
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# CONFIG.darwin-aarch64.Common
|
||||||
|
#
|
||||||
|
# Definitions for darwin-aarch64 host builds
|
||||||
|
# Sites may override these definitions in CONFIG_SITE.darwin-aarch64.Common
|
||||||
|
#-------------------------------------------------------
|
||||||
|
|
||||||
|
#Include definitions common to unix hosts
|
||||||
|
include $(CONFIG)/os/CONFIG.UnixCommon.Common
|
||||||
@@ -49,9 +49,9 @@ OPT_CFLAGS_YES_NO = -Ox -Oy-
|
|||||||
OPT_CFLAGS_YES = $(OPT_CFLAGS_YES_$(OPT_WHOLE_PROGRAM))
|
OPT_CFLAGS_YES = $(OPT_CFLAGS_YES_$(OPT_WHOLE_PROGRAM))
|
||||||
|
|
||||||
#
|
#
|
||||||
# -Zi generate program database for debugging information
|
# -Z7 generate C7 compatible debugging information (inside .obj)
|
||||||
# -RTCsu enable run-time error checks
|
# -RTCsu enable run-time error checks
|
||||||
OPT_CFLAGS_NO = -Zi -RTCsu
|
OPT_CFLAGS_NO = -Z7 -RTCsu
|
||||||
|
|
||||||
# specify object file name and location
|
# specify object file name and location
|
||||||
OBJ_CFLAG = -Fo
|
OBJ_CFLAG = -Fo
|
||||||
@@ -116,9 +116,9 @@ OPT_CXXFLAGS_YES_NO = -Ox -Oy-
|
|||||||
OPT_CXXFLAGS_YES = $(OPT_CXXFLAGS_YES_$(OPT_WHOLE_PROGRAM))
|
OPT_CXXFLAGS_YES = $(OPT_CXXFLAGS_YES_$(OPT_WHOLE_PROGRAM))
|
||||||
|
|
||||||
#
|
#
|
||||||
# -Zi generate program database for debugging information
|
# -Z7 generate C7 compatible debugging information (inside .obj)
|
||||||
# -RTCsu enable run-time error checks
|
# -RTCsu enable run-time error checks
|
||||||
OPT_CXXFLAGS_NO = -RTCsu -Zi
|
OPT_CXXFLAGS_NO = -RTCsu -Z7
|
||||||
|
|
||||||
# specify object file name and location
|
# specify object file name and location
|
||||||
OBJ_CXXFLAG = -Fo
|
OBJ_CXXFLAG = -Fo
|
||||||
@@ -140,20 +140,6 @@ STATIC_LDLIBS_NO=
|
|||||||
STATIC_LDFLAGS=
|
STATIC_LDFLAGS=
|
||||||
RANLIB=
|
RANLIB=
|
||||||
|
|
||||||
#
|
|
||||||
# option needed for parallel builds with Visual Studio 2013 onward
|
|
||||||
# VS2012 and above have VisualStudioVersion, so just need to exclude 2012 (11.0)
|
|
||||||
# -FS Force Synchronous PDB Writes
|
|
||||||
#
|
|
||||||
ifneq ($(VisualStudioVersion),)
|
|
||||||
ifneq ($(VisualStudioVersion),11.0)
|
|
||||||
OPT_CXXFLAGS_NO += -FS
|
|
||||||
OPT_CFLAGS_NO += -FS
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# add -profile here to run the ms profiler
|
# add -profile here to run the ms profiler
|
||||||
# -LTCG whole program optimization
|
# -LTCG whole program optimization
|
||||||
# -incremental:no full linking
|
# -incremental:no full linking
|
||||||
|
|||||||
9
configure/os/CONFIG_SITE.Common.darwin-aarch64
Normal file
9
configure/os/CONFIG_SITE.Common.darwin-aarch64
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# CONFIG_SITE.Common.darwin-aarch64
|
||||||
|
#
|
||||||
|
# Site override definitions for darwin-aarch64 target builds
|
||||||
|
#-------------------------------------------------------
|
||||||
|
|
||||||
|
#
|
||||||
|
# arm64 devices: Apple Silicon M1
|
||||||
|
|
||||||
|
ARCH_CLASS = arm64
|
||||||
@@ -1,184 +0,0 @@
|
|||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Installation notes for EPICS on Mac OS X (Darwin)</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
|
||||||
<h1>Building EPICS base</h1>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
To build base:
|
|
||||||
<ol>
|
|
||||||
<li>
|
|
||||||
Set the EPICS_HOST_ARCH environment variable to darwin-ppc, darwin-x86 or darwin-ppcx86.
|
|
||||||
The scripts in the
|
|
||||||
base/startup directory can automate this. For example, here's part
|
|
||||||
of my Bash login script (~/.bash_login):
|
|
||||||
<pre>
|
|
||||||
#
|
|
||||||
# EPICS
|
|
||||||
#
|
|
||||||
EPICS_BASE="${HOME}/src/EPICS/base"
|
|
||||||
EPICS_EXTENSIONS="${HOME}/src/EPICS/extensions"
|
|
||||||
<strong>.</strong> "${EPICS_BASE}"/startup/unix.sh
|
|
||||||
</pre>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<code>cd</code> to the EPICS base top-level source directory.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Uncomment the appropriate line in the relevent
|
|
||||||
EPICS_BASE/configure/os/CONFIG_SITE.Common.darwin-xxx file for your EPICS_HOST_ARCH value.
|
|
||||||
Newer versions of OS X (e.g. Snow Leopard) may include only 64 bit versions of some OS libraries,
|
|
||||||
so should only have the x86_64 ARCH_CLASS.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Run <code>make</code>.
|
|
||||||
</li>
|
|
||||||
</ol>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
As distributed, EPICS on Mac OS X uses the readline command line input
|
|
||||||
routines. IOC applications are more pleasant to interact with if
|
|
||||||
either the readline or libtecla library is used. The easiest
|
|
||||||
way to get either or both of these libraries on to your system is to
|
|
||||||
download and install them using the either the DarwinPorts
|
|
||||||
distribution or the Fink package manager. If you don't want to install
|
|
||||||
the readline library, set the COMMANDLINE_LIBRARY variable in one of
|
|
||||||
the CONFIG_SITE files to EPICS.
|
|
||||||
<p>
|
|
||||||
Information on DarwinPorts is available from
|
|
||||||
<a href="http://www.opendarwin.org/projects/darwinports/">the DarwinPorts
|
|
||||||
project page</a>.
|
|
||||||
DarwinPorts binary packages are available from
|
|
||||||
<a href="http://packages.opendarwin.org/">here</a>.
|
|
||||||
<p>
|
|
||||||
Fink may be downloaded from
|
|
||||||
<a href="http://fink.sourceforge.net/">the Source Forge</a>.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
If broadcasts are not seen locally, try adding "localhost" (127.0.0.1)
|
|
||||||
to the EPICS_CA_ADDR_LIST.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<h1>Building EPICS extensions</h1>
|
|
||||||
<p>
|
|
||||||
Many extensions build and run properly on OS X. To build and run medm, first
|
|
||||||
obtain the X11 run-time and developer packages from Apple and the OpenMotif3
|
|
||||||
package from Fink.
|
|
||||||
|
|
||||||
<h1>Objective-C and AppleScript</h1>
|
|
||||||
<p>
|
|
||||||
Code written in Objective-C can be included in host or IOC applications.
|
|
||||||
Here are a couple of short Objective-C examples which can be used to send
|
|
||||||
AppleScript events to other applications on the OS X machine.
|
|
||||||
|
|
||||||
<pre>
|
|
||||||
/*
|
|
||||||
* exampleAppleScriptRecord.m
|
|
||||||
*
|
|
||||||
* Simple Objective-C/AppleScript subroutine record
|
|
||||||
*
|
|
||||||
* To use this record in an application:
|
|
||||||
*
|
|
||||||
* 1) Make the following changes to the application Makefile:
|
|
||||||
* - Add exampleAppleScriptRecord.m to the application SRCS.
|
|
||||||
* - Add -framework Foundation to the application LDFLAGS.
|
|
||||||
* 2) Add the following line to the application database description:
|
|
||||||
* registrar(registerExampleAppleScript)
|
|
||||||
* 3) Add a record to the application database:
|
|
||||||
* record(sub,"setVolume")
|
|
||||||
* {
|
|
||||||
* field(SNAM,"exampleAppleScriptProcess")
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
#include <registryFunction.h>
|
|
||||||
#include <subRecord.h>
|
|
||||||
#include <alarm.h>
|
|
||||||
#include <errlog.h>
|
|
||||||
#include <recGbl.h>
|
|
||||||
#include <epicsExport.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Shim between EPICS and NSAppleScript class.
|
|
||||||
*/
|
|
||||||
static long
|
|
||||||
exampleAppleScriptProcess(struct subRecord *psub)
|
|
||||||
{
|
|
||||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
|
||||||
NSDictionary *err;
|
|
||||||
NSAppleScript *nsa;
|
|
||||||
|
|
||||||
nsa = [[NSAppleScript alloc] initWithSource:[NSString stringWithFormat:
|
|
||||||
@"tell application \"Finder\" to set volume %g\n", psub->a]];
|
|
||||||
if ([nsa executeAndReturnError:&err] == nil) {
|
|
||||||
errlogPrintf("Failed to run AppleScript: %s\n",
|
|
||||||
[[err objectForKey:NSAppleScriptErrorMessage] cString]);
|
|
||||||
recGblSetSevr(psub, SOFT_ALARM, INVALID_ALARM);
|
|
||||||
}
|
|
||||||
[nsa release];
|
|
||||||
[pool release];
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static registryFunctionRef subRef[] = {
|
|
||||||
{"exampleAppleScriptProcess",(REGISTRYFUNCTION)exampleAppleScriptProcess}
|
|
||||||
};
|
|
||||||
|
|
||||||
static void registerExampleAppleScript(void)
|
|
||||||
{
|
|
||||||
registryFunctionRefAdd(subRef,NELEMENTS(subRef));
|
|
||||||
}
|
|
||||||
epicsExportRegistrar(registerExampleAppleScript);
|
|
||||||
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
/*
|
|
||||||
* runAppleScript.m
|
|
||||||
*
|
|
||||||
* Simple Objective-C/AppleScript shim to allow EPICS application to
|
|
||||||
* send arbitrary AppleScript messages to other applications.
|
|
||||||
*
|
|
||||||
* To use this subroutine in an application make the following
|
|
||||||
* changes to the application Makefile:
|
|
||||||
* - Add runAppleScript.m to the application SRCS.
|
|
||||||
* - Add -framework Foundation to the application LDFLAGS.
|
|
||||||
*/
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
#include <errlog.h>
|
|
||||||
|
|
||||||
int
|
|
||||||
runAppleScript(const char *format, ...)
|
|
||||||
{
|
|
||||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
|
||||||
NSString *script;
|
|
||||||
NSMutableDictionary *err;
|
|
||||||
NSAppleScript *nsa;
|
|
||||||
va_list args;
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
va_start(args, format);
|
|
||||||
script = [[NSString alloc] initWithFormat:
|
|
||||||
[NSString stringWithCString:format] arguments:args];
|
|
||||||
va_end(args);
|
|
||||||
err = [NSMutableDictionary dictionaryWithCapacity:10];
|
|
||||||
nsa = [[NSAppleScript alloc] initWithSource:script];
|
|
||||||
if ([nsa executeAndReturnError:&err] == nil) {
|
|
||||||
errlogPrintf("Failed to run AppleScript: %s\n",
|
|
||||||
[[err objectForKey:NSAppleScriptErrorMessage] cString]);
|
|
||||||
ret = -1;
|
|
||||||
}
|
|
||||||
[script release];
|
|
||||||
[nsa release];
|
|
||||||
[pool release];
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
</pre>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,28 +1,28 @@
|
|||||||
# Installation Instructions
|
# Installation Instructions
|
||||||
|
|
||||||
## EPICS Base Release 3.15.8
|
## EPICS Base Release 3.15.x
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
### Table of Contents
|
### Table of Contents
|
||||||
|
|
||||||
- [What is EPICS base?](#0_0_1)
|
- [What is EPICS base?](#what-is-epics-base?)
|
||||||
- [What is new in this release?](#0_0_2)
|
- [What is new in this release?](#what-is-new-in-this-release?)
|
||||||
- [Copyright](#0_0_3)
|
- [Copyright](#copyright)
|
||||||
- [Supported platforms](#0_0_4)
|
- [Supported platforms](#supported-platforms)
|
||||||
- [Supported compilers](#0_0_5)
|
- [Supported compilers](#supported-compilers)
|
||||||
- [Software requirements](#0_0_6)
|
- [Software requirements](#software-requirements)
|
||||||
- [Host system storage requirements](#0_0_7)
|
- [Host system storage requirements](#host-system-storage-requirements)
|
||||||
- [Documentation](#0_0_8)
|
- [Documentation](#documentation)
|
||||||
- [Directory Structure](#0_0_10)
|
- [Directory Structure](#directory-structure)
|
||||||
- [Build related components](#0_0_11)
|
- [Site-specific build configuration](#site-specific-build-configuration)
|
||||||
- [Building EPICS base (Unix and Win32)](#0_0_12)
|
- [Building EPICS base](#building-epics-base)
|
||||||
- [Example application and extension](#0_0_13)
|
- [Example application and extension](#example-application-and-extension)
|
||||||
- [Multiple host platforms](#0_0_14)
|
- [Multiple host platforms](#multiple-host-platforms)
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
### <span id="0_0_1">What is EPICS base?</span>
|
### What is EPICS base?
|
||||||
|
|
||||||
The Experimental Physics and Industrial Control Systems (EPICS) is an
|
The Experimental Physics and Industrial Control Systems (EPICS) is an
|
||||||
extensible set of software components and tools with which application
|
extensible set of software components and tools with which application
|
||||||
@@ -34,17 +34,17 @@ function. EPICS base allows an arbitrary number of target systems,
|
|||||||
IOCs (input/output controllers), and host systems, OPIs (operator
|
IOCs (input/output controllers), and host systems, OPIs (operator
|
||||||
interfaces) of various types.
|
interfaces) of various types.
|
||||||
|
|
||||||
### <span id="0_0_2">What is new in this release?</span>
|
### What is new in this release?
|
||||||
|
|
||||||
Please check the `RELEASE_NOTES` file in the distribution for
|
Please check the `documentation/RELEASE_NOTES.md` file for
|
||||||
description of changes and release migration details.
|
description of changes and release migration details.
|
||||||
|
|
||||||
### <span id="0_0_3">Copyright</span>
|
### Copyright
|
||||||
|
|
||||||
Please review the LICENSE file included in the distribution for legal
|
Please review the `LICENSE` file included in the distribution for
|
||||||
terms of usage.
|
legal terms of usage.
|
||||||
|
|
||||||
### <span id="0_0_4">Supported platforms</span>
|
### Supported platforms
|
||||||
|
|
||||||
The list of platforms supported by this version of EPICS base is given
|
The list of platforms supported by this version of EPICS base is given
|
||||||
in the `configure/CONFIG_SITE` file. If you are trying to build EPICS
|
in the `configure/CONFIG_SITE` file. If you are trying to build EPICS
|
||||||
@@ -55,7 +55,7 @@ base/configure/os/directory. You can start by copying existing
|
|||||||
configuration files in the configure/os directory and then make
|
configuration files in the configure/os directory and then make
|
||||||
changes for your new platforms.
|
changes for your new platforms.
|
||||||
|
|
||||||
### <span id="0_0_5">Supported compilers</span>
|
### Supported compilers
|
||||||
|
|
||||||
This version of EPICS base has been built and tested using the host
|
This version of EPICS base has been built and tested using the host
|
||||||
vendor's C and C++ compilers, as well as the GNU gcc and g++
|
vendor's C and C++ compilers, as well as the GNU gcc and g++
|
||||||
@@ -64,27 +64,32 @@ targets. You may need the C and C++ compilers to be in your search
|
|||||||
path to do EPICS builds; check the definitions of CC and CCC in
|
path to do EPICS builds; check the definitions of CC and CCC in
|
||||||
`base/configure/os/CONFIG.<host>.<host>` if you have problems.
|
`base/configure/os/CONFIG.<host>.<host>` if you have problems.
|
||||||
|
|
||||||
### <span id="0_0_6">Software requirements</span>
|
### Software requirements
|
||||||
|
|
||||||
**GNU make**
|
#### GNU make
|
||||||
You must use GNU make, gnumake, for any EPICS builds. Set your path so
|
|
||||||
that a gnumake version 3.81 or later is available.
|
You must use the GNU version of `make` for EPICS builds. Set your path
|
||||||
|
so that version 3.81 or later is available (4.0 or later on Windows).
|
||||||
|
|
||||||
|
#### Perl
|
||||||
|
|
||||||
**Perl**
|
|
||||||
You must have Perl version 5.8.1 or later installed. The EPICS
|
You must have Perl version 5.8.1 or later installed. The EPICS
|
||||||
configuration files do not specify the perl full pathname, so the perl
|
configuration files do not specify the perl full pathname, so the perl
|
||||||
executable must be found through your normal search path.
|
executable must be found through your normal search path.
|
||||||
|
|
||||||
**Unzip and tar (Winzip on WIN32 systems)**
|
#### Unzip and tar (Winzip on WIN32 systems)
|
||||||
|
|
||||||
You must have tools available to unzip and untar the EPICS base
|
You must have tools available to unzip and untar the EPICS base
|
||||||
distribution file.
|
distribution file.
|
||||||
|
|
||||||
**Target systems**
|
#### Target systems
|
||||||
|
|
||||||
EPICS supports IOCs running on embedded platforms such as VxWorks and
|
EPICS supports IOCs running on embedded platforms such as VxWorks and
|
||||||
RTEMS built using a cross-compiler, and also supports soft IOCs
|
RTEMS built using a cross-compiler, and also supports soft IOCs
|
||||||
running as processes on the host platform.
|
running as processes on the host platform.
|
||||||
|
|
||||||
**vxWorks**
|
#### vxWorks
|
||||||
|
|
||||||
You must have vxWorks 5.5.x or 6.x installed if any of your target
|
You must have vxWorks 5.5.x or 6.x installed if any of your target
|
||||||
systems are vxWorks systems; the C++ compiler for vxWorks 5.4 is now
|
systems are vxWorks systems; the C++ compiler for vxWorks 5.4 is now
|
||||||
too old to support. The vxWorks installation provides the
|
too old to support. The vxWorks installation provides the
|
||||||
@@ -98,134 +103,148 @@ Consult the [vxWorks 5.x](https://epics.anl.gov/base/tornado.php) or
|
|||||||
about and the vxWorks documentation for information about configuring
|
about and the vxWorks documentation for information about configuring
|
||||||
your vxWorks operating system for use with EPICS.
|
your vxWorks operating system for use with EPICS.
|
||||||
|
|
||||||
**RTEMS**
|
#### RTEMS
|
||||||
|
|
||||||
For RTEMS targets, you need RTEMS core and toolset version 4.9.2 or
|
For RTEMS targets, you need RTEMS core and toolset version 4.9.2 or
|
||||||
later.
|
4.10.x. RTEMS 5 and above are only supported in EPICS 7.0.6 or later.
|
||||||
|
|
||||||
**GNU readline or Tecla library**
|
#### Command Line Editing
|
||||||
GNU readline and Tecla libraries can be used by the IOC shell to
|
|
||||||
provide command line editing and command line history recall and edit.
|
|
||||||
GNU readline (or Tecla library) must be installed on your target
|
|
||||||
system when `COMMANDLINE_LIBRARY` is set to READLINE (or TECLA) for
|
|
||||||
that target. EPICS (EPICS shell) is the default specified in
|
|
||||||
`CONFIG_COMMON`. A READLINE override is defined for linux-x86 in the
|
|
||||||
EPICS distribution. Comment out `COMMANDLINE_LIBRARY=READLINE` in
|
|
||||||
`configure/os/CONFIG_SITE.Common.linux-x86` if readline is not
|
|
||||||
installed on linux-x86. Command-line editing and history will then be
|
|
||||||
those supplied by the os. On vxWorks the ledLib command-line input
|
|
||||||
library is used instead.
|
|
||||||
|
|
||||||
### <span id="0_0_7">Host system storage requirements</span>
|
|
||||||
|
|
||||||
The compressed tar file is approximately 1.6 MB in size. The
|
GNU readline and other similar libraries can be used by the IOC shell
|
||||||
|
to provide command line editing and command line history recall. The
|
||||||
|
GNU readline development package (or Apple's emulator on macOS) must
|
||||||
|
be installed for a target when its build configuration variable
|
||||||
|
`COMMANDLINE_LIBRARY` is set to `READLINE`. The default specified in
|
||||||
|
`CONFIG_COMMON` is `EPICS`, but most linux target builds can detect if
|
||||||
|
readline is available and will then use it. RTEMS targets may be
|
||||||
|
configured to use `LIBTECLA` if available, and on vxWorks the OS's
|
||||||
|
ledLib line-editing library is normally used.
|
||||||
|
|
||||||
|
### Host system storage requirements
|
||||||
|
|
||||||
|
The compressed tar file is approximately 1.7 MB in size. The
|
||||||
distribution source tree takes up approximately 12 MB. Each host
|
distribution source tree takes up approximately 12 MB. Each host
|
||||||
target will need around 40 MB for build files, and each cross-compiled
|
target will need around 50 MB for build files, and each cross-compiled
|
||||||
target around 20 MB.
|
target around 30 MB.
|
||||||
|
|
||||||
### <span id="0_0_8">Documentation</span>
|
### Documentation
|
||||||
|
|
||||||
EPICS documentation is available through the [EPICS
|
EPICS documentation is available through the [EPICS
|
||||||
website](https://epics.anl.gov/) at Argonne.
|
website](https://epics.anl.gov/) at Argonne.
|
||||||
|
|
||||||
Release specific documentation can also be found in the
|
Release specific documentation can also be found in the
|
||||||
base/documentation directory of the distribution.
|
`base/documentation` directory of the distribution.
|
||||||
|
|
||||||
### <span id="0_0_10">Directory Structure</span>
|
### Directory Structure
|
||||||
|
|
||||||
#### Distribution directory structure:
|
#### Distribution directory structure
|
||||||
|
|
||||||
```
|
```
|
||||||
base Root directory of the base distribution
|
base Root directory of the distribution
|
||||||
base/configure Operating system independent build config files
|
base/configure Build rules and OS-independent config files
|
||||||
base/configure/os Operating system dependent build config files
|
base/configure/os OS-dependent build config files
|
||||||
base/documentation Distribution documentation
|
base/documentation Distribution documentation
|
||||||
base/src Source code in various subdirectories
|
base/src Source code in various subdirectories
|
||||||
base/startup Scripts for setting up path and environment
|
base/startup Scripts for setting up path and environment
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Install directories created by the build:
|
#### Directories created by the build
|
||||||
|
|
||||||
|
These are created in the root directory of the installation (`base`
|
||||||
|
above) or under the directory pointed to by the `INSTALL_LOCATION`
|
||||||
|
configuration variable if that has been set.
|
||||||
|
|
||||||
```
|
```
|
||||||
bin Installed scripts and executables in subdirs
|
bin Installed scripts and executables in subdirs
|
||||||
cfg Installed build configuration files
|
cfg Installed build configuration files
|
||||||
db Installed data bases
|
db Installed database files
|
||||||
dbd Installed data base definitions
|
dbd Installed database definition files
|
||||||
doc Installed documentation files
|
html Installed html documentation
|
||||||
html Installed html documentation
|
include Installed header files
|
||||||
include Installed header files
|
include/os Installed OS-specific header files in subdirs
|
||||||
include/os Installed os specific header files in subdirs
|
include/compiler Installed compiler-specific header files
|
||||||
include/compiler Installed compiler-specific header files
|
lib Installed libraries in arch subdirectories
|
||||||
lib Installed libraries in arch subdirectories
|
lib/perl Installed perl modules
|
||||||
lib/perl Installed perl modules
|
templates Installed templates
|
||||||
templates Installed templates
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### <span id="0_0_11">Build related components</span>
|
#### `base/documentation` Directory
|
||||||
|
|
||||||
#### base/documentation directory - contains setup, build, and install documents
|
This contains documents on how to setup, build, and install EPICS.
|
||||||
|
|
||||||
```
|
```
|
||||||
README.md Instructions for setup and building epics base
|
README.md This file
|
||||||
README.darwin.html Installation notes for Mac OS X (Darwin)
|
RELEASE_NOTES.md Notes on release changes
|
||||||
RELEASE_NOTES.html Notes on release changes
|
KnownProblems.html List of known problems and workarounds
|
||||||
KnownProblems.html List of known problems and workarounds
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### base/startup directory - contains scripts to set environment and path
|
#### `base/startup` Directory
|
||||||
|
|
||||||
|
This contains several example scripts that show how to set up the
|
||||||
|
build environment and PATH for using EPICS. Sites would usually copy and/or modify these files as appropriate for their environment; they are not used by the build system at all.
|
||||||
|
|
||||||
```
|
```
|
||||||
EpicsHostArch Shell script to set EPICS_HOST_ARCH env variable
|
EpicsHostArch Shell script to set EPICS_HOST_ARCH env variable
|
||||||
unix.csh C shell script to set path and env variables
|
unix.csh C shell script to set path and env variables
|
||||||
unix.sh Bourne shell script to set path and env variables
|
unix.sh Bourne shell script to set path and env variables
|
||||||
win32.bat Bat file example to configure win32-x86 target
|
win32.bat Bat file example to configure win32-x86 target
|
||||||
windows.bat Bat file example to configure windows-x64 target
|
windows.bat Bat file example to configure windows-x64 target
|
||||||
```
|
```
|
||||||
|
|
||||||
#### base/configure directory - contains build definitions and rules
|
#### `base/configure` directory
|
||||||
|
|
||||||
|
This contains build-system files providing definitions and rules
|
||||||
|
required by GNU Make to build EPICS. Users should only need to modify the `CONFIG_SITE` files to configure the EPICS build.
|
||||||
|
|
||||||
```
|
```
|
||||||
CONFIG Includes configure files and allows variable overrides
|
CONFIG Main entry point for building EPICS
|
||||||
CONFIG.CrossCommon Cross build definitions
|
CONFIG.CrossCommon Cross build definitions
|
||||||
CONFIG.gnuCommon Gnu compiler build definitions for all archs
|
CONFIG.gnuCommon Gnu compiler build definitions for all archs
|
||||||
CONFIG_ADDONS Definitions for <osclass> and DEFAULT options
|
CONFIG_ADDONS Definitions for <osclass> and DEFAULT options
|
||||||
CONFIG_APP_INCLUDE
|
CONFIG_APP_INCLUDE
|
||||||
CONFIG_BASE EPICS base tool and location definitions
|
CONFIG_BASE EPICS base tool and location definitions
|
||||||
CONFIG_BASE_VERSION Definitions for EPICS base version number
|
CONFIG_BASE_VERSION Definitions for EPICS base version number
|
||||||
CONFIG_COMMON Definitions common to all builds
|
CONFIG_COMMON Definitions common to all builds
|
||||||
CONFIG_ENV Definitions of EPICS environment variables
|
CONFIG_ENV Definitions of EPICS environment variables
|
||||||
CONFIG_FILE_TYPE
|
CONFIG_FILE_TYPE
|
||||||
CONFIG_SITE Site specific make definitions
|
CONFIG_SITE Site specific make definitions
|
||||||
CONFIG_SITE_ENV Site defaults for EPICS environment variables
|
CONFIG_SITE_ENV Site defaults for EPICS environment variables
|
||||||
MAKEFILE Installs CONFIG* RULES* creates
|
MAKEFILE Installs CONFIG* RULES* creates
|
||||||
RELEASE Location of external products
|
RELEASE Location of external products
|
||||||
RULES Includes appropriate rules file
|
RULES Includes appropriate rules file
|
||||||
RULES.Db Rules for database and database definition files
|
RULES.Db Rules for database and database definition files
|
||||||
RULES.ioc Rules for application iocBoot/ioc* directory
|
RULES.ioc Rules for application iocBoot/ioc* directory
|
||||||
RULES_ARCHS Definitions and rules for building architectures
|
RULES_ARCHS Definitions and rules for building architectures
|
||||||
RULES_BUILD Build and install rules and definitions
|
RULES_BUILD Build and install rules and definitions
|
||||||
RULES_DIRS Definitions and rules for building subdirectories
|
RULES_DIRS Definitions and rules for building subdirectories
|
||||||
RULES_EXPAND
|
RULES_EXPAND
|
||||||
RULES_FILE_TYPE
|
RULES_FILE_TYPE
|
||||||
RULES_TARGET
|
RULES_TARGET
|
||||||
RULES_TOP Rules specific to a <top> dir (uninstall and tar)
|
RULES_TOP Rules specific to a <top> dir only
|
||||||
Sample.Makefile Sample makefile with comments
|
Sample.Makefile Sample makefile with comments
|
||||||
```
|
```
|
||||||
|
|
||||||
#### base/configure/os directory - contains os-arch specific definitions
|
#### `base/configure/os` Directory
|
||||||
|
|
||||||
|
Files in here provide definitions that are shared by or specific to particular host and/or target architectures. Users should only need to modify the `CONFIG_SITE` files in this directory to configure the EPICS build.
|
||||||
|
|
||||||
```
|
```
|
||||||
CONFIG.<host>.<target> Specific host-target build definitions
|
CONFIG.<host>.<target> Definitions for a specific host-target combination
|
||||||
CONFIG.Common.<target> Specific target definitions for all hosts
|
CONFIG.Common.<target> Definitions for a specific target, any host
|
||||||
CONFIG.<host>.Common Specific host definitions for all targets
|
CONFIG.<host>.Common Definitions for a specific host, any target
|
||||||
CONFIG.UnixCommon.Common Definitions for Unix hosts and all targets
|
CONFIG.UnixCommon.Common Definitions for Unix hosts, any target
|
||||||
CONFIG.Common.UnixCommon Definitions for Unix targets and all hosts
|
CONFIG.Common.UnixCommon Definitions for Unix targets, any host
|
||||||
CONFIG.Common.vxWorksCommon Specific host definitions for all vx targets
|
CONFIG.Common.RTEMS Definitions for all RTEMS targets, any host
|
||||||
CONFIG_SITE.<host>.<target> Site specific host-target definitions
|
CONFIG.Common.vxWorksCommon Definitions for all vxWorks targets, any host
|
||||||
CONFIG_SITE.Common.<target> Site specific target defs for all hosts
|
CONFIG_SITE.<host>.<target> Local settings for a specific host-target combination
|
||||||
CONFIG_SITE.<host>.Common Site specific host defs for all targets
|
CONFIG_SITE.Common.<target> Local settings for a specific target, any host
|
||||||
|
CONFIG_SITE.<host>.Common Local settings for a specific host, any target
|
||||||
|
CONFIG_SITE.Common.RTEMS Local settings for all RTEMS targets, any host
|
||||||
|
CONFIG_SITE.Common.vxWorksCommon Local settings for all vxWorks targets, any host
|
||||||
```
|
```
|
||||||
|
|
||||||
### <span id="0_0_12">Building EPICS base (Unix and Win32)</span>
|
### Building EPICS base
|
||||||
|
|
||||||
#### Unpack file
|
#### Unpack file
|
||||||
|
|
||||||
@@ -237,7 +256,7 @@ systems.
|
|||||||
Files in the base/startup directory have been provided to help set
|
Files in the base/startup directory have been provided to help set
|
||||||
required path and other environment variables.
|
required path and other environment variables.
|
||||||
|
|
||||||
* `EPICS_HOST_ARCH`
|
* **`EPICS_HOST_ARCH`**
|
||||||
Before you can build or use EPICS R3.15, the environment variable
|
Before you can build or use EPICS R3.15, the environment variable
|
||||||
`EPICS_HOST_ARCH` must be defined. A perl script EpicsHostArch.pl in
|
`EPICS_HOST_ARCH` must be defined. A perl script EpicsHostArch.pl in
|
||||||
the base/startup directory has been provided to help set
|
the base/startup directory has been provided to help set
|
||||||
@@ -250,65 +269,66 @@ compilers on a solaris host or "-mingw" for MinGW c/c++ compilers on
|
|||||||
a WIN32 host). See `configure/CONFIG_SITE` for a list of supported
|
a WIN32 host). See `configure/CONFIG_SITE` for a list of supported
|
||||||
`EPICS_HOST_ARCH` values.
|
`EPICS_HOST_ARCH` values.
|
||||||
|
|
||||||
* `PERLLIB`
|
* **`PATH`**
|
||||||
On WIN32, some versions of Perl require that the environment
|
As already mentioned, you must have the `perl` executable and you may
|
||||||
variable PERLLIB be set to <perl directory location>.
|
need C and C++ compilers in your search path. When building base you
|
||||||
|
must have `echo` in your search path. For Unix host builds you will
|
||||||
|
also need `cp`, `rm`, `mv`, and `mkdir` in your search path. Some Unix
|
||||||
|
systems may also need `ar` and `ranlib`, and the C/C++ compilers may
|
||||||
|
require `as` and `ld` in your path. On Solaris systems you need
|
||||||
|
`uname` in your path.
|
||||||
|
|
||||||
* `PATH`
|
* **`LD_LIBRARY_PATH`**
|
||||||
As already mentioned, you must have the perl executable and you may
|
R3.15 shared libraries and executables normally contain the full path
|
||||||
need C and C++ compilers in your search path. For building base you
|
to any libraries they require, so setting this variable is not usually
|
||||||
also must have echo in your search path. For Unix host builds you
|
necessary. However, if you move the EPICS installation to a new
|
||||||
also need ln, cpp, cp, rm, mv, and mkdir in your search path and
|
location after building it then in order for the shared libraries to
|
||||||
/bin/chmod must exist. On some Unix systems you may also need ar and
|
be found at runtime it may need to be set, or some equivalent
|
||||||
ranlib in your path, and the C compiler may require as and ld in
|
OS-specific mechanism such as `/etc/ld.so.conf` on Linux must be used.
|
||||||
your path. On solaris systems you need uname in your path.
|
Shared libraries are now built by default on all Unix type hosts.
|
||||||
|
|
||||||
* `LD_LIBRARY_PATH`
|
### Site-specific build configuration
|
||||||
R3.15 shared libraries and executables normally contain the full
|
|
||||||
path to any libraries they require. However, if you move the EPICS
|
|
||||||
files or directories from their build-time location then in order
|
|
||||||
for the shared libraries to be found at runtime `LD_LIBRARY_PATH`
|
|
||||||
must include the full pathname to
|
|
||||||
`$(INSTALL_LOCATION)/lib/$(EPICS_HOST_ARCH)` when invoking
|
|
||||||
executables, or some equivalent OS-specific mechanism (such as
|
|
||||||
/etc/ld.so.conf on Linux) must be used. Shared libraries are now
|
|
||||||
built by default on all Unix type hosts.
|
|
||||||
|
|
||||||
#### Do site-specific build configuration
|
#### Site configuration
|
||||||
|
|
||||||
**Site configuration**
|
To configure EPICS, you may want to modify some values set in the
|
||||||
To configure EPICS, you may want to modify the default definitions
|
following files:
|
||||||
in the following files:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
configure/CONFIG_SITE Build choices. Specify target archs.
|
configure/CONFIG_SITE Build settings. Specify target archs.
|
||||||
configure/CONFIG_SITE_ENV Environment variable defaults
|
configure/CONFIG_SITE_ENV Environment variable defaults
|
||||||
configure/RELEASE TORNADO2 full path location
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Host configuration**
|
#### Host configuration
|
||||||
To configure each host system, you may override the default
|
|
||||||
definitions by adding a new file in the configure/os directory with
|
To configure each host system, you can override the default
|
||||||
override definitions. The new file should have the same name as the
|
definitions by adding a new settings file (or editing an existing
|
||||||
distribution file to be overridden except with CONFIG in the name
|
settings file) in the `configure/os` directory with your override
|
||||||
changed to `CONFIG_SITE`.
|
definitions. The settings file has the same name as the definitions
|
||||||
|
file to be overridden except with `CONFIG` in the name changed to
|
||||||
|
`CONFIG_SITE`.
|
||||||
|
|
||||||
```
|
```
|
||||||
configure/os/CONFIG.<host>.<host> Host build settings
|
configure/os/CONFIG.<host>.<host> Host self-build definitions
|
||||||
configure/os/CONFIG.<host>.Common Host common build settings
|
configure/os/CONFIG.<host>.Common Host common build definitions
|
||||||
|
configure/os/CONFIG_SITE.<host>.<host> Host self-build overrides
|
||||||
|
configure/os/CONFIG_SITE.<host>.Common Host common build overrides
|
||||||
```
|
```
|
||||||
|
|
||||||
**Target configuration**
|
#### Target configuration
|
||||||
|
|
||||||
To configure each target system, you may override the default
|
To configure each target system, you may override the default
|
||||||
definitions by adding a new file in the configure/os directory with
|
definitions by adding a new settings file (or editing an existing
|
||||||
override definitions. The new file should have the same name as the
|
settings file) in the `configure/os` directory with your override
|
||||||
distribution file to be overridden except with CONFIG in the name
|
definitions. The settings file has the same name as the definitions
|
||||||
replaced by `CONFIG_SITE`. This step is necessary even if the host
|
file to be overridden except with `CONFIG` in the name changed to
|
||||||
system is the only target system.
|
`CONFIG_SITE`.
|
||||||
|
|
||||||
```
|
```
|
||||||
configure/os/CONFIG.Common.<target> Target common settings
|
configure/os/CONFIG.Common.<target> Target common definitions
|
||||||
configure/os/CONFIG.<host>.<target> Host-target settings
|
configure/os/CONFIG.<host>.<target> Host-target definitions
|
||||||
|
configure/os/CONFIG_SITE.Common.<target> Target common overrides
|
||||||
|
configure/os/CONFIG_SITE.<host>.<target> Host-target overrides
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Build EPICS base
|
#### Build EPICS base
|
||||||
@@ -318,24 +338,29 @@ by issuing the following commands in the distribution's root
|
|||||||
directory (base):
|
directory (base):
|
||||||
|
|
||||||
```
|
```
|
||||||
gnumake clean uninstall
|
make distclean
|
||||||
gnumake
|
make
|
||||||
```
|
```
|
||||||
|
|
||||||
The command "gnumake clean uninstall" will remove all files and
|
The command `make distclean` will remove all files and
|
||||||
directories generated by a previous build. The command "gnumake"
|
directories generated by a previous build. The command `make`
|
||||||
will build and install everything for the configured host and
|
will build and install everything for the configured host and
|
||||||
targets.
|
targets.
|
||||||
|
|
||||||
It is recommended that you do a "gnumake clean uninstall" at the
|
It is recommended that you do a `make distclean` at the
|
||||||
root directory of an EPICS directory structure before each complete
|
root directory of an EPICS directory structure before each complete
|
||||||
rebuild to ensure that all components will be rebuilt.
|
rebuild to ensure that all components will be rebuilt.
|
||||||
|
|
||||||
### <span id="0_0_13">Example application and extension</span>
|
In some cases GNU Make may have been installed as `gmake` or
|
||||||
|
`gnumake`, in which case the above commands will have to be adjusted
|
||||||
|
to match.
|
||||||
|
|
||||||
A perl tool, makeBaseApp.pl is included in the distribution file. This
|
### Example application and extension
|
||||||
script will create a sample application that can be built and then
|
|
||||||
executed to try out this release of base.
|
A perl tool `makeBaseApp.pl` and several template applications are
|
||||||
|
included in the distribution. This script instantiates the selected
|
||||||
|
template into an empty directory to provide an example application
|
||||||
|
that can be built and then executed to try out this release of base.
|
||||||
|
|
||||||
Instructions for building and executing the 3.15 example application
|
Instructions for building and executing the 3.15 example application
|
||||||
can be found in the section "Example Application" of Chapter 2,
|
can be found in the section "Example Application" of Chapter 2,
|
||||||
@@ -348,26 +373,30 @@ application as a host-based IOC, you will be able to quickly implement
|
|||||||
a complete EPICS system and be able to run channel access clients on
|
a complete EPICS system and be able to run channel access clients on
|
||||||
the host system.
|
the host system.
|
||||||
|
|
||||||
A perl script, makeBaseExt.pl, is included in the distribution file.
|
Another perl script `makeBaseExt.pl` is also included in the
|
||||||
This script will create a sample extension that can be built and
|
distribution file for creating an extensions tree and sample
|
||||||
executed. The makeBaseApp.pl and makeBaseExt.pl scripts are installed
|
application that can also be built and executed. Both these scripts
|
||||||
into the install location `bin/<hostarch>` directory during the base
|
are installed into the install location `bin/<hostarch>` directory
|
||||||
build.
|
during the base build.
|
||||||
|
|
||||||
### <span id="0_0_14">Multiple host platforms</span>
|
### Multiple host platforms
|
||||||
|
|
||||||
You can build using a single EPICS directory structure on multiple
|
You can build using a single EPICS directory structure on multiple
|
||||||
host systems and for multiple cross target systems. The intermediate
|
host systems and for multiple cross target systems. The intermediate
|
||||||
and binary files generated by the build will be created in separate
|
and binary files generated by the build will be created in separate
|
||||||
subdirectories and installed into the appropriate separate host/target
|
subdirectories and installed into the appropriate separate host/target
|
||||||
install directories. EPICS executables and perl scripts are installed
|
install directories.
|
||||||
into the `$(INSTALL_LOCATION)/bin/<arch>` directories. Libraries are
|
|
||||||
installed into $`(INSTALL_LOCATION)/lib/<arch>`. The default
|
EPICS executables and perl scripts are installed into the
|
||||||
definition for `$(INSTALL_LOCATION)` is `$(TOP)` which is the root
|
`$(INSTALL_LOCATION)/bin/<arch>` directories. Libraries are installed
|
||||||
directory in the distribution directory structure, base. Created
|
into $`(INSTALL_LOCATION)/lib/<arch>`. The default definition for
|
||||||
object files are stored in `O.<arch>` source subdirectories, This
|
`$(INSTALL_LOCATION)` is `$(TOP)` which is the root directory in the
|
||||||
allows objects for multiple cross target architectures to be
|
distribution directory structure, `base`. Intermediate object files
|
||||||
maintained at the same time. To build EPICS base for a specific
|
are stored in `O.<arch>` source subdirectories during the build
|
||||||
|
process, to allow objects for multiple cross target architectures
|
||||||
|
to be maintained at the same time.
|
||||||
|
|
||||||
|
To build EPICS base for a specific
|
||||||
host/target combination you must have the proper host/target C/C++
|
host/target combination you must have the proper host/target C/C++
|
||||||
cross compiler and target header files and the base/configure/os
|
cross compiler and target header files and the base/configure/os
|
||||||
directory must have the appropriate configure files.
|
directory must have the appropriate configure files.
|
||||||
|
|||||||
@@ -2,16 +2,66 @@
|
|||||||
|
|
||||||
This version of EPICS Base has not been released yet.
|
This version of EPICS Base has not been released yet.
|
||||||
|
|
||||||
## Changes made on the 3.15 branch since 3.15.8
|
## Changes made on the 3.15 branch since 3.15.9
|
||||||
|
|
||||||
<!-- Insert new items immediately below here ... -->
|
<!-- Insert new items immediately below here ... -->
|
||||||
|
|
||||||
|
### Support for Apple M1/M2 (arm64) Processors
|
||||||
|
|
||||||
|
Thanks to Jeong Han Lee this release comes with build support for Apple's new
|
||||||
|
M1 CPUs running macOS, using the target name `darwin-aarch64`.
|
||||||
|
|
||||||
|
### Set thread names on Windows
|
||||||
|
|
||||||
|
On MS Windows, epicsThread names are made available to the OS and debugger
|
||||||
|
using `SetThreadDescription()` if available as well as using the older
|
||||||
|
exception mechanism.
|
||||||
|
|
||||||
|
### Fix timers on MS Windows for non-EPICS threads
|
||||||
|
|
||||||
|
The waitable timer changes in 3.15.9 broke calls to `epicsThreadSleep()` and
|
||||||
|
similar routines that used timers (including `ca_pend_event()`) when made from
|
||||||
|
threads that were not started using the epicsThread APIs.
|
||||||
|
[This problem](https://github.com/epics-base/epics-base/pull/200)
|
||||||
|
[has now been fixed](https://github.com/epics-base/epics-base/pull/201).
|
||||||
|
|
||||||
|
## Changes made between 3.15.8 and 3.15.9
|
||||||
|
|
||||||
|
### Use waitable timers on Microsoft Windows
|
||||||
|
|
||||||
|
The `epicsEventWaitWithTimeout()` and `epicsThreadSleep()` functions have
|
||||||
|
been changed to use waitable timers. On Windows 10 version 1803 or higher
|
||||||
|
they will use high resolution timers for more consistent timing.
|
||||||
|
|
||||||
|
See [this Google Groups thread](https://groups.google.com/a/chromium.org/g/scheduler-dev/c/0GlSPYreJeY)
|
||||||
|
for a comparison of the performance of different timers.
|
||||||
|
|
||||||
|
### Build target for documentation
|
||||||
|
|
||||||
|
The build target `inc` now works again after a very long hiatus. It now
|
||||||
|
generates and installs just the dbd, header and html files, without compiling
|
||||||
|
any C/C++ code. This can be used to speed up CI jobs that only generate
|
||||||
|
documentation.
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
- The error status returned by a record support's `special()` method is now propagated out of the `dbPut()` routine again (broken since 3.15.0).
|
||||||
|
- [gh: #80](https://github.com/epics-base/epics-base/issues/80), VS-2015 and
|
||||||
|
later have working strtod()
|
||||||
|
- [lp: #1776141](https://bugs.launchpad.net/epics-base/+bug/1776141), Catch
|
||||||
|
buffer overflow from long link strings
|
||||||
|
- [lp: #1899697](https://bugs.launchpad.net/epics-base/+bug/1899697), Records
|
||||||
|
in wrong PHAS order
|
||||||
|
|
||||||
### Change to the `junitfiles` self-test build target
|
### Change to the `junitfiles` self-test build target
|
||||||
|
|
||||||
The names of the generated junit xml test output files have been changed
|
The names of the generated junit xml test output files have been changed
|
||||||
from `<testname>.xml` to `<testname>-results.xml`, to allow better
|
from `<testname>.xml` to `<testname>-results.xml`, to allow better
|
||||||
distinction from other xml files. (I.e., for easy wildcard matching.)
|
distinction from other xml files. (I.e., for easy wildcard matching.)
|
||||||
|
|
||||||
|
### Fixes and code cleanups
|
||||||
|
|
||||||
|
Issues reported by various static code checkers.
|
||||||
|
|
||||||
## Changes made between 3.15.7 and 3.15.8
|
## Changes made between 3.15.7 and 3.15.8
|
||||||
|
|
||||||
|
|||||||
@@ -50,14 +50,16 @@ bool getStringAsDouble ( const char * pString,
|
|||||||
ftmp = itmp;
|
ftmp = itmp;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int j = epicsScanDouble( pString, &ftmp );
|
int j = epicsScanDouble ( pString, &ftmp );
|
||||||
if ( j != 1 ) {
|
if ( j != 1 ) {
|
||||||
j = sscanf ( pString,"%x", &itmp );
|
j = sscanf ( pString, "%lf", &ftmp );
|
||||||
if ( j == 1 ) {
|
if ( j != 1 ) {
|
||||||
ftmp = itmp;
|
j = sscanf ( pString, "%x", &itmp );
|
||||||
}
|
if ( j == 1 ) {
|
||||||
else {
|
ftmp = itmp;
|
||||||
return false;
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,10 @@ BPT_DBD += bptTypeJdegC.dbd
|
|||||||
BPT_DBD += bptTypeJdegF.dbd
|
BPT_DBD += bptTypeJdegF.dbd
|
||||||
BPT_DBD += bptTypeKdegC.dbd
|
BPT_DBD += bptTypeKdegC.dbd
|
||||||
BPT_DBD += bptTypeKdegF.dbd
|
BPT_DBD += bptTypeKdegF.dbd
|
||||||
|
|
||||||
|
ifneq (inc,$(strip $(MAKECMDGOALS)))
|
||||||
DBD += $(BPT_DBD)
|
DBD += $(BPT_DBD)
|
||||||
|
endif
|
||||||
|
|
||||||
PROD_HOST += makeBpt
|
PROD_HOST += makeBpt
|
||||||
|
|
||||||
|
|||||||
@@ -1290,7 +1290,8 @@ long dbPut(DBADDR *paddr, short dbrType,
|
|||||||
/* Always do special processing if needed */
|
/* Always do special processing if needed */
|
||||||
if (special) {
|
if (special) {
|
||||||
long status2 = dbPutSpecial(paddr, 1);
|
long status2 = dbPutSpecial(paddr, 1);
|
||||||
if (status2) goto done;
|
if (status2)
|
||||||
|
status = status2;
|
||||||
}
|
}
|
||||||
if (status) goto done;
|
if (status) goto done;
|
||||||
|
|
||||||
|
|||||||
@@ -300,11 +300,11 @@ static void makeSubstitutions(inputData * const inputPvt,
|
|||||||
char *pstart;
|
char *pstart;
|
||||||
char *pend;
|
char *pend;
|
||||||
int cmdind=-1;
|
int cmdind=-1;
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < NELEMENTS(cmdNames); i++) {
|
for (i = 0; i < NELEMENTS(cmdNames); i++) {
|
||||||
if (strstr(command, cmdNames[i])) {
|
if (strstr(command, cmdNames[i])) {
|
||||||
cmdind = i;
|
cmdind = (int)i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cmdind < 0) goto endcmd;
|
if (cmdind < 0) goto endcmd;
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
#include "shareLib.h"
|
#include "shareLib.h"
|
||||||
#include "epicsEvent.h"
|
#include "epicsEvent.h"
|
||||||
|
|
||||||
|
#include "osdThreadPvt.h"
|
||||||
|
|
||||||
typedef struct epicsEventOSD {
|
typedef struct epicsEventOSD {
|
||||||
HANDLE handle;
|
HANDLE handle;
|
||||||
} epicsEventOSD;
|
} epicsEventOSD;
|
||||||
@@ -90,27 +92,47 @@ epicsShareFunc epicsEventStatus epicsEventWait ( epicsEventId pSem )
|
|||||||
epicsShareFunc epicsEventStatus epicsEventWaitWithTimeout (
|
epicsShareFunc epicsEventStatus epicsEventWaitWithTimeout (
|
||||||
epicsEventId pSem, double timeOut )
|
epicsEventId pSem, double timeOut )
|
||||||
{
|
{
|
||||||
static const unsigned mSecPerSec = 1000;
|
/* waitable timers use 100 nanosecond intervals, like FILETIME */
|
||||||
|
static const unsigned ivalPerSec = 10000000u; /* number of 100ns intervals per second */
|
||||||
|
static const unsigned mSecPerSec = 1000u; /* milliseconds per second */
|
||||||
|
HANDLE handles[2];
|
||||||
DWORD status;
|
DWORD status;
|
||||||
DWORD tmo;
|
LARGE_INTEGER tmo;
|
||||||
|
HANDLE timer;
|
||||||
|
LONGLONG nIvals; /* number of intervals */
|
||||||
|
|
||||||
if ( timeOut <= 0.0 ) {
|
if ( timeOut <= 0.0 ) {
|
||||||
tmo = 0u;
|
tmo.QuadPart = 0u;
|
||||||
}
|
}
|
||||||
else if ( timeOut >= INFINITE / mSecPerSec ) {
|
else if ( timeOut >= INFINITE / mSecPerSec ) {
|
||||||
tmo = INFINITE - 1;
|
/* we need to apply a maximum wait time to stop an overflow. We choose (INFINITE - 1) milliseconds,
|
||||||
|
to be compatible with previous WaitForSingleObject() implementation */
|
||||||
|
nIvals = (LONGLONG)(INFINITE - 1) * (ivalPerSec / mSecPerSec);
|
||||||
|
tmo.QuadPart = -nIvals; /* negative value means a relative time offset for timer */
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
tmo = ( DWORD ) ( ( timeOut * mSecPerSec ) + 0.5 );
|
nIvals = (LONGLONG)(timeOut * ivalPerSec + 0.999999);
|
||||||
if ( tmo == 0 ) {
|
tmo.QuadPart = -nIvals;
|
||||||
tmo = 1;
|
}
|
||||||
}
|
|
||||||
|
if (tmo.QuadPart < 0) {
|
||||||
|
timer = osdThreadGetTimer();
|
||||||
|
if (!SetWaitableTimer(timer, &tmo, 0, NULL, NULL, 0)) {
|
||||||
|
return epicsEventError;
|
||||||
|
}
|
||||||
|
handles[0] = pSem->handle;
|
||||||
|
handles[1] = timer;
|
||||||
|
status = WaitForMultipleObjects (2, handles, FALSE, INFINITE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
status = WaitForSingleObject(pSem->handle, 0);
|
||||||
}
|
}
|
||||||
status = WaitForSingleObject ( pSem->handle, tmo );
|
|
||||||
if ( status == WAIT_OBJECT_0 ) {
|
if ( status == WAIT_OBJECT_0 ) {
|
||||||
return epicsEventOK;
|
return epicsEventOK;
|
||||||
}
|
}
|
||||||
else if ( status == WAIT_TIMEOUT ) {
|
else if ( status == WAIT_OBJECT_0 + 1 || status == WAIT_TIMEOUT ) {
|
||||||
|
/* WaitForMultipleObjects will trigger WAIT_OBJECT_0 + 1,
|
||||||
|
WaitForSingleObject will trigger WAIT_TIMEOUT */
|
||||||
return epicsEventWaitTimeout;
|
return epicsEventWaitTimeout;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -13,10 +13,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* epicsStrtod() for systems with broken strtod() routine
|
|
||||||
*/
|
|
||||||
epicsShareFunc double epicsStrtod(const char *str, char **endp);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Microsoft apparently added strto[u]ll() in VS2013
|
* Microsoft apparently added strto[u]ll() in VS2013
|
||||||
@@ -28,6 +24,19 @@ epicsShareFunc double epicsStrtod(const char *str, char **endp);
|
|||||||
# define strtoull _strtoui64
|
# define strtoull _strtoui64
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* strtod works in MSVC 1900 and mingw, use
|
||||||
|
* the OS version in those and our own otherwise
|
||||||
|
*/
|
||||||
|
#if (_MSC_VER < 1900) && !defined(_MINGW)
|
||||||
|
/*
|
||||||
|
* epicsStrtod() for systems with broken strtod() routine
|
||||||
|
*/
|
||||||
|
epicsShareFunc double epicsStrtod(const char *str, char **endp);
|
||||||
|
#else
|
||||||
|
# define epicsStrtod strtod
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -18,9 +18,6 @@
|
|||||||
|
|
||||||
#define VC_EXTRALEAN
|
#define VC_EXTRALEAN
|
||||||
#define STRICT
|
#define STRICT
|
||||||
#ifndef _WIN32_WINNT
|
|
||||||
# define _WIN32_WINNT 0x400 /* No support for W95 */
|
|
||||||
#endif
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <process.h> /* for _endthread() etc */
|
#include <process.h> /* for _endthread() etc */
|
||||||
|
|
||||||
@@ -33,6 +30,8 @@
|
|||||||
#include "ellLib.h"
|
#include "ellLib.h"
|
||||||
#include "epicsExit.h"
|
#include "epicsExit.h"
|
||||||
|
|
||||||
|
#include "osdThreadPvt.h"
|
||||||
|
|
||||||
epicsShareFunc void osdThreadHooksRun(epicsThreadId id);
|
epicsShareFunc void osdThreadHooksRun(epicsThreadId id);
|
||||||
|
|
||||||
void setThreadName ( DWORD dwThreadID, LPCSTR szThreadName );
|
void setThreadName ( DWORD dwThreadID, LPCSTR szThreadName );
|
||||||
@@ -53,6 +52,7 @@ typedef struct epicsThreadOSD {
|
|||||||
DWORD id;
|
DWORD id;
|
||||||
unsigned epicsPriority;
|
unsigned epicsPriority;
|
||||||
char isSuspended;
|
char isSuspended;
|
||||||
|
HANDLE timer; /* waitable timer */
|
||||||
} win32ThreadParam;
|
} win32ThreadParam;
|
||||||
|
|
||||||
typedef struct epicsThreadPrivateOSD {
|
typedef struct epicsThreadPrivateOSD {
|
||||||
@@ -229,6 +229,19 @@ static win32ThreadGlobal * fetchWin32ThreadGlobal ( void )
|
|||||||
return pWin32ThreadGlobal;
|
return pWin32ThreadGlobal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void epicsParmCleanupDataWIN32 ( win32ThreadParam * pParm )
|
||||||
|
{
|
||||||
|
if ( pParm ) {
|
||||||
|
if ( pParm->handle ) {
|
||||||
|
CloseHandle ( pParm->handle );
|
||||||
|
}
|
||||||
|
if ( pParm->timer ) {
|
||||||
|
CloseHandle ( pParm->timer );
|
||||||
|
}
|
||||||
|
free ( pParm );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void epicsParmCleanupWIN32 ( win32ThreadParam * pParm )
|
static void epicsParmCleanupWIN32 ( win32ThreadParam * pParm )
|
||||||
{
|
{
|
||||||
win32ThreadGlobal * pGbl = fetchWin32ThreadGlobal ();
|
win32ThreadGlobal * pGbl = fetchWin32ThreadGlobal ();
|
||||||
@@ -243,8 +256,8 @@ static void epicsParmCleanupWIN32 ( win32ThreadParam * pParm )
|
|||||||
ellDelete ( & pGbl->threadList, & pParm->node );
|
ellDelete ( & pGbl->threadList, & pParm->node );
|
||||||
LeaveCriticalSection ( & pGbl->mutex );
|
LeaveCriticalSection ( & pGbl->mutex );
|
||||||
|
|
||||||
CloseHandle ( pParm->handle );
|
epicsParmCleanupDataWIN32 ( pParm );
|
||||||
free ( pParm );
|
|
||||||
TlsSetValue ( pGbl->tlsIndexThreadLibraryEPICS, 0 );
|
TlsSetValue ( pGbl->tlsIndexThreadLibraryEPICS, 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -464,21 +477,6 @@ epicsShareFunc unsigned int epicsShareAPI
|
|||||||
return stackSizeTable[stackSizeClass];
|
return stackSizeTable[stackSizeClass];
|
||||||
}
|
}
|
||||||
|
|
||||||
void epicsThreadCleanupWIN32 ()
|
|
||||||
{
|
|
||||||
win32ThreadGlobal * pGbl = fetchWin32ThreadGlobal ();
|
|
||||||
win32ThreadParam * pParm;
|
|
||||||
|
|
||||||
if ( ! pGbl ) {
|
|
||||||
fprintf ( stderr, "epicsThreadCleanupWIN32: unable to find ctx\n" );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
pParm = ( win32ThreadParam * )
|
|
||||||
TlsGetValue ( pGbl->tlsIndexThreadLibraryEPICS );
|
|
||||||
epicsParmCleanupWIN32 ( pParm );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* epicsWin32ThreadEntry()
|
* epicsWin32ThreadEntry()
|
||||||
*/
|
*/
|
||||||
@@ -526,6 +524,16 @@ static win32ThreadParam * epicsThreadParmCreate ( const char *pName )
|
|||||||
pParmWIN32->pName = (char *) ( pParmWIN32 + 1 );
|
pParmWIN32->pName = (char *) ( pParmWIN32 + 1 );
|
||||||
strcpy ( pParmWIN32->pName, pName );
|
strcpy ( pParmWIN32->pName, pName );
|
||||||
pParmWIN32->isSuspended = 0;
|
pParmWIN32->isSuspended = 0;
|
||||||
|
#ifdef CREATE_WAITABLE_TIMER_HIGH_RESOLUTION
|
||||||
|
pParmWIN32->timer = CreateWaitableTimerEx(NULL, NULL, CREATE_WAITABLE_TIMER_HIGH_RESOLUTION, TIMER_ALL_ACCESS);
|
||||||
|
#endif
|
||||||
|
if (pParmWIN32->timer == NULL) {
|
||||||
|
pParmWIN32->timer = CreateWaitableTimer(NULL, 0, NULL);
|
||||||
|
}
|
||||||
|
if (pParmWIN32->timer == NULL) {
|
||||||
|
free(pParmWIN32);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return pParmWIN32;
|
return pParmWIN32;
|
||||||
}
|
}
|
||||||
@@ -608,7 +616,7 @@ epicsShareFunc epicsThreadId epicsShareAPI epicsThreadCreate (const char *pName,
|
|||||||
CREATE_SUSPENDED | STACK_SIZE_PARAM_IS_A_RESERVATION,
|
CREATE_SUSPENDED | STACK_SIZE_PARAM_IS_A_RESERVATION,
|
||||||
& threadId );
|
& threadId );
|
||||||
if ( pParmWIN32->handle == 0 ) {
|
if ( pParmWIN32->handle == 0 ) {
|
||||||
free ( pParmWIN32 );
|
epicsParmCleanupDataWIN32 ( pParmWIN32 );
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
/* weird win32 interface threadId parameter inconsistency */
|
/* weird win32 interface threadId parameter inconsistency */
|
||||||
@@ -618,8 +626,7 @@ epicsShareFunc epicsThreadId epicsShareAPI epicsThreadCreate (const char *pName,
|
|||||||
osdPriority = epicsThreadGetOsdPriorityValue (priority);
|
osdPriority = epicsThreadGetOsdPriorityValue (priority);
|
||||||
bstat = SetThreadPriority ( pParmWIN32->handle, osdPriority );
|
bstat = SetThreadPriority ( pParmWIN32->handle, osdPriority );
|
||||||
if (!bstat) {
|
if (!bstat) {
|
||||||
CloseHandle ( pParmWIN32->handle );
|
epicsParmCleanupDataWIN32 ( pParmWIN32 );
|
||||||
free ( pParmWIN32 );
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -632,8 +639,7 @@ epicsShareFunc epicsThreadId epicsShareAPI epicsThreadCreate (const char *pName,
|
|||||||
EnterCriticalSection ( & pGbl->mutex );
|
EnterCriticalSection ( & pGbl->mutex );
|
||||||
ellDelete ( & pGbl->threadList, & pParmWIN32->node );
|
ellDelete ( & pGbl->threadList, & pParmWIN32->node );
|
||||||
LeaveCriticalSection ( & pGbl->mutex );
|
LeaveCriticalSection ( & pGbl->mutex );
|
||||||
CloseHandle ( pParmWIN32->handle );
|
epicsParmCleanupDataWIN32 ( pParmWIN32 );
|
||||||
free ( pParmWIN32 );
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -641,21 +647,34 @@ epicsShareFunc epicsThreadId epicsShareAPI epicsThreadCreate (const char *pName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* epicsThreadSuspendSelf ()
|
* getMyWin32ThreadParam ()
|
||||||
*/
|
*/
|
||||||
epicsShareFunc void epicsShareAPI epicsThreadSuspendSelf ()
|
static void* getMyWin32ThreadParam ( win32ThreadGlobal * pGbl )
|
||||||
{
|
{
|
||||||
win32ThreadGlobal * pGbl = fetchWin32ThreadGlobal ();
|
|
||||||
win32ThreadParam * pParm;
|
win32ThreadParam * pParm;
|
||||||
DWORD stat;
|
|
||||||
|
|
||||||
assert ( pGbl );
|
if ( ! pGbl ) {
|
||||||
|
pGbl = fetchWin32ThreadGlobal ();
|
||||||
|
assert ( pGbl );
|
||||||
|
}
|
||||||
|
|
||||||
pParm = ( win32ThreadParam * )
|
pParm = ( win32ThreadParam * )
|
||||||
TlsGetValue ( pGbl->tlsIndexThreadLibraryEPICS );
|
TlsGetValue ( pGbl->tlsIndexThreadLibraryEPICS );
|
||||||
if ( ! pParm ) {
|
if ( ! pParm ) {
|
||||||
pParm = epicsThreadImplicitCreate ();
|
pParm = epicsThreadImplicitCreate ();
|
||||||
}
|
}
|
||||||
|
return pParm;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* epicsThreadSuspendSelf ()
|
||||||
|
*/
|
||||||
|
epicsShareFunc void epicsShareAPI epicsThreadSuspendSelf ()
|
||||||
|
{
|
||||||
|
DWORD stat;
|
||||||
|
win32ThreadGlobal * pGbl = fetchWin32ThreadGlobal ();
|
||||||
|
win32ThreadParam * pParm = getMyWin32ThreadParam ( pGbl );
|
||||||
|
|
||||||
if ( pParm ) {
|
if ( pParm ) {
|
||||||
EnterCriticalSection ( & pGbl->mutex );
|
EnterCriticalSection ( & pGbl->mutex );
|
||||||
pParm->isSuspended = 1;
|
pParm->isSuspended = 1;
|
||||||
@@ -700,16 +719,8 @@ epicsShareFunc unsigned epicsShareAPI epicsThreadGetPriority (epicsThreadId id)
|
|||||||
*/
|
*/
|
||||||
epicsShareFunc unsigned epicsShareAPI epicsThreadGetPrioritySelf ()
|
epicsShareFunc unsigned epicsShareAPI epicsThreadGetPrioritySelf ()
|
||||||
{
|
{
|
||||||
win32ThreadGlobal * pGbl = fetchWin32ThreadGlobal ();
|
win32ThreadParam * pParm = getMyWin32ThreadParam ( NULL );
|
||||||
win32ThreadParam * pParm;
|
|
||||||
|
|
||||||
assert ( pGbl );
|
|
||||||
|
|
||||||
pParm = ( win32ThreadParam * )
|
|
||||||
TlsGetValue ( pGbl->tlsIndexThreadLibraryEPICS );
|
|
||||||
if ( ! pParm ) {
|
|
||||||
pParm = epicsThreadImplicitCreate ();
|
|
||||||
}
|
|
||||||
if ( pParm ) {
|
if ( pParm ) {
|
||||||
return pParm->epicsPriority;
|
return pParm->epicsPriority;
|
||||||
}
|
}
|
||||||
@@ -764,24 +775,59 @@ epicsShareFunc int epicsShareAPI epicsThreadIsSuspended ( epicsThreadId id )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* osdThreadGetTimer ()
|
||||||
|
* return stored waitable timer object for thread
|
||||||
|
*/
|
||||||
|
HANDLE osdThreadGetTimer()
|
||||||
|
{
|
||||||
|
win32ThreadParam * pParm = getMyWin32ThreadParam ( NULL );
|
||||||
|
if (pParm) {
|
||||||
|
return pParm->timer;
|
||||||
|
} else {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* epicsThreadSleep ()
|
* epicsThreadSleep ()
|
||||||
*/
|
*/
|
||||||
epicsShareFunc void epicsShareAPI epicsThreadSleep ( double seconds )
|
epicsShareFunc void epicsShareAPI epicsThreadSleep ( double seconds )
|
||||||
{
|
{
|
||||||
static const unsigned mSecPerSec = 1000;
|
/* waitable timers use 100 nanosecond intervals, like FILETIME */
|
||||||
DWORD milliSecDelay;
|
static const unsigned ivalPerSec = 10000000u; /* number of 100ns intervals per second */
|
||||||
|
static const unsigned mSecPerSec = 1000u; /* milliseconds per second */
|
||||||
|
LARGE_INTEGER tmo;
|
||||||
|
HANDLE timer;
|
||||||
|
LONGLONG nIvals; /* number of intervals */
|
||||||
|
|
||||||
if ( seconds > 0.0 ) {
|
if ( seconds <= 0.0 ) {
|
||||||
seconds *= mSecPerSec;
|
tmo.QuadPart = 0u;
|
||||||
seconds += 0.99999999; /* 8 9s here is optimal */
|
|
||||||
milliSecDelay = ( seconds >= INFINITE ) ?
|
|
||||||
INFINITE - 1 : ( DWORD ) seconds;
|
|
||||||
}
|
}
|
||||||
else { /* seconds <= 0 or NAN */
|
else if ( seconds >= INFINITE / mSecPerSec ) {
|
||||||
milliSecDelay = 0u;
|
/* we need to apply a maximum wait time to stop an overflow. We choose (INFINITE - 1) milliseconds,
|
||||||
|
to be compatible with previous WaitForSingleObject() implementation */
|
||||||
|
nIvals = (LONGLONG)(INFINITE - 1) * (ivalPerSec / mSecPerSec);
|
||||||
|
tmo.QuadPart = -nIvals; /* negative value means a relative time offset for timer */
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
nIvals = (LONGLONG)(seconds * ivalPerSec + 0.999999);
|
||||||
|
tmo.QuadPart = -nIvals;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tmo.QuadPart == 0) {
|
||||||
|
Sleep ( 0 );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
timer = osdThreadGetTimer();
|
||||||
|
if (!SetWaitableTimer(timer, &tmo, 0, NULL, NULL, 0)) {
|
||||||
|
fprintf ( stderr, "epicsThreadSleep: SetWaitableTimer failed %lu\n", GetLastError() );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (WaitForSingleObject(timer, INFINITE) != WAIT_OBJECT_0) {
|
||||||
|
fprintf ( stderr, "epicsThreadSleep: WaitForSingleObject failed %lu\n", GetLastError() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Sleep ( milliSecDelay );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -821,17 +867,8 @@ double epicsShareAPI epicsThreadSleepQuantum ()
|
|||||||
*/
|
*/
|
||||||
epicsShareFunc epicsThreadId epicsShareAPI epicsThreadGetIdSelf (void)
|
epicsShareFunc epicsThreadId epicsShareAPI epicsThreadGetIdSelf (void)
|
||||||
{
|
{
|
||||||
win32ThreadGlobal * pGbl = fetchWin32ThreadGlobal ();
|
win32ThreadParam * pParm = getMyWin32ThreadParam ( NULL );
|
||||||
win32ThreadParam * pParm;
|
assert ( pParm ); /* very dangerous to allow non-unique thread id into use */
|
||||||
|
|
||||||
assert ( pGbl );
|
|
||||||
|
|
||||||
pParm = ( win32ThreadParam * ) TlsGetValue (
|
|
||||||
pGbl->tlsIndexThreadLibraryEPICS );
|
|
||||||
if ( ! pParm ) {
|
|
||||||
pParm = epicsThreadImplicitCreate ();
|
|
||||||
assert ( pParm ); /* very dangerous to allow non-unique thread id into use */
|
|
||||||
}
|
|
||||||
return ( epicsThreadId ) pParm;
|
return ( epicsThreadId ) pParm;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -868,19 +905,7 @@ epicsShareFunc epicsThreadId epicsShareAPI epicsThreadGetId ( const char * pName
|
|||||||
*/
|
*/
|
||||||
epicsShareFunc const char * epicsShareAPI epicsThreadGetNameSelf (void)
|
epicsShareFunc const char * epicsShareAPI epicsThreadGetNameSelf (void)
|
||||||
{
|
{
|
||||||
win32ThreadGlobal * pGbl = fetchWin32ThreadGlobal ();
|
win32ThreadParam * pParm = getMyWin32ThreadParam ( NULL );
|
||||||
win32ThreadParam * pParm;
|
|
||||||
|
|
||||||
if ( ! pGbl ) {
|
|
||||||
return "thread library not initialized";
|
|
||||||
}
|
|
||||||
|
|
||||||
pParm = ( win32ThreadParam * )
|
|
||||||
TlsGetValue ( pGbl->tlsIndexThreadLibraryEPICS );
|
|
||||||
if ( ! pParm ) {
|
|
||||||
pParm = epicsThreadImplicitCreate ();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( pParm ) {
|
if ( pParm ) {
|
||||||
if ( pParm->pName ) {
|
if ( pParm->pName ) {
|
||||||
return pParm->pName;
|
return pParm->pName;
|
||||||
|
|||||||
14
src/libCom/osi/os/WIN32/osdThreadPvt.h
Normal file
14
src/libCom/osi/os/WIN32/osdThreadPvt.h
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#ifndef osdThreadPvth
|
||||||
|
#define osdThreadPvth
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern HANDLE osdThreadGetTimer(void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* osdThreadPvth */
|
||||||
@@ -8,44 +8,86 @@
|
|||||||
* and higher are distributed subject to a Software License Agreement found
|
* and higher are distributed subject to a Software License Agreement found
|
||||||
* in file LICENSE that is included with this distribution.
|
* in file LICENSE that is included with this distribution.
|
||||||
\*************************************************************************/
|
\*************************************************************************/
|
||||||
|
|
||||||
#define VC_EXTRALEAN
|
#define VC_EXTRALEAN
|
||||||
#define STRICT
|
#define STRICT
|
||||||
#if _WIN64
|
|
||||||
# define _WIN32_WINNT 0x400 /* defining this drops support for W95 */
|
|
||||||
#endif
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* this was copied directly from an example in visual c++ 7 documentation,
|
|
||||||
* It uses visual C++ specific keywords for exception handling, but is
|
|
||||||
* probably only useful when using the visual c++ or later debugger.
|
|
||||||
*
|
|
||||||
* Usage: setThreadName (-1, "MainThread");
|
* Usage: setThreadName (-1, "MainThread");
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
static void setThreadNameVS ( DWORD dwThreadID, LPCSTR szThreadName );
|
||||||
|
typedef HRESULT (WINAPI* setDesc_t)(HANDLE, PCWSTR);
|
||||||
|
|
||||||
extern "C" void setThreadName ( DWORD dwThreadID, LPCSTR szThreadName )
|
extern "C" void setThreadName ( DWORD dwThreadID, LPCSTR szThreadName )
|
||||||
|
{
|
||||||
|
static HMODULE hKernel = LoadLibrary("KernelBase.dll");
|
||||||
|
static setDesc_t pSetDesc = (hKernel != NULL ?
|
||||||
|
(setDesc_t)GetProcAddress(hKernel, "SetThreadDescription") : NULL);
|
||||||
|
if (szThreadName == NULL || *szThreadName == '\0')
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (pSetDesc != NULL)
|
||||||
|
{
|
||||||
|
#ifdef THREAD_SET_LIMITED_INFORMATION
|
||||||
|
DWORD thread_access = THREAD_SET_LIMITED_INFORMATION;
|
||||||
|
#else
|
||||||
|
DWORD thread_access = THREAD_SET_INFORMATION;
|
||||||
|
#endif /* ifdef THREAD_SET_LIMITED_INFORMATION */
|
||||||
|
HANDLE hThread = OpenThread(thread_access, FALSE, dwThreadID);
|
||||||
|
if (hThread != NULL)
|
||||||
|
{
|
||||||
|
const std::string s(szThreadName);
|
||||||
|
const std::wstring ws(s.begin(), s.end());
|
||||||
|
HRESULT hr = (*pSetDesc)(hThread, ws.c_str());
|
||||||
|
CloseHandle(hThread);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// if SetThreadDescription() was available and we have a recent
|
||||||
|
// visual studio debugger (2017 version 15.6 or higher) attached
|
||||||
|
// then the names will already be defined. However we don't know
|
||||||
|
// this for sure, so also trigger the old exception mechanism.
|
||||||
|
// See https://docs.microsoft.com/en-us/visualstudio/debugger/how-to-set-a-thread-name-in-native-code
|
||||||
|
setThreadNameVS(dwThreadID, szThreadName);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void setThreadNameVS( DWORD dwThreadID, LPCSTR szThreadName )
|
||||||
{
|
{
|
||||||
#if _MSC_VER >= 1300 && defined ( _DEBUG )
|
#if _MSC_VER >= 1300 && defined ( _DEBUG )
|
||||||
|
// This was copied directly from an MSDN example
|
||||||
|
// It sets the thread name by throwing a special exception that is caught by Visual Sudio
|
||||||
|
// It requires the debugger to be already attached to the process
|
||||||
|
// when the exception is thrown for the name to be registered
|
||||||
|
static const DWORD MS_VC_EXCEPTION = 0x406D1388;
|
||||||
|
#pragma pack(push,8)
|
||||||
typedef struct tagTHREADNAME_INFO
|
typedef struct tagTHREADNAME_INFO
|
||||||
{
|
{
|
||||||
DWORD dwType; // must be 0x1000
|
DWORD dwType; // Must be 0x1000.
|
||||||
LPCSTR szName; // pointer to name (in user addr space)
|
LPCSTR szName; // Pointer to name (in user addr space).
|
||||||
DWORD dwThreadID; // thread ID (-1=caller thread)
|
DWORD dwThreadID; // Thread ID (-1=caller thread).
|
||||||
DWORD dwFlags; // reserved for future use, must be zero
|
DWORD dwFlags; // Reserved for future use, must be zero.
|
||||||
} THREADNAME_INFO;
|
} THREADNAME_INFO;
|
||||||
|
#pragma pack(pop)
|
||||||
THREADNAME_INFO info;
|
THREADNAME_INFO info;
|
||||||
info.dwType = 0x1000;
|
info.dwType = 0x1000;
|
||||||
info.szName = szThreadName;
|
info.szName = szThreadName;
|
||||||
info.dwThreadID = dwThreadID;
|
info.dwThreadID = dwThreadID;
|
||||||
info.dwFlags = 0;
|
info.dwFlags = 0;
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable: 6320 6322)
|
||||||
__try
|
__try
|
||||||
{
|
{
|
||||||
RaiseException( 0x406D1388, 0,
|
RaiseException(MS_VC_EXCEPTION, 0,
|
||||||
sizeof(info)/sizeof(DWORD), (const ULONG_PTR*)&info );
|
sizeof(info) / sizeof(ULONG_PTR),
|
||||||
|
(ULONG_PTR*)&info);
|
||||||
}
|
}
|
||||||
__except(EXCEPTION_CONTINUE_EXECUTION)
|
__except (EXCEPTION_EXECUTE_HANDLER)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
#pragma warning(pop)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ bswap32(epicsUInt32 value)
|
|||||||
#elif EPICS_BYTE_ORDER == EPICS_ENDIAN_LITTLE
|
#elif EPICS_BYTE_ORDER == EPICS_ENDIAN_LITTLE
|
||||||
|
|
||||||
/* Get hton[sl] declarations: */
|
/* Get hton[sl] declarations: */
|
||||||
#include <osdSock.h>
|
#include <osiSock.h>
|
||||||
|
|
||||||
/** @ingroup mmio
|
/** @ingroup mmio
|
||||||
*@{
|
*@{
|
||||||
|
|||||||
@@ -108,13 +108,14 @@ inline double delayVerify::delay () const
|
|||||||
|
|
||||||
double delayVerify::checkError () const
|
double delayVerify::checkError () const
|
||||||
{
|
{
|
||||||
const double messageThresh = 5.0; // percent
|
const double minError = 0.25;
|
||||||
double actualDelay = this->expireStamp - this->beginStamp;
|
double measuredDelay = this->expireStamp - this->beginStamp;
|
||||||
double measuredError = actualDelay - this->expectedDelay;
|
double measuredError = measuredDelay - this->expectedDelay;
|
||||||
double percentError = 100.0 * fabs ( measuredError ) / this->expectedDelay;
|
double absoluteError = fabs(measuredError);
|
||||||
testOk ( percentError < messageThresh, "%f < %f, delay = %f s, error = %f s (%.1f %%)",
|
double percentError = 100.0 * measuredError / this->expectedDelay;
|
||||||
percentError, messageThresh,
|
testOk(absoluteError < minError,
|
||||||
this->expectedDelay, measuredError, percentError );
|
"Delay %.3f s, error = %+.6f ms (%+.3f %%)",
|
||||||
|
this->expectedDelay, measuredError * 1000, percentError);
|
||||||
return measuredError;
|
return measuredError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,8 @@
|
|||||||
#include "yajl_encode.h"
|
#include "yajl_encode.h"
|
||||||
#include "yajl_bytestack.h"
|
#include "yajl_bytestack.h"
|
||||||
|
|
||||||
|
#include <epicsStdlib.h>
|
||||||
|
|
||||||
unsigned char *
|
unsigned char *
|
||||||
yajl_render_error_string(yajl_handle hand, const unsigned char * jsonText,
|
yajl_render_error_string(yajl_handle hand, const unsigned char * jsonText,
|
||||||
unsigned int jsonTextLen, int verbose)
|
unsigned int jsonTextLen, int verbose)
|
||||||
@@ -67,14 +69,14 @@ yajl_render_error_string(yajl_handle hand, const unsigned char * jsonText,
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
unsigned int memneeded = 0;
|
size_t memneeded = 0;
|
||||||
memneeded += strlen(errorType);
|
memneeded += strlen(errorType);
|
||||||
memneeded += strlen(" error");
|
memneeded += strlen(" error");
|
||||||
if (errorText != NULL) {
|
if (errorText != NULL) {
|
||||||
memneeded += strlen(": ");
|
memneeded += strlen(": ");
|
||||||
memneeded += strlen(errorText);
|
memneeded += strlen(errorText);
|
||||||
}
|
}
|
||||||
str = (unsigned char *) YA_MALLOC(&(hand->alloc), memneeded + 2);
|
str = (unsigned char *) YA_MALLOC(&(hand->alloc), (unsigned int)(memneeded + 2));
|
||||||
str[0] = 0;
|
str[0] = 0;
|
||||||
strcat((char *) str, errorType);
|
strcat((char *) str, errorType);
|
||||||
strcat((char *) str, " error");
|
strcat((char *) str, " error");
|
||||||
@@ -263,7 +265,7 @@ yajl_do_parse(yajl_handle hand, const unsigned char * jsonText,
|
|||||||
yajl_buf_clear(hand->decodeBuf);
|
yajl_buf_clear(hand->decodeBuf);
|
||||||
yajl_buf_append(hand->decodeBuf, buf, bufLen);
|
yajl_buf_append(hand->decodeBuf, buf, bufLen);
|
||||||
buf = yajl_buf_data(hand->decodeBuf);
|
buf = yajl_buf_data(hand->decodeBuf);
|
||||||
d = strtod((char *) buf, NULL);
|
d = epicsStrtod((char *) buf, NULL);
|
||||||
if ((d == HUGE_VAL || d == -HUGE_VAL) &&
|
if ((d == HUGE_VAL || d == -HUGE_VAL) &&
|
||||||
errno == ERANGE)
|
errno == ERANGE)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -99,22 +99,23 @@ SELM is a menu, with three choices:
|
|||||||
|
|
||||||
=menu dfanoutSELM
|
=menu dfanoutSELM
|
||||||
|
|
||||||
If SELM=="All", then all output links are used, and the values of
|
If SELM is C<All>, then all output links are used, and the values of
|
||||||
SELL and SELN are ignored.
|
SELL and SELN are ignored.
|
||||||
|
|
||||||
If SELM=="Specified", then the value of SELN is used to specify a single
|
If SELM is C<Specified>, then the value of SELN is used to specify a single
|
||||||
link which will be used. If SELN==0, then no link will be used; if SELN==1,
|
link which will be used. If SELN==0, then no link will be used; if SELN==1,
|
||||||
then OUTA will be used, and so on.
|
then OUTA will be used, and so on.
|
||||||
|
|
||||||
SELN can either have its value set directly, or have its values retrieved
|
SELN can either have its value set directly, or have it retrieved from
|
||||||
from another EPICS PV. If SELL is a valid PV link, then SELN will be set to
|
another EPICS PV. If SELL is a valid PV link, then SELN will be read from
|
||||||
the values of the linked PV.
|
the linked PV.
|
||||||
|
|
||||||
If SELM=="Mask", then SELN will be treated as a bit mask. If bit one of
|
If SELM is C<Mask>, then SELN will be treated as a bit mask. If bit zero
|
||||||
SELN is set, then OUTA will be used, if bit two is set, OUTB will be used.
|
(the LSB) of SELN is set, then OUTA will be written to; if bit one is set,
|
||||||
Thus if SELN==5, OUTC and OUTA will be used.
|
OUTB will be written to, and so on. Thus when SELN==5, both OUTC and OUTA
|
||||||
|
will be written to.
|
||||||
|
|
||||||
=fields OUTA, OUTB, OUTC, OUTD, OUTE, OUTF, OUTG, OUTH
|
=fields SELL, SELM, SELN, OUTA, OUTB, OUTC, OUTD, OUTE, OUTF, OUTG, OUTH
|
||||||
|
|
||||||
=head3 Operator Display Parameters
|
=head3 Operator Display Parameters
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#*************************************************************************
|
#*************************************************************************
|
||||||
# Copyright (c) 2018 UChicago Argonne LLC, as Operator of Argonne
|
# Copyright (c) 2018 UChicago Argonne LLC, as Operator of Argonne
|
||||||
# National Laboratory.
|
# National Laboratory.
|
||||||
|
# SPDX-License-Identifier: EPICS
|
||||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||||
# in file LICENSE that is included with this distribution.
|
# in file LICENSE that is included with this distribution.
|
||||||
#*************************************************************************
|
#*************************************************************************
|
||||||
@@ -34,6 +35,8 @@ sub HostArch {
|
|||||||
return 'linux-x86_64' if m/^x86_64-linux/;
|
return 'linux-x86_64' if m/^x86_64-linux/;
|
||||||
return 'linux-x86' if m/^i[3-6]86-linux/;
|
return 'linux-x86' if m/^i[3-6]86-linux/;
|
||||||
return 'linux-arm' if m/^arm-linux/;
|
return 'linux-arm' if m/^arm-linux/;
|
||||||
|
return 'linux-aarch64' if m/^aarch64-linux/;
|
||||||
|
return 'linux-ppc64' if m/^powerpc64-linux/;
|
||||||
return 'windows-x64' if m/^MSWin32-x64/;
|
return 'windows-x64' if m/^MSWin32-x64/;
|
||||||
return 'win32-x86' if m/^MSWin32-x86/;
|
return 'win32-x86' if m/^MSWin32-x86/;
|
||||||
return "cygwin-x86_64" if m/^x86_64-cygwin/;
|
return "cygwin-x86_64" if m/^x86_64-cygwin/;
|
||||||
@@ -44,8 +47,8 @@ sub HostArch {
|
|||||||
my ($kernel, $hostname, $release, $version, $cpu) = uname;
|
my ($kernel, $hostname, $release, $version, $cpu) = uname;
|
||||||
if (m/^darwin/) {
|
if (m/^darwin/) {
|
||||||
for ($cpu) {
|
for ($cpu) {
|
||||||
return 'darwin-x86' if m/^(i386|x86_64)/;
|
return 'darwin-x86' if m/^x86_64/;
|
||||||
return 'darwin-ppc' if m/Power Macintosh/;
|
return 'darwin-aarch64' if m/^arm64/;
|
||||||
}
|
}
|
||||||
die "$0: macOS CPU type '$cpu' not recognized\n";
|
die "$0: macOS CPU type '$cpu' not recognized\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,6 +86,8 @@ CLEANS += epics-base-$(T_A).pc@
|
|||||||
|
|
||||||
include $(TOP)/configure/RULES
|
include $(TOP)/configure/RULES
|
||||||
|
|
||||||
|
inc: $(INSTALLS_PERL_MODULES) $(INSTALL_SCRIPTS)
|
||||||
|
|
||||||
epics-base-$(T_A).pc@: ../epics-base-arch.pc@
|
epics-base-$(T_A).pc@: ../epics-base-arch.pc@
|
||||||
@$(RM) $@
|
@$(RM) $@
|
||||||
@$(CP) $< $@
|
@$(CP) $< $@
|
||||||
|
|||||||
Reference in New Issue
Block a user