Navigation


Changes between Initial Version and Version 1 of Installation


Ignore:
Timestamp:
Feb 25, 2011, 7:11:04 PM (13 years ago)
Author:
Sebastien Decugis
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Installation

    v1 v1  
     1[[PageOutline(2-4)]]
     2= Installation =
     3
     4First, please check that your system meets the [wiki:Requirements] for freeDiameter.
     5
     6
     7== Installing from pre-compiled packages ==
     8
     9When available, this is the easy way to install {{{freeDiameter}}} framework on your machine, because it takes care of all the software dependencies for you.
     10
     11 * [wiki:DebRepository Debian and Ubuntu] packages information.
     12 * [wiki:FedRepository Fedora, CentOS, and RHEL] packages information.
     13 * [wiki:OWRTRepository OpenWRT] package information.
     14
     15
     16== Installing from source ==
     17
     18If there is no pre-compiled package for your platform, or if you need to change some compilation options, please follow these instructions.
     19
     20=== Obtaining the source code ===
     21
     22The recommended method is to use [http://mercurial.selenic.com/ Mercurial SCM] to retrieve the source code. This allows to update easily to latest development version, keep track of your changes, and so on.
     23
     24{{{
     25 # The first time, you need to clone the repository as follow:
     26$ hg clone http://www.freediameter.net/hg/freeDiameter
     27
     28 # Later when you want to retrieve the latest changes:
     29$ hg pull -u
     30}}}
     31
     32Alternatively, you can retrieve the source code by HTTP protocol as follow:
     33
     34 * Browse to [http://www.freediameter.net/hg/freeDiameter]
     35 * Select any revision in the ''changes'' or 'tags' lists (default is 'tip', the latest)
     36 * Then click on one of the 'bz2', 'zip', or 'gz' link at the top.
     37 * You can alternatively directly access the following URL to retrieve the most recent source: [http://www.freediameter.net/hg/freeDiameter/archive/tip.tar.gz].
     38
     39
     40=== Configuring the build === #cmakeflags
     41
     42This step is equivalent to the traditional ''./configure'' except that we use [http://www.cmake.org CMake] which provide much nicer interface. You will therefore need to install {{{cmake}}} if it is not yet available on your machine. Note that there are several nice Graphical User Interfaces available for CMake.
     43
     44It is highly recommended to build {{{freeDiameter}}} outside of the source repository.
     45{{{
     46$ mkdir fDbuild
     47$ cd fDbuild
     48$ cmake [CMAKE_OPTIONS] /path/to/freeDiameter/source
     49}}}
     50
     51Note that you can either specify the CMAKE_OPTIONS directly on the command line, or later by running:
     52{{{
     53$ cmake /path/to/freeDiameter/source
     54$ make edit_cache
     55}}}
     56
     57The following options are available when configuring {{{freeDiameter}}}:
     58
     59==== Parameters to control file paths ====
     60
     61 CMAKE_INSTALL_PREFIX::
     62   This is the default location where all freeDiameter files will be installed. Default is /usr/local. Overwrite on the command line with for example ''-DCMAKE_INSTALL_PREFIX:STRING=/usr''.
     63
     64 DEFAULT_CONF_PATH::
     65   This is the default directory where the {{{freeDiameter}}} framework will look for its configuration file, when specified as a relative file name. The default value is ${CMAKE_INSTALL_PREFIX}/etc/freeDiameter.
     66
     67 INSTALL_HEADERS_SUFFIX::
     68   Where the development header files are installed, relative to ${CMAKE_INSTALL_PREFIX}. The default is ''include/freeDiameter''.
     69
     70 INSTALL_DAEMON_SUFFIX::
     71   Where the binary executable files are installed, relative to ${CMAKE_INSTALL_PREFIX}. The default is ''bin''.
     72
     73 INSTALL_LIBRARY_SUFFIX::
     74   Where the {{{freeDiameter}}} framework libraries are installed, relative to ${CMAKE_INSTALL_PREFIX}. The default is ''lib''.
     75
     76 INSTALL_EXTENSIONS_SUFFIX::
     77   Where the {{{freeDiameter}}} extensions files are installed and searched at runtime, relative to ${CMAKE_INSTALL_PREFIX}. The default is ''${INSTALL_LIBRARY_SUFFIX}/freeDiameter''.
     78
     79
     80==== Parameters for dependencies ====
     81
     82It is possible to overwrite the default location for libraries and tools dependencies. We are not going to give an exhaustive list here, here are two examples:
     83
     84 Use an alternate GNUTLS library installed under ''/usr/local''::
     85   {{{
     86   -DGNUTLS_INCLUDE_DIR:PATH=/usr/local/include
     87   -DGCRYPT_INCLUDE_DIR:PATH=/usr/local/include
     88   -DGNUTLS_LIBRARY:FILEPATH=/usr/local/lib/libgnutls.so
     89   }}}
     90
     91 Use a different flex executable::
     92   {{{
     93   -DFLEX_EXECUTABLE:FILEPATH=/usr/local/bin/flex
     94   }}}   
     95
     96
     97==== Parameters to control the framework behavior ====
     98
     99 CMAKE_BUILD_TYPE::
     100   This is specifies a default set of flags that are used with the C compiler and linker. Valid build types are: "''Debug''", "''Profiling''", "''DebugValgrind''" (use to monitor execution with valgrind), "''DebianPackage''" (use for releases), and "''MaxPerformance''" (strips all debug support including error messages, use only for performance tests). The recommended build type for development is ''Debug''.
     101
     102 DISABLE_SCTP (BOOL)::
     103   Set this option to ON to strip all SCTP-related code from the framework. The default is OFF.
     104
     105 SCTP_USE_MAPPED_ADDRESSES (BOOL)::
     106   Previous implementations of the SCTP socket extensions did not have a proper handling of mixed IP and IPv6 situations. This parameter allows to pass all IP addresses in IPv6-mapped format, suppressing the problems. However, with recent implementations, having native IP format should not be an issue.
     107
     108 DIAMID_IDNA_IGNORE (BOOL), DIAMID_IDNA_REJECT (BOOL)::
     109   By default, the {{{freeDiameter}}} framework accepts Diameter Identities and Realms provided in native language (UTF-8 encoded), and process these according to the IDN transformation rules (stringprep) (you know, that xn--... thing). It allows to use IDN names in the configuration file. However, by specifying one of these options, you can change this behavior to either pass blindly (will send invalid AVPs in the network) or reject (the framework will terminate) any IDN. Either option removes the dependency of the framework on the GNU libidn library.
     110
     111
     112==== Parameters to control extensions build ====
     113
     114 ALL_EXTENSIONS (BOOL)::
     115   Set this value to ON in order to build all available extensions. You can always customize the extensions you will actually load in the framework configuration file. Beware however that some extensions may have additional requirements (such as database support) and the compilation time will increase when this option is set. When the option is not set, you can select/deselect the individual extensions with the next option:
     116
     117 BUILD_* (BOOL)::
     118   You can select the extensions individually with these options. For example, set BUILD_APP_ACCT:BOOL=ON in order to build the [wiki:app_acct.fdx] extension.
     119
     120
     121==== Parameters for debug / development only ====
     122
     123 DEBUG_SCTP (BOOL)::
     124   If SCTP is not disabled, set this option to turn on extra debug messages in SCTP code. Useful for debugging only.
     125
     126 ERRORS_ON_TODO (BOOL)::
     127   The TODO("...") macro is used in the code for incomplete features. Turn on this option to trig a compilation error wherever this macro appears, to find it easily (if you don't like ''grep'')
     128
     129 BUILD_TESTING (BOOL)::
     130   Set this value to ON in order to build the tests, then run with ''make test'' command.
     131
     132 TEST_TIMEOUT::
     133   If this value is set (to an integer), it overwrites the default timeout value for the tests. The default is 120 seconds.
     134
     135 TEST_APP_ACCT (BOOL)::
     136   If BUILD_TESTING and BUILD_APP_ACCT are true, this option can be selected to build the additional test for [wiki:app_acct.fdx]. This test requires a PostgreSQL environment installed, this is why it is separated. You also need to specify the TEST_APP_ACCT_CONNINFO variable to allow the test to access its database, as for example TEST_APP_ACCT_CONNINFO="host=localhost port=5432 dbname=acct user=acct".
     137
     138
     139=== Compiling ===
     140
     141Hopefully, once you have completed the ''cmake'' configuration, you only need to run:
     142{{{
     143$ make
     144}}}
     145
     146This will compile all source files and produce the binaries.
     147
     148If you want a more detailed output, you can also use:
     149{{{
     150$ make VERBOSE=1
     151}}}
     152
     153
     154=== Installing ===
     155
     156Once the compilation is complete, you can install in the configured paths with:
     157{{{
     158$ make install
     159}}}
     160(this might require ''sudo'' depending on the configured target directories)
     161
     162Please note that there is no ''make uninstall'' target generated by CMake. Refer to CMake documentation to find how to cleanly remove all that has been installed.
     163
     164Note that the framework can be run without installation, as long as the configuration file contains the full path to extensions that must be loaded.
     165
     166
     167---