Brian Waters | 13d9601 | 2017-12-08 16:53:31 -0600 | [diff] [blame] | 1 | See INSTALL file for general instructions on building freeDiameter. |
| 2 | |
| 3 | ------------------ |
| 4 | QUICK INSTRUCTIONS |
| 5 | ------------------ |
| 6 | |
| 7 | On FreeBSD-8.0 at least the following ports packages were required (should be same on FreeBSD-7.x): |
| 8 | cmake flex bison gnutls |
| 9 | |
| 10 | Then the cmake command had to look like: |
| 11 | cmake -DFLEX_EXECUTABLE:FILEPATH=/usr/local/bin/flex -DSCTP_USE_MAPPED_ADDRESSES:BOOL=ON ... |
| 12 | |
| 13 | |
| 14 | --------------------- |
| 15 | COMPLETE INSTRUCTIONS |
| 16 | --------------------- |
| 17 | |
| 18 | 1) If you don't have freeBSD yet: |
| 19 | Install minimal system + ports using initial installer /usr/sbin/sysinstall |
| 20 | |
| 21 | |
| 22 | 2) Install 'cmake' |
| 23 | |
| 24 | a) from sources: |
| 25 | # cd /usr/ports/devel/cmake |
| 26 | # make install |
| 27 | |
| 28 | b) or from package (don't forget to set your PACKAGEROOT appropriately. Ex: set PACKAGEROOT=ftp://ftp.jp.freebsd.org): |
| 29 | # pkg_add -v -r cmake |
| 30 | |
| 31 | |
| 32 | 3) Install 'mercurial' (optional) |
| 33 | (replace 'cmake' by 'mercurial' in the previous command) |
| 34 | |
| 35 | 4) Install 'flex' and 'bison', same way. |
| 36 | |
| 37 | 5) Install 'gnutls' and 'libidn', same way also. |
| 38 | |
| 39 | 6) Retrieve freeDiameter source code: |
| 40 | # cd ~ |
| 41 | # /usr/local/bin/hg clone http://www.freediameter.net/hg/freeDiameter/ |
| 42 | |
| 43 | 6b) Make a build directory |
| 44 | # mkdir fD-build |
| 45 | # cd fD-build |
| 46 | |
| 47 | 7) Run cmake for freeDiameter (add other flags as you see fit, see INSTALL for more details) |
| 48 | # /usr/local/bin/cmake -DFLEX_EXECUTABLE:FILEPATH=/usr/local/bin/flex -DSCTP_USE_MAPPED_ADDRESSES:BOOL=ON ../freeDiameter |
| 49 | |
| 50 | 8) Compile, optionnaly test |
| 51 | # make |
| 52 | # make test |
| 53 | |
| 54 | 9) Install |
| 55 | # make install |
| 56 | |
| 57 | 10) Run (the install path can be changed during cmake step): |
| 58 | # /usr/local/bin/freeDiameterd --help |
| 59 | |
| 60 | |
| 61 | ------------------------------ |
| 62 | app_acct test ADDITIONAL STEPS |
| 63 | ------------------------------ |
| 64 | Here is additional steps in order to run the test for app_acct |
| 65 | |
| 66 | 1) Install the required packages |
| 67 | # pkg_add -v -r postgresql84-client |
| 68 | # pkg_add -v -r postgresql84-server |
| 69 | |
| 70 | 2) Prepare access to the database: |
| 71 | # echo postgresql_enable=YES >> /etc/rc.conf |
| 72 | # /usr/local/etc/rc.d/postgresql initdb |
| 73 | # su - pgsql |
| 74 | > /usr/local/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start |
| 75 | > /usr/local/bin/createuser root |
| 76 | Shall the new user be allowed to create databases? (y/n) y |
| 77 | > logout |
| 78 | # /usr/local/bin/createdb root |
| 79 | # /usr/local/bin/psql root |
| 80 | root=# CREATE TABLE incoming_test ( |
| 81 | root(# recorded_on timestamp with time zone NOT NULL, |
| 82 | root(# "Accounting-Record-Type" integer, |
| 83 | root(# "Session-Id" bytea, |
| 84 | root(# "Accounting-Record-Number" integer, |
| 85 | root(# "Route-Record1" bytea, |
| 86 | root(# "Route-Record2" bytea, |
| 87 | root(# "Route-Record3" bytea, |
| 88 | root(# "Route-Record4" bytea ); |
| 89 | root=# \q |
| 90 | |
| 91 | 3) configure the sources |
| 92 | # make edit_cache |
| 93 | BUILD_APP_ACCT:BOOL=ON |
| 94 | TEST_APP_ACCT:BOOL=ON |
| 95 | TEST_APP_ACCT_CONNINFO:STRING="user=root dbname=root" |
| 96 | |
| 97 | 4) run the test |
| 98 | # tests/testappacct -d |
| 99 | or |
| 100 | # make test |
| 101 | |
| 102 | |
| 103 | ---------------------------------- |
| 104 | Segmentation fault on program exit |
| 105 | ---------------------------------- |
| 106 | |
| 107 | In case you encounter a segmentation fault on program termination like this: |
| 108 | [...] |
| 109 | freeDiameterd framework is terminated. |
| 110 | Segmentation fault: 11 (core dumped) |
| 111 | |
| 112 | with a backtrace like this: |
| 113 | #0 0x0000000801a414a0 in ?? () |
| 114 | #1 0x0000000800f99274 in __cxa_finalize () from /lib/libc.so.7 |
| 115 | #2 0x0000000800f460b7 in exit () from /lib/libc.so.7 |
| 116 | |
| 117 | You may try to add the following compilation directive in cmake: |
| 118 | -DSKIP_DLCLOSE:BOOL=ON |
| 119 | |
| 120 | Note: this segmentation fault was experienced with: |
| 121 | - FreeBSD 8.1 |
| 122 | - 64 bits architecture only. |
| 123 | - Profiling mode only. |
| 124 | |
| 125 | |