EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Gateway binary distribution available for RedHat 5.5
From: Martin Konrad <[email protected]>
To: [email protected]
Cc: [email protected]
Date: Wed, 23 Nov 2011 20:09:02 +0100
Hi Emmanuel,
> I would like to install EPICS gateway and I’m wondering if I can find
> the binary distribution? Does anyone has RPM packages or binary files
> availalbe?
It's easy to generate them if you use CMake to build cagateway. Some
weeks ago I posted the necessary rules for CMake
(http://www.aps.anl.gov/epics/tech-talk/2011/msg01717.php) but it seems
they did not made it into the tarball yet.

@Ralph: What's the status with that?

Simply give it a try (copy the files into the top directory of gateway
and follow the rules in README.CMake). I'm very interested in people
testing this stuff ;-)

Cheers

Martin

P.S.: I attached the files again because the list archive seems to drop
the filenames and prints everything without any spacing between the
files. In addition to that a small bug has been fixed since then...

-- 
Dipl. Phys. Martin Konrad
Technische Universität Darmstadt
Institut für Kernphysik
Schlossgartenstr. 9
64289 Darmstadt
Tel.: +49-6151-16-5121
Fax: +49-6151-16-4321
# Martin Konrad <[email protected]>
# License: GPLv2/v3
#
# Try to find libpcre (Perl Compatible Regular Expressions)
#
# Once done this will define
#
# PCRE_FOUND - system has libpcre
# PCRE_INCLUDE_DIR - the libpcre include directory
# PCRE_LIBRARY - where to find libpcre
# PCRE_LIBRARIES - Link these to use libpcre

if(PCRE_INCLUDE_DIR AND PCRE_LIBRARIES)
	# in cache already
	set(PCRE_FOUND TRUE)
else(PCRE_INCLUDE_DIR AND PCRE_LIBRARIES)
	if(NOT WIN32)
		# use pkg-config to get the directories and then use these values
		# in the FIND_PATH() and FIND_LIBRARY() calls
		find_package(PkgConfig)
		pkg_check_modules(PC_PCRE libpcre)
	endif(NOT WIN32)

	find_path(PCRE_INCLUDE_DIR
		NAMES
			pcre.h
		HINTS
			${PCRE_PKG_INCLUDE_DIRS}
		PATHS
			/usr/include
			/usr/local/include
	)

	find_library(PCRE_LIBRARY
		NAMES
			pcre
		HINTS
			${PCRE_PKG_LIBRARY_DIRS}
		PATHS
			/usr/lib
			/usr/local/lib
	)

	set(PCRE_LIBRARIES ${PCRE_LIBRARY})

	# handle the QUIETLY AND REQUIRED arguments AND set PCRE_FOUND to TRUE if
	# all listed variables are TRUE
	# include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
	include(FindPackageHandleStandardArgs)
	find_package_handle_standard_args(PCRE DEFAULT_MSG PCRE_LIBRARY PCRE_INCLUDE_DIR)

	mark_as_advanced(PCRE_INCLUDE_DIR PCRE_LIBRARY)
endif(PCRE_INCLUDE_DIR AND PCRE_LIBRARIES)
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(epics-cagateway)

set(VERSION_MAJOR 2)
set(VERSION_MINOR 0)
set(VERSION_MAINTENANCE 4)
set(VERSION_BUILD 0)
set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MAINTENANCE}.${VERSION_BUILD}")

set(gateway_SRCS
	gateway.cc
	gateAsCa.cc
	gateAs.cc
	gateAsyncIO.cc
	gatePv.cc
	gateResources.cc
	gateServer.cc
	gateStat.cc
	gateVc.cc
)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}")
find_package(EPICS REQUIRED ca cas asHost gdd Com)
include_directories(${EPICS_INCLUDE_DIRS})
set(CMAKE_CXX_FLAGS "-Dlinux -O3 -Wall")

option(NODEBUG "Turn off Gateway debug calls" OFF)
if(NODEBUG)
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNODEBUG")
endif(NODEBUG)

option(STAT_PVS "Use status PVs" ON)
if(STAT_PVS)
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTAT_PVS")
endif(STAT_PVS)

option(RATE_STATS "Use rate statistics" ON)
if(RATE_STATS)
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DRATE_STATS")
endif(RATE_STATS)

option(CONTROL_PVS "Use control PV's" ON)
if(CONTROL_PVS)
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCONTROL_PVS")
endif(CONTROL_PVS)

option(HEARTBEAT_PV "Use heartbeat PV" OFF)
if(HEARTBEAT_PV)
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHEARTBEAT_PV")
endif(HEARTBEAT_PV)

option(CAS_DIAGNOSTICS "Use CAS diagnostics statistics" ON)
if(CAS_DIAGNOSTICS)
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCAS_DIAGNOSTICS")
endif(CAS_DIAGNOSTICS)

option(HANDLE_EXCEPTIONS "Install exception handler and print exceptions to log file" ON)
if(CAS_DIAGNOSTICS)
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCAS_DIAGNOSTICS")
endif(CAS_DIAGNOSTICS)

option(USE_DENYFROM "Use deny from" YES)
if(USE_DENYFROM)
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_DENYFROM")
endif(USE_DENYFROM)

option(USE_NEG_REGEXP "Use neg regexp" ON)
if(USE_NEG_REGEXP)
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_NEG_REGEXP")
endif(USE_NEG_REGEXP)

option(USE_PCRE "Use Perl compatible regular expressions" OFF)
if(USE_PCRE)
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_PCRE")
	find_package(PCRE REQUIRED)
endif(USE_PCRE)

add_executable(gateway ${gateway_SRCS})
target_link_libraries(gateway ${EPICS_Com_LIBRARY} ${EPICS_HOST_LIBRARIES} ${EPICS_ca_LIBRARY} ${EPICS_asHost_LIBRARY} ${EPICS_cas_LIBRARY} ${EPICS_gdd_LIBRARY} ${PCRE_LIBRARIES})

# Package information
set(CPACK_PACKAGE_VERSION             ${VERSION_STRING})
set(CPACK_PACKAGE_CONTACT             "Martin Konrad <[email protected]>")
set(CPACK_PACKAGE_DESCRIPTION         "Channel access gateway for EPICS\n The Experimental Physics and Industrial Control System is a collection of tools, libraries and applications for creating a distributed soft real-time control system.\n .\n This package provides the EPICS channel access gateway. It acts as a kind of proxy for channel access and therefore allows clients to access IOCs in other subnets. In addition to that it provides channel access security.")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE     "http://www.aps.anl.gov/epics/extensions/gateway/";)
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION  ${CPACK_PACKAGE_DESCRIPTION})
set(CPACK_DEBIAN_PACKAGE_DEPENDS      "libepics3.14.11 (>=3.14.11)")
if(USE_PCRE)
	set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libpcre3")
endif(USE_PCRE)

# Package settings
if(${UNIX})
  set(CPACK_GENERATOR                 "DEB;RPM")
  set(CPACK_CMAKE_GENERATOR           "Unix Makefiles")
  set(CPACK_PACKAGE_NAME              ${PROJECT_NAME})
  set(CPACK_PACKAGE_FILE_NAME         ${PROJECT_NAME}-${VERSION_STRING}${PACK_ARCH})
endif(${UNIX})

install(TARGETS gateway DESTINATION bin)
install(DIRECTORY docs/ DESTINATION share/doc/${PROJECT_NAME} PATTERN ".svn" EXCLUDE)

include(CPack)
# Find EPICS
#
# Use as:
#  FIND_PACKAGE(EPICS REQUIRED)
#
# To use a local version first set:
#  SET(CMAKE_MODULE_PATH "/somedir/epics/cmake")
#
# Creates variables:
#  EPICS_BASE           - Location
#
#  EPICS_FOUND          - Where all components found?
#  EPICS_INCLUDE_DIRS   - CPP search path (global and OS)
#
#  EPICS_Com_LIBRARIES  - libCom and dependencies
#  EPICS_*_LIBRARY      - Individual libs w/o dependencies
#  EPICS_HOST_LIBRARIES - All *Host libraries and cas/gdd
#  EPICS_IOC_LIBRARIES  - All *Ioc libraries
#
#  EPICS_INCLUDE_DIR
#  EPICS_OS_INCLUDE_DIR
#

# EPICS OS classes
#     AIX cygwin32 Darwin freebsd
#     hpux interix Linux osf RTEMS
#     solaris vxWorks WIN32

set(_EPICS_ALL_LIBS
  cas gdd asHost dbStaticHost registryIoc
  recIoc softDevIoc miscIoc rsrvIoc dbtoolsIoc asIoc
  dbIoc registryIoc dbStaticIoc ca Com
)

find_package(EPICSArch)

include(FindPackageHandleStandardArgs)

find_path(EPICS_BASE
  NAMES include/epicsVersion.h
        dbd/base.dbd
  PATHS /usr/lib/epics
        /opt/epics/current
  DOC "Location of EPICS Base"
)

if(NOT EPICS_BASE)
  if(EPICS_FIND_REQUIRED)
    message(FATAL_ERROR "Failed to find EPICS Base location")
  endif(EPICS_FIND_REQUIRED)
endif(NOT EPICS_BASE)

find_path(EPICS_INCLUDE_DIR epicsVersion.h
  PATHS ${EPICS_BASE}/include
  DOC "EPICS include dir"
  NO_DEFAULT_PATH
)

if(EPICS_INCLUDE_DIR)

  find_path(EPICS_OS_INCLUDE_DIR
    NAMES epicsMath.h osdTime.h osiUnistd.h
    PATHS ${EPICS_INCLUDE_DIR}/os/
    PATH_SUFFIXES ${OS_CLASS}
    DOC "EPICS OSD include dir"
    NO_DEFAULT_PATH
  )

  if(EPICS_OS_INCLUDE_DIR)
    SET(EPICS_INCLUDE_DIRS
      ${EPICS_INCLUDE_DIR}
      ${EPICS_OS_INCLUDE_DIR}
    )

  endif(EPICS_OS_INCLUDE_DIR)

endif(EPICS_INCLUDE_DIR)

if(EPICS_INCLUDE_DIR AND EPICS_OS_INCLUDE_DIR)

  foreach(COMP ${_EPICS_ALL_LIBS})
    find_library(EPICS_${COMP}_LIBRARY ${COMP}
      PATHS ${EPICS_BASE}/lib
      PATH_SUFFIXES ${T_A}
      NO_DEFAULT_PATH
      DOC "Location of the EPICS ${COMP} library"
    )

  endforeach(COMP)

endif(EPICS_INCLUDE_DIR AND EPICS_OS_INCLUDE_DIR)

# Ensure all components are present if needed
# When find_package() is invoked with REQUIRED
# ensure that all of the following are set
find_package_handle_standard_args(EPICS DEFAULT_MSG
  EPICS_BASE
  EPICS_INCLUDE_DIR EPICS_OS_INCLUDE_DIR
  EPICS_Com_LIBRARY
  EPICS_ca_LIBRARY
  EPICS_cas_LIBRARY
  EPICS_gdd_LIBRARY
  EPICS_asHost_LIBRARY
  EPICS_dbStaticHost_LIBRARY
  EPICS_registryIoc_LIBRARY
  EPICS_recIoc_LIBRARY
  EPICS_softDevIoc_LIBRARY
  EPICS_miscIoc_LIBRARY
  EPICS_rsrvIoc_LIBRARY
  EPICS_dbtoolsIoc_LIBRARY
  EPICS_asIoc_LIBRARY
  EPICS_dbIoc_LIBRARY
  EPICS_registryIoc_LIBRARY
  EPICS_dbStaticIoc_LIBRARY
)

set(EPICS_Com_LIBRARIES ${EPICS_Com_LIBRARY})

#TODO: error checking below

if(NOT RTEMS)
  find_package(Threads REQUIRED)
  list(APPEND EPICS_Com_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
endif(NOT RTEMS)

if(UNIX AND NOT RTEMS)
  find_library(LIBRT rt)
  find_library(LIBDL dl)
  list(APPEND EPICS_Com_LIBRARIES ${LIBRT} ${LIBDL})
endif(UNIX AND NOT RTEMS)

if(RTEMS)
  find_library(RTEMSCPU rtemscpu)
  find_library(RTEMSNFS nfs)
  list(APPEND EPICS_Com_LIBRARIES ${RTEMSCPU} ${RTEMSNFS})
  if(RTEMS_NEED_BSPEXT)
    find_library(BSPEXT bspExt)
    list(APPEND EPICS_Com_LIBRARIES ${BSPEXT})
  endif(RTEMS_NEED_BSPEXT)
endif(RTEMS)

# Libraries needed to build an IOC
set(EPICS_BASE_IOC_LIBS
  ${EPICS_recIoc_LIBRARY}
  ${EPICS_softDevIoc_LIBRARY}
  ${EPICS_miscIoc_LIBRARY}
  ${EPICS_rsrvIoc_LIBRARY}
  ${EPICS_dbtoolsIoc_LIBRARY}
  ${EPICS_asIoc_LIBRARY}
  ${EPICS_dbIoc_LIBRARY}
  ${EPICS_registryIoc_LIBRARY}
  ${EPICS_dbStaticIoc_LIBRARY}
  ${EPICS_ca_LIBRARY}
  ${EPICS_Com_LIBRARIES}
)

set(EPICS_INSTALL_BIN "bin/${T_A}" CACHE FILEPATH "Location for installed binaries")
set(EPICS_INSTALL_LIB "lib/${T_A}" CACHE FILEPATH "Location for all libraries")
set(EPICS_INSTALL_INCLUDE "include" CACHE FILEPATH "Location for C/C++ headers")
set(EPICS_INSTALL_INCLUDE_OS "include/os/${OS_CLASS}" CACHE FILEPATH "Location for OSD C/C++ Headers")
set(EPICS_INSTALL_DBD "dbd" CACHE FILEPATH "Location for EPICS DBD files")
set(EPICS_INSTALL_DB "db" CACHE FILEPATH "Location for EPICS DB files")

mark_as_advanced(
  EPICS_BIN_DIR EPICS_LIB_DIR
  EPICS_INCLUDE_DIR EPICS_OS_INCLUDE_DIR
  EPICS_DBD_DIR EPICS_DB_DIR
  EPICS_CMAKE_DIR
)
# Determine EPICS Arch and OS Class
#
# Use as:
#  find_package(EPICSArch)
#
# Creates variables:
#  T_A        - Target Archetecture
#  OS_CLASS   - Primary (first) OSI system class
#  OS_CLASSES - List of all OSI classes
#  IOC        - True if target can build IOC things
#  HOST       - True if target can build Host things
#

include(FindPackageMessage)

if(UNIX)
  if(CMAKE_SYSTEM_NAME MATCHES Linux)
    set(HOST 1)
    set(IOC 1)
    set(OS_CLASS Linux)
    set(OS_CLASSES Linux posix default)
    if(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
      set(T_A "linux-x86")
    elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^x86_64$")
      set(T_A "linux-x86_64")
    elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^powerpc")
      set(T_A "linux-ppc")
    else(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
      message(FATAL_ERROR "Unknown Linux Variant: ${CMAKE_SYSTEM_PROCESSOR}")
    endif(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")

  elseif(RTEMS)
    set(HOST 0)
    set(IOC 1)
    set(OS_CLASS RTEMS)
    set(OS_CLASSES RTEMS posix default)
    set(T_A "RTEMS-${RTEMS_BSP}")

  else(CMAKE_SYSTEM_NAME MATCHES Linux)
    message(FATAL_ERROR "Unknown *nix Variant: ${CMAKE_SYSTEM_NAME}")
  endif(CMAKE_SYSTEM_NAME MATCHES Linux)

elseif(WIN32)
  set(HOST 1)
  set(IOC 1)
  set(OS_CLASS WIN32)
  set(OS_CLASSES WIN32 default)
  if(MINGW)
    set(T_A "win32-x86-mingw")
  elseif(CYGWIN)
    set(T_A "win32-x86-cygwin")
  elseif(MSVC)
    set(T_A "win32-x86")
  elseif(BORLAND)
    set(T_A "win32-x86-borland")
  else(MINGW)
    message(FATAL_ERROR "Unknown Windows variant")
  endif(MINGW)

else(UNIX)
  message(FATAL_ERROR "Unable to determine EPICS OS class")
endif(UNIX)

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
  set(T_A "${T_A}-debug")
endif(CMAKE_BUILD_TYPE STREQUAL "Debug")

find_package_message(EPICSArch
   "EPICS Target: ${T_A} (${OS_CLASS})"
   "[${T_A}][${OS_CLASS}]"
)

Replies:
Re: Gateway patches (CMake) Ralph Lange
References:
Gateway binary distribution available for RedHat 5.5 ZYCHLA Emmanuel

Navigate by Date:
Prev: Re: Writing long strings PV in BOY John Hammonds
Next: RE: Writing long strings PV in BOY Chen, Xihui
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Gateway binary distribution available for RedHat 5.5 ZYCHLA Emmanuel
Next: Re: Gateway patches (CMake) Ralph Lange
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·