diff --git a/.ci-local/adcore_hook.sh b/.ci-local/adcore_hook.sh new file mode 100755 index 00000000..506aa6f1 --- /dev/null +++ b/.ci-local/adcore_hook.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +# This script installs ADCore R3-11 +# +# check if user has right permissions +if [ "$(id -u)" != "0" ]; then + echo "Sorry, you are not root. Please try again using sudo." + exit 1 +fi + +# terminate script after first line that fails +set -e + +if [ -z "$EPICS_HOST_ARCH" ] +then + EPICS_HOST_ARCH=linux-x86_64 +fi + +# The directory above +SUPPORT="$(dirname "${PWD}")" + +# This won't have been set yet on the ADCore pass. +ADCORE=$PWD + +# This file will have been written by ci-scripts cue.py +source $SUPPORT/RELEASE.local + +# Hack RELEASE_LIBS.local file +sed -i -e "/^ADCORE\s*=/ s,=.*,=$ADCORE," $AREA_DETECTOR/configure/RELEASE_LIBS.local + +# Hack RELEASE_PRODS.local file +sed -i -e "/^ADCORE\s*=/ s,=.*,=$ADCORE," $AREA_DETECTOR/configure/RELEASE_PRODS.local + +# These are example plugin files, but we will just use them +if [ ! -f $ADCORE/iocBoot/commonPlugins.cmd ]; then + cp $ADCORE/iocBoot/EXAMPLE_commonPlugins.cmd $ADCORE/iocBoot/commonPlugins.cmd +fi + +# Hack commonPlugins.cmd - we need sseq_settings.req, which is in the calc module +sed -i "s/#set_requestfile_path(\"\$(CALC)\/calcApp\/Db\")/set_requestfile_path(\"\$(CALC)\/calcApp\/Db\")/" $ADCORE/iocBoot/commonPlugins.cmd +if [ ! -f $ADCORE/iocBoot/commonPlugin_settings.req ]; then + cp $ADCORE/iocBoot/EXAMPLE_commonPlugin_settings.req $ADCORE/iocBoot/commonPlugin_settings.req +fi + +# Hack the make file to allow multiple definition of `_Unwind_Resume on Linux. +# sed -i -e '/^include \$(TOP)\/ADApp\/commonLibraryMakefile/i ifeq (mingw, \$(findstring mingw, \$(T_A)))' $ADCORE/ADApp/pluginSrc/Makefile +# sed -i -e '/^include \$(TOP)\/ADApp\/commonLibraryMakefile/i \ \ USR_LDFLAGS += -Wl,-allow-multiple-definition' $ADCORE/ADApp/pluginSrc/Makefile +# sed -i -e '/^include \$(TOP)\/ADApp\/commonLibraryMakefile/i endif' $ADCORE/ADApp/pluginSrc/Makefile + + +if [ "$WINE" == "64" ]; then + if [ ! -f /usr/bin/x86_64-w64-mingw32-g++-win32 ]; then + apt-get install -y g++-mingw-w64-x86-64 + fi + # see https://github.com/randombit/botan/issues/2039 + update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-win32 +elif [ "$WINE" == "32" ]; then + if [ ! -f /usr/bin/i686-w64-mingw32-g++-win32 ]; then + apt-get install -y g++-mingw-w64-i686 + fi + update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-win32 +fi + diff --git a/.ci-local/adsupport_hook.sh b/.ci-local/adsupport_hook.sh new file mode 100755 index 00000000..408de4f5 --- /dev/null +++ b/.ci-local/adsupport_hook.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# This script configures ADSupport R1-9 +# +# check if user has right permissions +if [ "$(id -u)" != "0" ]; then + echo "Sorry, you are not root. Please try again using sudo." + exit 1 +fi + +# terminate script after first line that fails +set -e + +if [ -z "$EPICS_HOST_ARCH" ]; then + EPICS_HOST_ARCH=linux-x86_64 +fi +apt-get install -y libx11-dev libxext-dev + +# The directory above +SUPPORT="$(dirname "${PWD}")" + +# This won't have been set yet on the ADSupport pass. +ADSUPPORT=$PWD + +# This file will have been written by ci-scripts cue.py +source $SUPPORT/RELEASE.local + +# Hack RELEASE_LIBS.local file +sed -i -e "/^ADSUPPORT\s*=/ s,=.*,=$ADSUPPORT," $AREA_DETECTOR/configure/RELEASE_LIBS.local + +# Hack RELEASE_PRODS.local file +sed -i -e "/^ADSUPPORT\s*=/ s,=.*,=$ADSUPPORT," $AREA_DETECTOR/configure/RELEASE_PRODS.local + diff --git a/.ci-local/adurl_install.sh b/.ci-local/adurl_install.sh new file mode 100755 index 00000000..c91320cb --- /dev/null +++ b/.ci-local/adurl_install.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# This script installs NDS and NDS-epics +# +# check if user has right permissions +if [ "$(id -u)" != "0" ]; then + echo "Sorry, you are not root. Please try again using sudo." + exit 1 +fi + +# terminate script after first line that fails +set -e + +apt-get install -y libreadline6-dev libncurses5-dev perl clang g++-mingw-w64-i686 g++-mingw-w64-x86-64 qemu-system-x86 re2c tar +apt-get install -y build-essential git python curl p7zip-full wget libxml2-dev + +export GITLAB_CI=1 +export SETUP_PATH=".ci-local:.ci" +export BASE_RECURSIVE="YES" +export CMP="gcc" +export BGFC="default" +export SET="stable" +export CLEAN_DEPS="NO" +export WINE=64 +export VV=1 +export CLEAN_DEPS="NO" +python .ci/cue.py prepare > /tmp/adurl_install.log 2>&1 +python .ci/cue.py build >> /tmp/adurl_install.log 2>&1 + diff --git a/.ci-local/area_detector_hook.sh b/.ci-local/area_detector_hook.sh new file mode 100755 index 00000000..280b7bd3 --- /dev/null +++ b/.ci-local/area_detector_hook.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +# This script configures areadetector R3-11 +# +# check if user has right permissions +if [ "$(id -u)" != "0" ]; then + echo "Sorry, you are not root. Please try again using sudo." + exit 1 +fi + +# terminate script after first line that fails +set -e + +if [ -z "$EPICS_HOST_ARCH" ] +then + EPICS_HOST_ARCH=linux-x86_64 +fi +apt-get install -y libx11-dev libxext-dev + +# The directory above +SUPPORT="$(dirname "${PWD}")" + +# This won't have been set yet on the areaDetector pass. +AREA_DETECTOR=$PWD + +# This file will have been written by ci-scripts cue.py +source $SUPPORT/RELEASE.local + +pushd $AREA_DETECTOR/configure +echo "Copying from example." +./copyFromExample +popd + +#hack config_site.local +sed -i -e "/^WITH_PVA\s*=/ s,=.*,=YES," $AREA_DETECTOR/configure/CONFIG_SITE.local +sed -i -e "/^WITH_OPENCV\s*=/ s,=.*,=NO," $AREA_DETECTOR/configure/CONFIG_SITE.local +sed -i -e "/^WITH_QSRV\s*=/ s,=.*,=NO," $AREA_DETECTOR/configure/CONFIG_SITE.local +sed -i -e "/^WITH_BITSHUFFLE\s*=/ s,=.*,=NO," $AREA_DETECTOR/configure/CONFIG_SITE.local + +# EXAMPLE_CONFIG_SITE.local.linux-x86_64 sets WITH_BOOST. I don't wannit. +if [ -f $AREA_DETECTOR/configure/CONFIG_SITE.local.$EPICS_HOST_ARCH ]; then + rm $AREA_DETECTOR/configure/CONFIG_SITE.local.$EPICS_HOST_ARCH +fi + +# Hack RELEASE.local.linux-x86_64 file +# NB, this file currently points to ADPointGrey, ADEiger and ADAravis. +# I'm not installing these modules. +if [ -f $AREA_DETECTOR/configure/RELEASE.local.$EPICS_HOST_ARCH ]; then + rm $AREA_DETECTOR/configure/RELEASE.local.$EPICS_HOST_ARCH +fi +echo EPICS_BASE=$EPICS_BASE > $AREA_DETECTOR/configure/RELEASE.local + +# Hack RELEASE_LIBS.local file +sed -i -e "/^SUPPORT\s*=/ s,=.*,=$SUPPORT," $AREA_DETECTOR/configure/RELEASE_LIBS.local +sed -i -e "/^ASYN\s*=/ s,=.*,=$ASYN," $AREA_DETECTOR/configure/RELEASE_LIBS.local +sed -i -e "/^EPICS_BASE\s*=/ s,=.*,=$EPICS_BASE," $AREA_DETECTOR/configure/RELEASE_LIBS.local +sed -i -e "/^AREA_DETECTOR\s*=/ s,=.*,=$AREA_DETECTOR," $AREA_DETECTOR/configure/RELEASE_LIBS.local + +# Hack RELEASE_PRODS.local file +sed -i -e "/^SUPPORT\s*=/ s,=.*,=$SUPPORT," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^CALC\s*=/ s,=.*,=$CALC," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^BUSY\s*=/ s,=.*,=$BUSY," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^SSCAN\s*=/ s,=.*,=$SSCAN," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^AUTOSAVE\s*=/ s,=.*,=$AUTOSAVE," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^SNCSEQ\s*=/ s,=.*,=$SNCSEQ," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^EPICS_BASE\s*=/ s,=.*,=$EPICS_BASE," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^ASYN\s*=/ s,=.*,=$ASYN," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^AREA_DETECTOR\s*=/ s,=.*,=$AREA_DETECTOR," $AREA_DETECTOR/configure/RELEASE_PRODS.local + +# Don't think we need this. +sed -i "s/DEVIOCSTATS/#DEVIOCSTATS/g" $AREA_DETECTOR/configure/RELEASE_PRODS.local diff --git a/.ci-local/stable.set b/.ci-local/stable.set new file mode 100644 index 00000000..e12c7597 --- /dev/null +++ b/.ci-local/stable.set @@ -0,0 +1,23 @@ +MODULES=sncseq sscan calc asyn autosave busy area_Detector ADSupport ADCore + +BASE=R7.0.6.1 +SNCSEQ=R2-2-9 +SSCAN=R2-11-5 +CALC=R3-7-4 +ASYN=R4-41 +BUSY=R1-7-1 +AUTOSAVE=R5-7-1 + +AREA_DETECTOR=R3-11 +AREA_DETECTOR_REPOURL=https://github.com/areaDetector/areaDetector +AREA_DETECTOR_RECURSIVE=NO +AREA_DETECTOR_HOOK=.ci-local/area_detector_hook.sh +ADSUPPORT=master +ADSUPPORT_REPOURL=https://github.com/pheest/ADSupport +ADSUPPORT_RECURSIVE=NO +ADSUPPORT_HOOK=.ci-local/adsupport_hook.sh +ADCORE=master +ADCORE_REPOURL=https://github.com/pheest/ADCore +ADCORE_RECURSIVE=NO +ADCORE_HOOK=.ci-local/adcore_hook.sh + diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..2593f718 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,107 @@ +# .gitlab-ci.yml for testing EPICS Base ci-scripts +# (see: https://github.com/epics-base/ci-scripts) + +# This is YAML - indentation levels are crucial + +# GitLab runner can use any Docker container, we're using this one +# to be comparable with the other CI services +image: ubuntu:focal + +cache: + key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" + paths: + - .cache/ + +variables: + DEBIAN_FRONTEND: noninteractive + GIT_SUBMODULE_STRATEGY: "recursive" + SETUP_PATH: ".ci-local:.ci" + BASE_RECURSIVE: "YES" + # Additional packages needed for + # | EPICS |clang| Windows cross builds |RTEMS testing |sequencer + APT: "libreadline6-dev libncurses5-dev perl clang g++-mingw-w64-i686 g++-mingw-w64-x86-64 qemu-system-x86 re2c" + CMP: "gcc" + BGFC: "default" + SET: stable + CLEAN_DEPS: "NO" + +# Template for build jobs (hidden) +.build: + stage: build + before_script: + - apt-get update -qq && apt-get install -y -qq build-essential git python curl p7zip-full libgtest-dev libxml2-dev + - python .ci/cue.py prepare + script: + - python .ci/cue.py build + - python .ci/cue.py test + - python .ci/cue.py test-results + +# If you need to do more during install and build, +# add a local directory to your module and do e.g. +# - ./.ci-local/travis/install-extras.sh + +# Define build jobs + +# Well-known variables to use +# SET source setup file +# ADD_MODULES extra modules (for a specific job) +# BCFG build configuration (static/debug/static-debug; +# default: shared-optimized) +# TEST set to NO to skip running the tests (default: YES) +# VV set to make build scripts verbose (default: unset) +# EXTRA content will be added to make command line +# EXTRA1..5 more additional arguments for the make command +# (one argument per variable) + +# Usually from setup files, but may be specified or overridden +# on a job line +# MODULES list of dependency modules +# BASE branch or release tag name of the EPICS Base to use +# branch or release tag for a specific module +# ... see README for setup file syntax description + +# Different configurations of gcc and clang +gcc_default: + extends: .build + variables: + +gcc_static: + extends: .build + variables: + BCFG: "static" + +clang_default: + extends: .build + variables: + CMP: "clang" + +clang_static_c++11: + extends: .build + variables: + CMP: "clang" + BCFG: "static" + EXTRA: "CMD_CXXFLAGS=-std=c++11" + +# Cross-compilations to Windows using gcc/MinGW and WINE +wine32_default: + extends: .build + variables: + WINE: "32" + +wine64_default: + extends: .build + variables: + WINE: "64" + +wine64_debug: + extends: .build + variables: + WINE: "64" + BCFG: "debug" + +wine64_static: + extends: .build + variables: + WINE: "64" + BCFG: "static" + diff --git a/iocs/urlIOC/configure/RELEASE b/iocs/urlIOC/configure/RELEASE index 7cc476eb..e451aa2c 100644 --- a/iocs/urlIOC/configure/RELEASE +++ b/iocs/urlIOC/configure/RELEASE @@ -6,4 +6,4 @@ ADURL=$(TOP)/../.. -include $(TOP)/../../../configure/RELEASE_PRODS_INCLUDE -include $(TOP)/RELEASE.local --include $(TOP)/configure/RELEASE.local +-include $(ADURL)/configure/RELEASE.local diff --git a/urlApp/src/Makefile b/urlApp/src/Makefile index 735bc623..518a633c 100644 --- a/urlApp/src/Makefile +++ b/urlApp/src/Makefile @@ -27,6 +27,11 @@ ifeq ($(WITH_GRAPHICSMAGICK), YES) USR_CXXFLAGS_WIN32 += -DWIN32 endif + ifeq (mingw, $(findstring mingw, $(T_A))) + # multiple definition of `_Unwind_Resume on Linux. I don't know how to fix it. + USR_LDFLAGS += -Wl,-allow-multiple-definition + endif + ifeq ($(SHARED_LIBRARIES),YES) USR_CXXFLAGS_WIN32 += -D_DLL else