blob: 64bd052b4f560a4f4f0689fbfd52764b010f4575 [file] [log] [blame]
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -04001#
2#==================================================================================
3# Copyright (c) 2019 Nokia
4# Copyright (c) 2018-2019 AT&T Intellectual Property.
5#
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#==================================================================================
18#
19
20
21Building RMr
22
23The RIC Message Router (RMr) is built with CMake, and requires
24a modern gcc compiler and make to be installed on the build
25system. Typically, installing the following list of packages
26in a container (Ubuntu) is all that is needed to craft a
27development environment (containerised builds are also the
28recommended approach):
29
30 gcc git make vim cmake g++ ksh bash
31
32Kshell and vi are needed only if you wish to use the container
33interactively. Bash is assumed necessary for CMake.
34
35
36Build process
37To build RMr, the usual CMake steps are followed:
38 mkdir build
39 cd build
40 cmake .. [options]
41 make package
42
43This will create a .deb (provided the system supports this) in
44the build directory. It's that simple.
45
46
47Alternatives
48To build in a non-Linux environment, or to build with an
49alternate install path (or both) read on.
50
51Instead of using 'make package' as listed above, using
52'make install' will build and install on the local system.
53By default, the target install is into /usr/local which may
54not be desired. To install into an alternate path add
55these two options when the 'cmake ..' command is given:
56
57 -DCMAKE_INSTALL_PREFIX=/path/to/dir
58 -DMAN_PREFIX=/path/to/dir
59
60
61The first will cause the make process to install into the named
62directory, which can be in your home directory. The second
63defines where manual pages are placed (if not defined
64/usr/share/man is the target). Manual pages are generally
65NOT built as the required tool has yet to be incorporated into
66the build process and generally is not available on most systems.
67
68
69Compiling and Linking
70Should the Rmr and NNG/Nano libraries be installed in a directory
71outside of the normal system spots (e.g. not in /usr/local)
72it might be necessary to define the specific directory for
73libraries (.e.g -L) on the command line, or via environment
74variables (e.g.. C_INCLUDE_PATH, LD_LIBRARY_PATH, LIBRARY_PATH).
75It may also be necessary to have the library directory defined
76in the environment at run time. It is difficult to know what
77each system needs, but the following linker ooptions work when
78libraries are installed in the system spots:
79
80 -lrmr_nng -lnng -lpthread
81
82Adding -L is one way to compensate when libraries are installed
83a different spot (e.g. in $HOME/usr):
84
85 -L $HOME/usr -lrmr_nng -lnng -lpthread
86
87
88Libraries
89RMr supports both NNG and Nanomsg as underlying transport. They
90are separate beasts, and while an NNG based programme can
91communicate with a Nanomsg based programme, their APIs are NOT
92compatible. For this reason, and others, RMr generates two
93libraries and requires that the underlying transport be selected
94at link time rather than run time. The RMr API for both underlying
95mechanisms is the same, so generating a NNG and Nanomsg version
96of a programme should require no extra work; other than adding
97a second link statement and giving it a different name.
98
99Nanomsg is on its way out with respect to community support. RMr
100will continue to support Nanomsg for a short period of time, but
101new programmes should NOT use Nanomsg.
102
103