Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: updated current version and some requirements

If you wish to build from source, the repo can be cloned with: git clone https://gerrit.oran-osc.org/r/ric-plt/lib/rmr After cloning, follow the instructions in the BUILD file. The most recent version will build as 13.3.0 .40 ( July 2019March 2020).


To align with standard practice regarding package names and contents, the build process will generate one of two possible package types:

...

Some developers may need to also include the underlying, external, transport libraries (e.g. libnng) in the package in order to make unit testing of wrappers (bindings) stand-alone. To do this, the CMake option -DPACK_EXTERNALS=1  should also be added to the CMake command line. (See the CMake examples paragraph later on this page.)

Coming Soon: Build On Mac OS

The reliance on the epoll family of functions to provide timeout support in RMR has been removed and RMR now supports the ability to be used on operating systems which do not support epoll (e.g. Mac OS).  The build process is the same, the operating system flavour will be detected during CMake configuration, however there are some limitations on Mac OS which cannot be worked round and affect one aspect of RMR functions: multi-threaded call support.

Build Requirements

RMR requires the following utilities/tools in order to build

  • cmake
  • gcc
  • g++ (for NNG)
  • git
  • make

NNG is referenced from within the repo as an external resource, and if not already installed on the system will be pulled and built.For the most part, the surpport for Mac OS is only to allow developers to easily test if they choose to us a non-Linux environment for development.  It is NOT recommended that RMR based applications be run on a Mac OS based system for production.

Configure and Build RMR

RMR is built via CMake which must first be executed to set the configuration options for the intended build. Specifically this allows the user to select the type of package to be produced (development or production), and to specify options such as where to install library and header files.  

...

  • the option to install the underlying transport libraries (e.g. NNG) along with the RMR libraries eliminates the need to install the transport libraries:
    -DPACK_EXTERNALS=1   
  • the option to install RMR, and transport libraries, into an alternate directory:
    -DCMAKE_INSTALL_PREFIX=/tmp/$LOGNAME/
    This will place libraries and header files into a directory based on the user name in /tmp (makes cleanup and/or complete removal much easier.
  • the option to generate headers and a development archive:
    -DDEV_PKG=1  
    This option will likely be required for C and Go developers as this causes the RMR header file (rmr.h) to be placed into the include directory. For Python programmers, it is likely that this option is not needed as the RMR bindings need to reference the shared object library (.so) which is not generated with this option. 
  • the option -DBUILD_DOC=1 will cause the RMR man pages to also be built.  If creating a package they will be installed in the usual system location, or will be left in the build directory in three forms:  postscript, TROFF input, and restructured text (rst).

Setting the environment variable LD_LIBRARY_PATH to reference either the standard library installation location, or the alternate path provided as in the previous example, will likely be necessary. For C progammers, the C_INCLUDE_PATH environment variable will also need to be set if an alternate install location was used (this may also apply to Go programmers).

...

Code Block
themeEmacs
titleCMake command examples
linenumberstrue
# configure and generate a production package
cmake ..
make package

# configure and generate a development package
cmake .. -DDEV_PKG=1
make package

# configure and install in an alternate directory, and install transport (nng) libraries
cmake .. -DEV_PKG=1 -DCMAKE_INSTALL_PREFIX=/tmp/$LOGNAME/ -DPACK_EXTERNALS
make install

# configure and install in the preferred system lib/include directory path; builds both package types
# (using sudo or switching to the root user might be needed if the install prefix was not changed to 
# a user writable directory.)
cmake .. -DDEV_PKG=1
make install
cmake .. 
make install

...

Before building a package, or installing, the unit tests can be executed to verify that the repo clone is intact and working on the system. Unit tests are located in the test directory and can be executed by running the unit_test.ksh script (requires Kshell).  On a Mac, the command line option -A must be added to force the unit tests to build without the epoll support/tests.   One of the tests requires about 30 seconds to execute (on some hardware), and certainly should complete in less than 60 seconds.  If a unit test hangs, it is likely a bug in the select/poll timeout tests which isn't timing out. If this occurs please open a bug report. ; originally the script required Kshell, and thus then suffix of .ksh. The script has been changed (March 2020) to remove the Ksh features which were used making it less efficient, but more generic with respect to shell choice. 


NNG Installation

When using RMR on top of NNG, the NNG libraries must also be installed on the system.  This can be accomplished by building and installing NNG independently, or configuring the RMR build process to install NNG in addition to RMR.  Adding the CMake option -DPACKAGE_EXTERNALS=1 to the configuration command line causes the NNG libraries to be packaged with RMR or installed when 'make install' is executed.