Skip to content
forked from icshwi/e3

ESS EPICS Environment : e3 developing environment

Notifications You must be signed in to change notification settings

SaeedHaghtalab/e3

 
 

Repository files navigation

e3 developing environment

Build Status

This is the setup and maintenance scripts for the ESS EPICS Environment (E3).

Tested Platforms

  • Building, requiring (loading), and running modules should be tested carefully if one would like to run an EPICS IOC within e3.
  • The following Linux distribution covers Building and Requiring Tests.

Building and Requiring Tests

  • Debian 8
  • Debian 9
  • CentOS 7
  • Ubuntu 14.04 LTS (with travis-ci)
  • Ubuntu 18.04

Building Test (Not all modules)

  • Raspbian Stretch

  • Ubuntu 16.04.3 LTS

  • Ubuntu 17.10 (Artful Aardvark)

  • LinuxMint 18.3 (sylvia)

  • Fedora 27 (Workstation Edition)

Procedure to duplicate the minimal E3 in your system.

  • This procedure has many assumptions, so it is most-likely "doesn't work". Thus please look at the other site in order to duplicate e3 at https://github.com/icshwi/e3-builder

  • However, if one would like to challenge this, please follow the below basic instruction.

  • This script, e3.bash, is not the proper tool to deploy the E3 in any production environment, but it is the system which I can design, develop, and debug E3 in many different scenarios. One can use it to duplicate the E3 in most Linux flavor without any difficulties.

Note that the user account should be in sudo group. And please install "git" and "make" first.

Get e3

$ git clone https://github.com/icshwi/e3

Install base within the e3 directory

NOTICE, before going to run the next command, PLEASE INSTALL ALL REQUIRED PACKAGES FIRST. If not, one CANNOT install and run e3. Please consult the reference repository [1] which may help users to install all required and additional packages before it. One can see the e3 training workbook for the up-to-date information [2]. For example, the following packages mostly are needed to compile e3 and some additional services in CentOS and Debian. Note that one may not need them all according to ones configuration.

  • CentOS
git tree ipmitool autoconf libtool automake m4 re2c tclx coreutils graphviz patch readline-devel libXt-devel libXp-devel libXmu-devel libXpm-devel lesstif-devel gcc-c++ ncurses-devel perl-devel net-snmp net-snmp-utils net-snmp-devel libxml2-devel libpng12-devel libzip-devel libusb-devel python-devel darcs hdf5-devel boost-devel pcre-devel opencv-devel libcurl-devel libjpeg-turbo-devel libusbx-devel systemd-devel libraw1394.x86_64 hg libtirpc-devel liberation-fonts-common liberation-narrow-fonts liberation-mono-fonts liberation-serif-fonts liberation-sans-fonts logrotate xorg-x11-fonts-misc cpan kernel-devel symlinks dkms procServ curl
  • Debian
git tree emacs ipmitool autoconf libtool automake m4 re2c tclx coreutils graphviz build-essential libreadline-dev libxt-dev x11proto-print-dev libxmu-headers libxmu-dev libxmu6 libxpm-dev libxmuu-dev libxmuu1 libpcre++-dev libmotif-dev libsnmp-dev re2c darcs python-dev libnetcdf-dev libhdf5-dev libbz2-dev libxml2-dev libusb-dev libusb-1.0-0-dev libudev-dev libsystemd-dev linux-source mercurial libboost-dev libboost-regex-dev libboost-filesystem-dev libopencv-dev libpng-dev libraw1394-11 libtirpc-dev fonts-liberation logrotate curl symlinks dkms procserv linux-headers-$(uname -r)
$ bash e3_building_config.bash -t ${HOME}/epics setup

$ bash e3.bash base

Install require within the e3 directory

$ bash e3.bash req

Install common modules within the e3 directory

One should install base and require first before each modules's configuration.

$ bash e3.bash -c vars

>> Vertical display for the selected modules :

 Modules List 
    0 : e3-ess
    1 : e3-iocStats
    2 : e3-autosave
    3 : e3-caPutLog
    4 : e3-asyn
    5 : e3-busy
    6 : e3-modbus
    7 : e3-ipmiComm
    8 : e3-seq
    9 : e3-sscan
   10 : e3-std
   11 : e3-ip
   12 : e3-calc
   13 : e3-delaygen
   14 : e3-pcre
   15 : e3-StreamDevice
   16 : e3-s7plc
   17 : e3-recsync


e3 (master)$ bash e3.bash -c mod

e3 (master)$ bash e3.bash -c load

If one see the clean ioc shell prompt, e3 is ready to use. Please exit this test ioc.

Enable e3 in only current terminal

Technically, one can have multiple e3 and community EPICS environment in a single host. To enable e3, please do the following command:

e3 (master)$ source tools/setenv 

The above environment file will be generated automatically through building procedure.

Since then, one can run the example ioc through

e3 (master)$  iocsh.bash cmds/iocStats.cmd 

Open another terminal, set the environment via source first, then run the caget_pvs.bash with the generated pv list file.

e3 (master)$ bash caget_pvs.bash -l IOC-9999_PVs.list 
.............
.............

IOC-9999-IocStats:ACCESS       Running
IOC-9999-IocStats:APP_DIR 160 47 104 111 109 101 47 106 104 108 101 101 47 101 51 45 51 46 49 53 46 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
IOC-9999-IocStats:APP_DIR1     /home/jhlee/e3-3.15.5
IOC-9999-IocStats:APP_DIR2     
IOC-9999-IocStats:CA_ADDR_LIST 
IOC-9999-IocStats:CA_AUTO_ADDR YES
IOC-9999-IocStats:CA_BEAC_TIME 15.0
IOC-9999-IocStats:CA_CLNT_CNT  0
IOC-9999-IocStats:CA_CONN_CNT  0
IOC-9999-IocStats:CA_CONN_TIME 30.0
IOC-9999-IocStats:CA_MAX_ARRAY 16384
IOC-9999-IocStats:CA_RPTR_PORT 5065
IOC-9999-IocStats:CA_SRCH_TIME 300.0
IOC-9999-IocStats:CA_SRVR_PORT 5064
IOC-9999-IocStats:CA_UPD_TIME  15
IOC-9999-IocStats:CPU_CNT      4
IOC-9999-IocStats:ENGINEER     jhlee
IOC-9999-IocStats:EPICS_VERS   EPICS R3.15.5-E3-3.15.5-patch
IOC-9999-IocStats:FD_CNT       7
IOC-9999-IocStats:FD_FREE      1017
IOC-9999-IocStats:FD_MAX       1024
IOC-9999-IocStats:FD_UPD_TIME  20
IOC-9999-IocStats:GTIM_CUR_SRC OS Clock
IOC-9999-IocStats:GTIM_ERR_CNT 0
IOC-9999-IocStats:GTIM_EVT_SRC No working providers
IOC-9999-IocStats:GTIM_HI_SRC  OS Clock
IOC-9999-IocStats:GTIM_RESET   Reset
IOC-9999-IocStats:GTIM_TIME    9.18241e+08
IOC-9999-IocStats:HEARTBEAT    17
IOC-9999-IocStats:HOSTNAME     faiserver
IOC-9999-IocStats:IOC_CPU_LOAD 0
IOC-9999-IocStats:IOC_LOG_INET 
IOC-9999-IocStats:IOC_LOG_PORT 7004
IOC-9999-IocStats:KERNEL_VERS  Linux 4.9.0-8-amd64 x86_64
IOC-9999-IocStats:LOAD         0
.............
e3 (master)$   bash caget_pvs.bash -l IOC-9999_PVs.list -f "LOAD"

>> Selected PV and its value with caget
IOC-9999-IocStats:IOC_CPU_LOAD 0.0250242
IOC-9999-IocStats:LOAD         0.0250242
IOC-9999-IocStats:LOAD_UPD_TIME 10
IOC-9999-IocStats:SYS_CPU_LOAD 30.2042

The most useful option is the fake watch with -w option such as

$ bash caget_pvs.bash -l IOC-9999_PVs.list -f "HEARTBEAT" -w 1
$ watch -n 1 "bash caget_pvs.bash -l IOC-9999_PVs.list -f "HEARTBEAT"

If one would like to do more, please visit https://github.com/icshwi/e3training

Outside the e3 directory

Each base, Require module, and others modules have its own MAKEFILE and its own configuration files. Thus, one can put e3-base, e3-require, and all other e3-modules in any directories where one would like to keep.

Usage for e3.bash

e3 (master)$ ./e3.bash 

Usage    : e3.bash [ -ctifealb4do ] <option> 


           -c     : common      : epics modules
           -t     : timing      : mrf timing modules
           -4     : epics v4    : EPICS V4 modules (testing)
           -i{c}  : ifc free    : ifc modules without user accounts
           -f{ci} : ifc nonfree : ifc modules with user accounts
           -e{c}  : ecat        : ethercat modules
           -a{c}  : area        : area detector modules / BI Modules
           -l{c}  : llrf        : old LLRF modules
           -b{ca} : bi          : beam instrumentation modules (based on AD)
           -d     : developing  : no dependency, one should installl all before
           {c,ci} : dep modules : enable by default if not defined (dependent modules)
             -o   : only        : ignore dependent modules
                                  the option -e is actually -ec. And -eo means -e.


 < option > 

           env    : Print enabled Modules

           call   : Clean all (base, require, selected module group)
           gall   : Clone all (base, require, selected module group)
            all   : call, gall, ibase, bbase, ireq, breq, imod, bmod

           cbase  : Clean Base
           gbase  : Clone Base
           ibase  : Init  Base 
           bbase  : Build, Install Base
            base  : cbase, gbase, ibase, bbase

           creq   : Clean Require
           greq   : Clone Require
           ireq   : Init  Require
           breq   : Build, Install Require
            req   : creq, gbase ireq, breq

           cmod   : Clean Modules (selected module group)
           gmod   : Clone Modules (selected module group)
           imod   : Init  Modules (selected module group)
           bmod   : Build, Install Modules (selected module group)
            mod   : cmod, mod, imod, bmod

        co_base "_check_out_name_" : Checkout Base
         co_req "_check_out_name_" : Checkout Require
         co_mod "_check_out_name_" : Checkout Modules  (selected module group)
         co_all "_check_out_name_" : co_base, co_req, co_mod

          vbase   : Print BASE    Version Information in e3-*
           vreq   : Print REQUIRE Version Information in e3-*
           vmod   : Print MODULES Version Information in e3-*
           vall   : Print ALL     Version Information in e3-*

         allall   : Print ALL Version Information in e3-* by using "make vars"

           load   : Load all installed Modules into iocsh.bash
           cmd    : create .cmd file in /home/jhlee/e3-upgraded
        setenv    : create setenv in /home/jhlee/e3-upgraded/tools


SSH KEY Usage

One needs to have the ESS bitbucket/gitlab accout in order to use ifc nonfree and llrf modules. The procedure make init will ask the ESS user name and its password several times. In order not to type account and password many time, one can add the ssh key in the account configurations in bitbucket and gitlab. After that, the following command should be executed in order to use the different url instead of the default one. Note that ESS gitlab repository cannot be accessiable outside the ESS network. Several modules (in the group t and b) cannot be cloned.

source tools/use_sshkey.sh

Customized e3 Building Configuration

If one would like to see the upcoming EPICS 7 with e3

$ bash e3_building_config.bash -t /epics/test -b 7.0.1.1 setup 
$ bash e3.bash base
$ bash e3.bash req
$ bash e3.bash -ctiao mod

Note that the -4 option is not necessary, but -o option is, because 7 has 4 already in base.

Please look at README_developing.md in more detail.


[1] https://github.com/jeonghanlee/pkg_automation [2] https://github.com/icshwi/e3training/blob/master/workbook/chapter1.md

About

ESS EPICS Environment : e3 developing environment

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 89.9%
  • Batchfile 6.5%
  • Dockerfile 3.6%