Project

General

Profile

Installation » History » Version 35

Tony Ciavarella, 02/22/2013 03:18 AM

1 1 Tony Ciavarella
h1. Installation
2
3 5 Tony Ciavarella
h2. Obtaining the Source Code
4 1 Tony Ciavarella
5 2 Tony Ciavarella
h3. Release Tarballs
6
7 4 Tony Ciavarella
Release source tarballs are available on the "Files":http://oss.squalllinesoftware.com/projects/disorder/files page.  This is what you want if you are looking for stability and something ready for production use.  You'll probably want to use the most recent version found on that page.
8 2 Tony Ciavarella
9
h3. SCM
10
11 4 Tony Ciavarella
The Disorder source code is hosted in a "Bazaar":http://bazaar.canonical.com repository.  This is what you want if you are looking for the very latest bleeding edge of the code for contributing to Disorder or whatever other reason you may have.
12 2 Tony Ciavarella
13 27 Tony Ciavarella
Read the "Bazaar Documentation":http://doc.bazaar.canonical.com/en/ if you aren't familiar with that and you want to go this route.
14
15 2 Tony Ciavarella
To get a lightweight checkout of the latest version without all the history (not suitable for Disorder development):
16 25 Tony Ciavarella
<pre>bzr co --lightweight bzr://bzr.squalllinesoftware.com/disorder</pre>
17 2 Tony Ciavarella
18 31 Tony Ciavarella
To clone the repository including the full history (suitable for Disorder development):
19 25 Tony Ciavarella
<pre>bzr branch bzr://bzr.squalllinesoftware.com/disorder</pre>
20 2 Tony Ciavarella
21 1 Tony Ciavarella
h2. Prerequisites
22
23
The following third party things are required to use Disorder:
24 6 Tony Ciavarella
* "Boost":http://www.boost.org >= 1.49.0
25 8 Tony Ciavarella
* "Eigen":http://eigen.tuxfamily.org >= 3.0.5
26 7 Tony Ciavarella
* C++ version of the "SEDRIS SRM":http://www.sedris.org/srm_4.4/srm_c_cpp.htm >= 4.4.0 (optional but you will need some kind of sophisticated geospatial library)
27 1 Tony Ciavarella
* A "Python":http://www.python.org interpreter (needed to use the "waf":https://code.google.com/p/waf/ build system)
28
29 13 Tony Ciavarella
Build and install these things in accordance with the instructions for your operating system provided by each vendor.  Some hints for certain platforms follow.
30 1 Tony Ciavarella
31 8 Tony Ciavarella
h3. Debian Linux and Derivatives
32
33 13 Tony Ciavarella
Pat yourself on the back for using a good operating system.  All the dependencies are available via the package system.  To install the Boost and Eigen build dependencies on Debian and maybe other derivatives:
34 8 Tony Ciavarella
<pre>sudo apt-get install libboost-dev libboost-system-dev libboost-thread-dev libboost-date-time-dev libeigen3-dev</pre>
35 1 Tony Ciavarella
36
If you don't already have python, this will get the required bits of that:
37
<pre>sudo apt-get install python</pre>
38 13 Tony Ciavarella
39 33 Tony Ciavarella
h3. Sabayon Linux
40
41
Pat yourself on the back for using a good operating system.  To install boost via the entropy package system:
42
<pre>sudo equo install boost</pre>
43
44
As of 2/22/2013, the Eigen verison in entropy is a bit outdated (3.0.6).  You can use it, but you probably should download the latest version from "Eigen":http://eigen.tuxfamily.org which doesn't require any compilation.  Just extract the content of the archive somewhere and remember to tell Disorder where to find it with <pre>--eigen-root=<put actual path to eigen root here></pre> during the configuration step.
45
46 35 Tony Ciavarella
If you don't already have python, this will get the required bits of that: <pre>sudo equo install python</pre>
47 34 Tony Ciavarella
48 13 Tony Ciavarella
h2. Configuration
49
50
If everything is setup properly, this step will be a breeze, but it is important to resolve any errors produced by the configuration step prior to attempting to compile Disorder.
51
52 15 Tony Ciavarella
h3. Linux
53 13 Tony Ciavarella
54
From inside the root of the Disorder tree do this in your favorite terminal emulator:
55
<pre>./waf configure --sedris-srm-root=<put the path to the SEDRIS SRM root here></pre>
56
For example, if your SEDRIS SRM is in /opt/sedris/srm:
57
<pre>./waf configure --sedris-srm-root=/opt/sedris/srm</pre>
58
59
That command will take several seconds and print a bunch of hopefully green stuff.  The output should end up looking something like this:
60
<pre>
61
Setting top to                           : /opt/disorder 
62
Setting out to                           : /opt/disorder/bin 
63
Checking for 'g++' (c++ compiler)        : /usr/bin/g++ 
64
Checking for program doxygen             : /usr/bin/doxygen 
65
Checking for program tar                 : /bin/tar 
66
Checking boost ABI tag                   :  
67
Checking boost includes                  : 1_49 
68
Checking boost libs                      : ok 
69
Checking for boost linkage               : ok 
70
Checking for header boost/asio.hpp       : yes 
71
Checking for header boost/bind.hpp       : yes 
72
Checking for header boost/date_time.hpp  : yes 
73
Checking for header boost/detail/endian.hpp : yes 
74
Checking for header boost/format.hpp        : yes 
75
Checking for header boost/function.hpp      : yes 
76
Checking for header boost/functional/factory.hpp : yes 
77
Checking for header boost/ptr_container/ptr_vector.hpp : yes 
78
Checking for header boost/scoped_ptr.hpp               : yes 
79
Checking for header boost/static_assert.hpp            : yes 
80
Checking for header boost/thread.hpp                   : yes 
81
Checking for program pkg-config                        : /usr/bin/pkg-config 
82
Checking for 'eigen3'                                  : yes 
83
Checking for header Eigen/Dense                        : yes 
84
Checking for SEDRIS SRM                                : /opt/sedris/srm 
85
Checking for SEDRIS SRM include directory              : /opt/sedris/srm/src/include 
86
Checking for SEDRIS SRM library directory              : /opt/sedris/srm/lib/linux-3.1.0-1-amd64-i386-gnu-/OPT 
87
SEDRIS SRM library                                     : /opt/sedris/srm/lib/linux-3.1.0-1-amd64-i386-gnu-/OPT/libsrm.so 
88
Checking for header srf_all.h                          : yes 
89
'configure' finished successfully (25.518s)
90
</pre>
91
92 18 Tony Ciavarella
If you get an error instead of that last line saying that 'configure' finished successfully, you must fix whatever is making it unhappy and try again.
93 13 Tony Ciavarella
94 19 Tony Ciavarella
h4. Clang++
95 16 Tony Ciavarella
96 32 Tony Ciavarella
To use the "Clang":http://clang.llvm.org/ C++ compiler instead of "GCC":http://gcc.gnu.org/, assuming clang++ is installed on the build system:
97 16 Tony Ciavarella
<pre>CXX=<put the path to clang++ here> ./waf configure --sedris-srm-root=<put the path to the SEDRIS SRM root here></pre>
98
99 19 Tony Ciavarella
For example:
100 16 Tony Ciavarella
<pre>CXX=/usr/bin/clang++ ./waf configure --sedris-srm-root=/opt/sedris/srm</pre>
101
102 13 Tony Ciavarella
h3. Windows
103
104
On windows, your $PATH environment variable needs to include the path to the Python interpreter.
105
106 30 Tony Ciavarella
The easiest way to configure Disorder on Windows is to use a modified version of the provided batch file to tell Disorder where your prerequisites live.  Copy the template from @tools/windows/configure.bat@ to the root of the Disorder tree.
107 1 Tony Ciavarella
108 30 Tony Ciavarella
This file contains some variables near the middle that must be set according to your system configuration.  An example is provided in the template for guidance.
109
110
Once you are finished editing configure.bat, it's time to execute it.  From the command line:
111
<pre>configure.bat</pre>
112
113
If everything is successful, you should get something that looks like this:
114
<pre>
115
C:\oss\disorder>python waf configure --boost-includes=c:\oss\boost_1_48_0 --boost-libs=c:\oss\boost_1_48_0\stage\lib --boost-mt --boost-static --eigen-root=c:\oss\eigen-3.0.4 --sedris-srm-root=c:\oss\sedris\srm --sedris-srm-static
116
Setting top to                           : C:\oss\disorder
117
Setting out to                           : C:\oss\disorder\bin
118
Checking for 'msvc' (c++ compiler)       : c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\CL.exe
119
Checking for program doxygen             : not found
120
Checking for Eigen library               : c:\oss\eigen-3.0.4
121
Checking for header Eigen/Dense          : yes
122
Checking for SEDRIS SRM                  : c:\oss\sedris\srm
123
Checking for SEDRIS SRM include directory : c:\oss\sedris\srm\src\include
124
Checking for SEDRIS SRM library directory : c:\oss\sedris\srm\lib\[Debug/Release]
125
Checking for header srf_all.h             : yes
126
Configuring boost libraries               : debug variant
127
Checking boost ABI tag                    : gd
128
Checking boost includes                   : 1_48
129
Checking boost libs                       : ok
130
Checking for boost linkage                : ok
131
Checking for header boost/asio.hpp        : yes
132
Checking for header boost/bind.hpp        : yes
133
Checking for header boost/date_time.hpp   : yes
134
Checking for header boost/detail/endian.hpp : yes
135
Checking for header boost/format.hpp        : yes
136
Checking for header boost/function.hpp      : yes
137
Checking for header boost/functional/factory.hpp : yes
138
Checking for header boost/ptr_container/ptr_vector.hpp : yes
139
Checking for header boost/scoped_ptr.hpp               : yes
140
Checking for header boost/static_assert.hpp            : yes
141
Checking for header boost/thread.hpp                   : yes
142
Configuring boost libraries                            : optimized variant
143
Checking boost ABI tag                                 :
144
Checking boost includes                                : 1_48
145
Checking boost libs                                    : ok
146
Checking for boost linkage                             : ok
147
Checking for header boost/asio.hpp                     : yes
148
Checking for header boost/bind.hpp                     : yes
149
Checking for header boost/date_time.hpp                : yes
150
Checking for header boost/detail/endian.hpp            : yes
151
Checking for header boost/format.hpp                   : yes
152
Checking for header boost/function.hpp                 : yes
153
Checking for header boost/functional/factory.hpp       : yes
154
Checking for header boost/ptr_container/ptr_vector.hpp : yes
155
Checking for header boost/scoped_ptr.hpp               : yes
156
Checking for header boost/static_assert.hpp            : yes
157
Checking for header boost/thread.hpp                   : yes
158
'configure' finished successfully (31.262s)
159
</pre>
160
161
If you don't see that last line that says @'configure' finished successfully@, then something is screwed up and it needs to be fixed.  Fix it and try again.
162 10 Tony Ciavarella
163 1 Tony Ciavarella
h2. Compiling
164
165 20 Tony Ciavarella
The basic strategy for building Disorder is to invoke the waf build system with the desired build variant.
166 1 Tony Ciavarella
167 20 Tony Ciavarella
Disorder has two build variants:
168 23 Tony Ciavarella
* debug: produces a library that contains debugging symbols and disables most compiler optimizations
169
* optimized: produces a library stripped of debugging symbols and enables compiler optimizations for performance
170 1 Tony Ciavarella
171 23 Tony Ciavarella
It might be reasonable to use the @debug@ variant in a development environment and the @optimized@ variant in a production environment.
172 1 Tony Ciavarella
173 23 Tony Ciavarella
The @debug@ variant is produced by the @build_debug@ build target and the @optimized@ variant is produced by the @build_optimized@ build target.
174
175 26 Tony Ciavarella
The results of the build are put in the @bin@ subdirectory under the name of the variant.  
176 23 Tony Ciavarella
177 26 Tony Ciavarella
Both variants can coexist peacefully in the tree at the same time.
178 23 Tony Ciavarella
179 20 Tony Ciavarella
h3. Linux
180 1 Tony Ciavarella
181 23 Tony Ciavarella
On Linux, to build the Disorder @debug@ variant:
182 20 Tony Ciavarella
<pre>./waf build_debug</pre>
183
184
h3. Windows
185
186 23 Tony Ciavarella
On Windows, the waf script is invoked indirectly.  To build the @optimized@ variant:
187
<pre>python.exe waf build_optimized</pre>
188 12 Tony Ciavarella
189 1 Tony Ciavarella
h2. Building Against the Disorder Library
190 28 Tony Ciavarella
191
h3. Compiling
192
193
In order to compile your goodness against the Disorder library, you'll need to have the header files from the @src@ directory in the Disorder tree and Eigen's include directory in your compiler's include path.  You do not need anything from SEDRIS SRM in your include path.
194
195
h3. Linking
196
197 29 Tony Ciavarella
Just link your program against Disorder's static library that can be found in the @bin/<build variant>@ directory.