Basic EPICS installation on Linux Mint


Coming back to work with EPICS after some time away, I’ve found that it took me a while to even remember how to install it.  Some of the instructions I’ve posted in previous articles have gone out of date a little, and so it’s time for an update.

Although the most recent EPICS version is 3.16, there are still a few packages that don’t work with that version, so I will install the latest in the 3.15 branch.

I am working with Linux Mint 18.2.

Get the source

cd ~/Downloads
wget https://www.aps.anl.gov/epics/download/base/base-3.15.5.tar.gz
wget https://www.aps.anl.gov/epics/download/modules/asyn4-32.tar.gz

Unpack

We need somewhere to work.

mkdir -p ~/Apps/epics/modules

Now unpack the source into our working space.

tar -zxvf ~/Downloads/base-3.15.5.tar.gz -C ~/Apps/epics/
tar -zxvf ~/Downloads/asyn4-32.tar.gz -C ~/Apps/epics/modules

To make things a little easier for us, we make the following soft-links.

cd ~/Apps/epics
ln -s base-3.15.5 base
cd modules
ln -s asyn4-32 asyn
sudo ln -s $HOME/Apps/epics /usr/local/

Lastly, install a few packages needed to compile EPICS.

sudo apt install libreadline-dev build-essential

Compile EPICS Base

To compile, we have to make sure the environment is set up correctly, so add the following to your ~/.bash_aliases file.

export EPICS_ROOT=/usr/local/epics
export EPICS_BASE=${EPICS_ROOT}/base
export EPICS_HOST_ARCH=`${EPICS_BASE}/startup/EpicsHostArch`
export EPICS_BASE_BIN=${EPICS_BASE}/bin/${EPICS_HOST_ARCH}
export EPICS_BASE_LIB=${EPICS_BASE}/lib/${EPICS_HOST_ARCH}
if [ "" = "${LD_LIBRARY_PATH}" ]; then
 export LD_LIBRARY_PATH=${EPICS_BASE_LIB}
else
 export LD_LIBRARY_PATH=${EPICS_BASE_LIB}:${LD_LIBRARY_PATH}
fi
export PATH=${PATH}:${EPICS_BASE_BIN}

Once you’ve done that, then make sure to ensure that these variables are exported to your environment by sourcing that file, or by opening a new terminal.

Now you’re ready to compile.

cd ~/Apps/epics/base
make

Compile ASYN

The ASYN configuration needs to be matched to our system.

cd ~/Apps/epics/modules/asyn

Then edit the following values in the file configuration/RELEASE:

SUPPORT=/home/<your username>/Apps/epics/modules
EPICS_BASE=/usr/local/epics/base

Comment out the IPAC and SNCSEQ lines.

Now, in the same directory, compile the code.

cd ~/Apps/epics/modules/asyn
make

Testing

cd ~/Apps/epics/
mkdir testing
cd testing
makeBaseApp.pl -t example a_test
makeBaseApp.pl -i -t example a_test

This last command will ask you for an Application name, but just leave this blank and hit <Enter>.

Now compile and run your test IOC

make
cd iocBoot/ioca_test/
chmod +x st.cmd
./st.cmd

From another terminal, check to see if you can see the EPICS PV’s.

camonitor $USER:aiExample

If you see the PV reporting back a change in value, along with an alarm status for many of those values, then your EPICS installation was successful!


Leave a comment

One thought on “Basic EPICS installation on Linux Mint