Project

General

Profile

Build from Source » History » Version 6

neels, 11/15/2016 05:06 PM

1 1 neels
{{>toc}}
2
3
h1. Build from Source
4
5
bq. *Before you consider building from source, be aware that there are [[Nightly Builds]]
6
available for Debian + Ubuntu platforms. These are recommended for normal users.*
7
8 5 neels
Osmocom projects use autoconf/automake.
9 2 neels
The general pattern for building is:
10 1 neels
11
<pre>
12
cd source-tree
13
autoreconf -fi
14
./configure
15
make
16
make check
17
make install
18
</pre>
19
20 3 neels
The @./configure@ step may need further configuration options, and
21
@./configure@ will tell you which dependencies are still missing, if any.
22
See below for project specific details and troubleshooting.
23 1 neels
24 6 neels
The @make@ step may be sped up by using multiple CPU cores:
25 1 neels
26
<pre>
27
make -j 8
28
</pre>
29
30
We take care to make our builds parallelizable with @-j@, but in case
31
@make -j@ fails, issuing a simple @make@ could fix the problem (expecting
32
this only in libsmpp34).
33
34
35
h1. Dependencies
36
37
Which libraries are needed by various Osmocom programs is best resolved during
38
the @./configure@ step described below. This script checks for any missing
39 6 neels
dependencies and issues corresponding error messages.
40 1 neels
41
Here is a (probably incomplete) overview of dependencies between Osmocom
42
projects:
43
44
| _To build ..._ | _... you also need ..._ |
45
| osmo-bts | libosmocore, libosmo-abis, openbsc (source tree only), L1 headers depending on BTS model |
46
| osmo-pcu | libosmocore, L1 headers depending on BTS model |
47
| openbsc: osmo-nitb, osmo-bsc, osmo-sgsn, osmo-bsc_nat, osmo-bsc_mgcp | libosmocore, libosmo-abis, libosmo-netif, libosmo-sccp, libsmpp34 |
48
| openbsc: 3G osmo-cscn (branch sysmocom/iu) | libosmocore, libosmo-abis, libosmo-netif (branch sysmocom/sctp), libosmo-sccp (branch sysmocom/iu), asn1c, libasn1c, osmo-iuh |
49
| osmo-iuh | libosmocore, libosmo-netif, libosmo-sccp, asn1c, libasn1c |
50
51
h1. Download Sources
52
53 3 neels
The latest Osmocom sources are available from git at https://git.osmocom.org,
54
where each project's overview page displays the actual git URL.
55
56 1 neels
The projects' repository URLs generally are of the pattern:
57 3 neels
<pre>git://git.osmocom.org/project-name</pre>
58 6 neels
(To contribute, see [[Coding Standards#Submitting-Patches|Submitting Patches]])
59 3 neels
60
For example, to verify libosmocore's git repository URL, browse to
61 1 neels
https://git.osmocom.org/libosmocore/ and observe the URL shown at the
62 3 neels
bottom of the page under _Clone_: @git://git.osmocom.org/libosmocore@
63
64 6 neels
Then download this URL using the @git@ client:
65 3 neels
66 1 neels
<pre>
67
git clone git://git.osmocom.org/libosmocore
68
</pre>
69
70 6 neels
It is also possible to download specific releases' tarballs for each git ref
71
that is defined. For example, browse to https://git.osmocom.org/libosmocore/,
72
click on _refs_ on the top and select any branch or tag, e.g. "0.9.0":https://git.osmocom.org/libosmocore/tag/?h=0.9.0
73
74
All of these download instructions hold true for any of the git repositories
75
besides libosmocore.
76
77
78
h1. Details and Troubleshooting
79
80
Here is a list of the most common configuration items or pitfalls to be
81
aware of when building specific Osmocom projects.
82
83
h2. Non-GNU Systems
84
85
On systems like FreeBSD, you need to run @gmake@ instead of @make@.
86
87
h2. General ./configure options
88
89
To provide the installation location, which is /usr/local by default:
90
<pre>
91
./configure --prefix=$HOME/my_osmocom_inst
92
</pre>
93
94
If you choose a non-standard location, later builds may fail to find it.
95
For example, if you built libosmocore with a custom prefix, a subsequent
96
build of libosmo-abis, which needs libosmocore installed, may fail.
97
You can tell a build process where to look for libraries to compile against
98
using the @PKG_CONFIG_PATH@ environment variable.
99
100
Furthermore, when you want to run binaries compiled against libraries
101
installed in a non-standard location, you will have to use the
102
@LD_LIBRARY_PATH@ environment variable to successfully load the binary.
103
Particularly, the @make check@ step typically runs such binaries,
104
as well as when you would like to run the installed binaries yourself.
105
106
For example:
107
108
<pre>
109
mkdir -p $HOME/osmo/src
110
cd $HOME/osmo/src
111
git clone git://git.osmocom.org/libosmocore
112
cd libosmocore
113
autoreconf -fi
114
./configure --prefix=$HOME/osmo/inst --disable-pcsc
115
make -j5
116
</pre>
117
118
h2. libosmocore
119
120
When @libpcsclite@ is not easily available, e.g. when building for a BTS target platform:
121
<pre>
122
./configure --disable-pcsc
123
</pre>
124
125
h1. Example: build openbsc
126
127
h1. Example: build script
Add picture from clipboard (Maximum size: 48.8 MB)