Building from Source

Begin be fetching all needed source.

git clone --recursive
git clone --branch 7.0

Prepare the PVXS source tree:

cat <<EOF > pvxs/configure/RELEASE.local

Build Base:

make -C epics-base

Install or build libevent >=2.0

On RHEL7 and later.

yum install libevent-devel

On RHEL6 and earlier.

yum install libevent2-devel

On Debian/Ubuntu.

apt-get install libevent-dev

To build from source (Requires CMake):

make -C pvxs/bundle libevent # implies .$(EPICS_HOST_ARCH)

For additional archs: eg.

make -C pvxs/bundle libevent.linux-x86_64-debug

Build PVXS:

make -C pvxs

Running Tests

It is recommended to run automatic unittests when building a new (to you) version of PVXS, or building on a new host.

make -C pvxs runtests

Cross-compiling libevent2

The bundled libevent may be built for some cross compile targets. Currently only cross mingw.

make -C pvxs/bundle

Including PVXS in your application

Including PVXS in an application/IOC using the EPICS Makefiles is straightforward. Add PVXS to the application configure/RELEASE or RELEASE.local file.

cat <<EOF >> configure/RELEASE.local

Then add the pvxs and pvxsIoc libraries as a dependencies to your IOC or support module. eg.

PROD_IOC += myioc
myioc_DBD += pvxsIoc.dbd
myioc_LIBS += pvxsIoc pvxs

The “pvxsIoc” library should only be included for IOCs. It can, and should, be omitted for standalone applications (eg. GUI clients).

Add the pvxs library as a dependency to your executable or library. eg.

PROD_IOC += myapp
myapp_LIBS += pvxs
myapp_LIBS += Com

libevent will be automatically added for linking.

For those interested, this is accomplished with the logic found in “cfg/CONFIG_PVXS_MODULE”.