diff --git a/1-Setup.md b/1-Setup.md index 599af8fd8597e8f98e24a98e272a74fcd1f939fc..7c2ead54fe67d09755fa6f9244a81b79bc2c6fa8 100644 --- a/1-Setup.md +++ b/1-Setup.md @@ -4,134 +4,79 @@ ### 1.1 Configure Environment Variables -#### 1.1.1 Set enviroment variables specific to this training +These insructions assume the bash shell is used. -Determine which shell is used -``` -$ echo ${SHELL} -``` -<details> -<summary>output</summary> - -``` -/bin/bash -``` - -or - -``` -/bin/tcsh -``` -</details> +#### 1.1.1 Set enviroment variables specific to this training -Note: the EPICS_DIR environment variable can be changed if it is desirable to create the files for this training in a different location. +The EPICS_DIR environment variable can be changed if it is desirable to create the files for this training in a different location. -bash ```bash $ export EPICS_DIR=${HOME}/PET-S2/epics $ export IOC_DIR=${EPICS_DIR}/synApps_6_2_1/ioc $ export SUPPORT_DIR=${EPICS_DIR}/synApps_6_2_1/support ``` -tcsh -```csh -$ setenv EPICS_DIR ${HOME}/PET-S2/epics -$ setenv IOC_DIR ${EPICS_DIR}/synApps_6_2_1/ioc -$ setenv SUPPORT_DIR ${EPICS_DIR}/synApps_6_2_1/support -``` - #### 1.1.2 Set EPICS_HOST_ARCH -Run the following command to determine the RHEL version. +Use the generic linux architecture: ```bash -$ cat /etc/redhat-release +$ export EPICS_HOST_ARCH=linux-x86_64 ``` -<details> -<summary>output</summary> + +### 1.2 Deploy EPICS base + +#### 1.2.1 Clone EPICS base ``` -Red Hat Enterprise Linux Server release 7.9 (Maipo) +$ cd ${EPICS_DIR} +$ git clone -b R7.0.7 https://github.com/epics-base/epics-base.git base-7.0.7 ``` -or +#### 1.2.2 Build EPICS base ``` -Red Hat Enterprise Linux release 8.7 (Ootpa) +$ cd base-7.0.7 +$ make ``` -</details> -Set EPICS_HOST_ARCH based on the major RHEL version & shell +### 1.3 Deploy a subset of synApps_6_2_1 -| | RHEL7 | RHEL8 | -| --- | --- | --- | -| bash | `$ export EPICS_HOST_ARCH=rhel7-x86_64` | `$ export EPICS_HOST_ARCH=rhel8-x86_64` | -| tcsh | `$ setenv EPICS_HOST_ARCH rhel7-x86_64` | `$ setenv EPICS_HOST_ARCH rhel8-x86_64` | +Deploying only a subset of synApps reduces the number of build errors encountered on non-standard Linux systems. -#### 1.1.3 Clear EPICS environment variables +#### 1.3.1 Assemble synApps -These EPICS environment variables can cause problems with this training, so they should be cleared before continuing. - -bash -```bash -$ unset EPICS_BASE -$ unset EPICS_CA_ADDR_LIST -$ unset EPICS_CA_AUTO_ADDR_LIST ``` - -tcsh -```tcsh -$ unsetenv EPICS_BASE -$ unsetenv EPICS_CA_ADDR_LIST -$ unsetenv EPICS_CA_AUTO_ADDR_LIST +$ cd ${EPICS_DIR} +$ curl [URL]/training-synApps-config.txt ``` -### 1.2 Create directories needed for the training +#### 1.3.2 Build synApps -```bash -$ mkdir -p ${IOC_DIR} ${SUPPORT_DIR} +``` +$ cd ${SUPPORT_DIR} +$ make ``` -### 1.3 Confirm the directories exist +### 1.4 Create directories needed for the training ```bash -$ tree ${EPICS_DIR} +$ mkdir -p ${IOC_DIR} ``` -<details> -<summary>output</summary> -```bash -$ tree ${EPICS_DIR} -/home/beams/USERNAME/PET-S2/epics -└── synApps_6_2_1 - ├── ioc - └── support +### 1.5 caQtDM -3 directories, 0 files -``` -</details> +caQtDM is only packaged for Windows and OS X. It is painful to build on Linux. -If the **tree** command doesn't exist, there is a workaround: -<details> -<summary>workaround</summary> +One way to make caQtDM work for this training is to do the following: -The **find** command can be used to show all directories inside a specific directory. +1. Install caQtDM on a Windows machine on the same subnet as the Linux computer that will run the IOC +2. Copy the ui files from `asyn-R4-42/opi/caqtdm/autoconvert`, `motor-master/motorApp/op/ui/autoconvert`, and `my-xxx.ui` created in [step 2.3](2-IOC-deployment.md#23-choose-a-new-ioc-prefix) to a single directory on the windows machine +3. Set the CAQTDM_DISPLAY_PATH to the directory where the ui files were copied +4. Run caQtDM with required options -bash -```bash -$ tree() { find $1 -type d | grep -v git; } -``` - -tcsh -```csh -$ alias tree "find \!* -type d | grep -v git" -``` +Alternatively, use caget and caput from the EPICS base bin directory to avoid the need for caQtDM. -Once the bash function or tcsh alias is defined, the tree command can be rerun: -```bash -$ tree ${EPICS_DIR} -``` +## [2 Deploy a new IOC](2-IOC-deployment.md) </details> - -## [2 Deploy a new IOC](2-IOC-deployment.md) diff --git a/README.md b/README.md index 43a4a971f75a26b864ff72573ef8f871a2618461..3225d02a21ce7ee553fe0f5e2f69476bb1e1f6d0 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ This repo contains instructions for [Session 2 of the Practical Beamline Control ## Quickstart -There is a script that outputs commands from the "Setup" section in a form that can be easily copied and pasted. +The external quickstart script is much less useful on non-APS machines. To use the script, do the following: @@ -52,7 +52,7 @@ No. Just use **mkioc**. #### Can I complete this exercise on a computer other than an APS-maintained RHEL computer? -No. +Yes, in theory, but it requires building a local copy of EPICS base and a subset of synApps. It is likely other problems will be encountered. #### Why does the solution branch use ~ instead of /home/beams/USERNAME in the solution branch? diff --git a/scripts/quickstart.sh b/scripts/quickstart.sh index ec1bdd363eef5f263bf14f5209318f5d207411c9..05f43243fb4a47c16f291ce56ec40cd3cc129736 100755 --- a/scripts/quickstart.sh +++ b/scripts/quickstart.sh @@ -1,13 +1,8 @@ #!/bin/bash # -# Quickstart script for Practical Beamline Controls Training Session 2: IOC Deployment and Troubleshooting +# External quickstart script for Practical Beamline Controls Training Session 2: IOC Deployment and Troubleshooting # -EPICS_HOST_ARCH=`uname -r | sed -e 's/.*el\([6789]\).*/rhel\1-x86_64/g'` -# Alternate EPICS_HOST_ARCH approach: -#!RHEL_MAJOR_VERSION=`facter operatingsystemrelease | colrm 2` -#!EPICS_HOST_ARCH="rhel${RHEL_MAJOR_VERSION}-x86_64" - case ${SHELL} in *bash) @@ -16,32 +11,16 @@ case ${SHELL} in echo 'export EPICS_DIR=${HOME}/PET-S2/epics' echo 'export IOC_DIR=${EPICS_DIR}/synApps_6_2_1/ioc' echo 'export SUPPORT_DIR=${EPICS_DIR}/synApps_6_2_1/support' - echo "export EPICS_HOST_ARCH=${EPICS_HOST_ARCH}" - echo "unset EPICS_BASE" - echo "unset EPICS_CA_ADDR_LIST" - echo "unset EPICS_CA_AUTO_ADDR_LIST" - echo 'mkdir -p ${IOC_DIR} ${SUPPORT_DIR}' - echo 'tree ${EPICS_DIR}' - echo "" - ;; - - *tcsh) - echo "Run the following commands:" - echo "" - echo 'setenv EPICS_DIR ${HOME}/PET-S2/epics' - echo 'setenv IOC_DIR ${EPICS_DIR}/synApps_6_2_1/ioc' - echo 'setenv SUPPORT_DIR ${EPICS_DIR}/synApps_6_2_1/support' - echo "setenv EPICS_HOST_ARCH ${EPICS_HOST_ARCH}" - echo "unsetenv EPICS_BASE" - echo "unsetenv EPICS_CA_ADDR_LIST" - echo "unsetenv EPICS_CA_AUTO_ADDR_LIST" - echo 'mkdir -p ${IOC_DIR} ${SUPPORT_DIR}' - echo 'tree ${EPICS_DIR}' + echo "export EPICS_HOST_ARCH=linux-x86_64" + if ! command -v tree &> /dev/null + then + echo "tree() { find $1 -type d | grep -v git; }" + fi echo "" ;; *) - echo "Unsupported shell! Use bash or tcsh" + echo "Unsupported shell! Use bash" ;; esac diff --git a/scripts/training-synApps-config.txt b/scripts/training-synApps-config.txt new file mode 100644 index 0000000000000000000000000000000000000000..d3b5d6c5866025a70877aa4c72f50ed48dfc3eed --- /dev/null +++ b/scripts/training-synApps-config.txt @@ -0,0 +1,25 @@ +EPICS_BASE=/scratch/PET-S2/epics/base-7.0.7 + +HAVE_HIDAPI=NO +WITH_PVA=YES + +# The name of the synApps directory can be customized +SYNAPPS_DIR=synApps_6_2_1 + +SUPPORT=R6-2-1 +UTILS=R6-2-1 +DOCUMENTATION=R6-2-1 + +ASYN=R4-42 +AUTOSAVE=R5-10-2 +BUSY=R1-7-3 +CALC=R3-7-4 +IPAC=2.16 +LUA=R3-0-2 +MODBUS=R3-2 +SNCSEQ=2.2.9 +SSCAN=R2-11-5 +STD=R3-6-3 + +# HEAD revision of motor master branch: 34474ed958838ea5083f598fa4bd9f1ca7e1821c +MOTOR=master