forked from AntaresSimulatorTeam/Antares_Simulator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINSTALL.txt
353 lines (232 loc) · 10.4 KB
/
INSTALL.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
THIS FILE CONTAINS DETAILED INSTRUCTIONS ON HOW TO BUILD BINARIES
-----------------------------------------------------------------
IDENTICAL TO THOSE DISTRIBUTED IN RTE'S PACKAGES
------------------------------------------------
1. Environment
==============
Antares_Simulator is a cross-platform project using components compatible
with many 32 bits and 64 bits OS (Windows, Linux, Unix)
The source distribution accompanying this file has been tested for successful build on:
Windows 7
Windows 10
Linux CentOS 6
RHEL 7.3
with compilers MSVC 19.00 & GCC 4.8.1 & GCC 7
Note on End-Of-Line convention
------------------------------
If the origin of the source folder accompanying this file is a check-out
from a Git repository, end-of-line should be in the style of the local OS
If the source folder was distributed along with the binary form of the code
within an Antares_Simulator installer package, the end-of-line style is that of
the OS the package is designed for
To build on Windows system, please change end-of-line style to appropriate standard
Note that Visual Studio may carry out auto-reformating.
1.1 OS-dependent resources
==========================
Windows : Visual Studio 2015 (or later)
Linux : GCC >= 4.8.1 (required for C++11)
1.2 Tools
=========
Git (source versioning)
Cmake (>=3.9.0) (Generation of Visual studio solutions, Linux and Unix Makefiles)
Perl strawberry (>=5.26) (Windows pre-compilation of OpenSSL)
1.3 External Dependencies
=========================
This section describes compiling procedures for the third-part Open source libraries used by ANTARES
Hereafter the environment variable ${ANTARES} points at the Antares' repository root folder.
To begin with , clone the whole Antares repository and checkout the branch bearing the tag
of the relevant distributed version ( >=6.0.0)
Four external dependencies are integrated as Git submodules:
* src/ext/openssl - OpenSSL 1.1.0
* src/ext/libcurl - Curl 7.51.0
* src/ext/wxwidgets - wxWidgets 3.0.2
* src/ext/Sirius_Solver - Sirius_Solver 6.0.0
After a pull on Antares repository , submodules should be already properly initialized
if not, run :
git submodule update --init --recursive
1.3.1 Compiling OpenSSL with Visual Studio - 64 bits solution
=============================================================
Requirements :
* Visual Studio (2015 Update 2 or 2019)
* Perl - Strawberry Perl
Warning : make sure that the perl version available is Strawberry perl and not one shipped along with Git.
If needed, remove temporarily "...\Git\usr\bin" from the environment variables (and put it back afterwards)
Notice: launching nmake requires the execution of "vcvars64.bat" (as described below),
which updates environment variables for the current session.
Open a command line console and run:
Run the environment MSVC script "vcvars64.bat", wherever it is located on your machine.
For example, you can type :
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
Then :
cd ${ANTARES}\src\ext\openssl
perl Configure VC-WIN64A --prefix=vc-release-x86_64 no-shared
ms\do_win64a
nmake -f ms\nt.mak
nmake -f ms\nt.mak install
1.3.2 Compiling OpenSSL with Visual Studio - 32 bits solution
=============================================================
Requirements :
* Visual Studio - 2015 Update 2
* Perl - Strawberry Perl
Warning : make sure that the perl version available is Strawberry perl and not one shipped along with Git.
If needed, remove temporarily "...\Git\usr\bin" from the environment variables (and put it back afterwards)
Notice: launching nmake requires the execution of "vcvars32.bat" (as descibed below),
which updates environment variables for the current session.
Open a command line console and run:
Run the environment MSVC script "vcvars32.bat", wherever it is located on your machine.
For example, you can type :
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat"
Then :
cd ${ANTARES}\src\ext\openssl
perl Configure VC-WIN32 no-asm --prefix=vc-release-x86 no-shared
ms\do_ms
nmake -f ms\nt.mak
nmake -f ms\nt.mak install
1.3.3 Compiling OpenSSL for Linux
=================================
* Set the compiler to use if the default one is not compatible with C++11
* For instance, to use gcc-4.8, use :
export CC=/usr/local/gcc/4.8/bin/gcc-4.8
export CXX=/usr/local/gcc/4.8/bin/g++-4.8
cd ${ANTARES}
cd src/ext
cd openssl
./config --prefix=$PWD/release-x86_64 no-asm no-mdc2 no-rc5 no-shared
make depend
make
make install
1.4.1 Compiling Curl for Windows 64 bits
========================================
Open a command line console and run:
Run the environment MSVC script "vcvars64.bat", wherever it is located on your machine.
For example, you can type :
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
Then :
cd ${ANTARES}\src\ext\libcurl\winbuild
nmake /f Makefile.vc mode=static VC=14 WITH_SSL=static WITH_DEVEL=../../openssl/vc-release-x86_64 ENABLE_SSPI=no ENABLE_IDN=no ENABLE_WINSSL=no GEN_PDB=no DEBUG=no MACHINE=x64
1.4.2 Compiling Curl for Windows 32 bits
========================================
Open a command line console and run:
Run the environment MSVC script "vcvars32.bat", wherever it is located on your machine.
For example, you can type :
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat"
cd ${ANTARES}\src\ext\libcurl\winbuild
nmake /f Makefile.vc mode=static VC=14 WITH_SSL=static WITH_DEVEL=../../openssl/vc-release-x86 ENABLE_SSPI=no ENABLE_IDN=no ENABLE_WINSSL=no GEN_PDB=no DEBUG=no MACHINE=x86
</pre>
1.4.3 Compiling Curl for Linux
==============================
* Set the compiler to use if the default one is not compatible with C++11
* For instance, to use gcc-4.8, use :
export CC=/usr/local/gcc/4.8/bin/gcc-4.8
export CXX=/usr/local/gcc/4.8/bin/g++-4.8
cd ${ANTARES}/src
ANTARES_SRC=`pwd`
cd ext/libcurl
./buildconf
LIBS="-ldl -lpthread" ./configure --disable-shared --with-ssl="$ANTARES_SRC/ext/openssl/release-x86_64"
make
1.5.1 Compiling WxWidget for Windows 32 or 64 bits
==================================================
Copy file "setup0.h" from ${ANTARES}\src\ext\wxwidgets\include\wx\msw\
to: ${ANTARES}\src\ext\wxwidgets\include\wx\msw\setup.h.
In the file ${ANTARES}\src\ext\wxwidgets\src\tiff\libtiff\tif_config.h
Replace in line 367: #define snprintf _snprintf
by :
#if (defined(_MSC_VER) && (_MSC_VER < 1900))
#define snprintf _snprintf
#endif
Locate the folder : ${ANTARES}\src\ext\wxwidgets\build\msw
open "wx_vc12.sln" (double-click to launch Visual Studio)
* If needed,update compilation tools as suggested when opening Visual Studio
Explanation: in Visual Studio C++, the WxWidget solution is a VS 12.0 one.
With VS 2015 (version14.0), compilation tools must be upgraded. This is automatically suggested by VS 2015
* Configure compilation parameters (Debug/Release/x64/Win32)
* Compile
It is important that you compile WxWidget in the same mode (release / debug) that you are about to compile Antares.
1.5.2 Compiling WxWidget for Linux
==================================
* Set the compiler to use if the default one is not compatible with C++11
* For instance, to use gcc-4.8, use :
export CC=/usr/local/gcc/4.8/bin/gcc-4.8
export CXX=/usr/local/gcc/4.8/bin/g++-4.8
* run the compiler :
cd ${ANTARES}/src
#wxWidgets
cd ext/wxwidgets
mkdir build_gtk
cd build_gtk
../configure --with-gtk --disable-shared
make
2. Building Antares Solution for Windows
========================================
2.1 Preliminary step : get a clean environment
----------------------------------------------
If required, do not hesitate to clean up your local repository either:
* After a checkout (changing of branch, commit or tag) and before a new compilation
* between successive 64 bits and 32 bits compilation
Cleaning the Git repository can be achieved by running the following command, which resets the local
repository to zero (no cached or temporary files remaining):
git clean -xdf
If the version tag (X.Y.z) needs to be updated, this should be made in the file :
@src/CMakeLists.txt@ :
# Version
set(ANTARES_VERSION_HI 5) # numero majeur X
set(ANTARES_VERSION_LO 0) # numero mineur Y
set(ANTARES_VERSION_REVISION 0) # numero de révision z
2.2 Compiling for Windows : generation of Visual Studio solution
----------------------------------------------------------------
Note : generation should not be attempted before setting up the version tag defined in CMakeLists.txt
cd ${ANTARES}/src
2.2.1 32 bits version
---------------------
cmake -G "Visual Studio 10" -DCMAKE_BUILD_TYPE=release .
or
cmake -G "Visual Studio 14 2015" -DCMAKE_BUILD_TYPE=release .
2.2.2 64 bits version
---------------------
cmake -G "Visual Studio 10 Win64" -DCMAKE_BUILD_TYPE=release .
or
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=release .
or
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=release .
2.3 Compiling for Windows : Running the compiler
------------------------------------------------
# Open the solution @src/antares.sln@ with Visual Studio 10 or Visual Studio 15
# Choose the target "Release"
# Generate the solution
3. Building Antares for Linux
=============================
3.1 Preliminary step : get a clean environment
----------------------------------------------
Do not hesitate to clean up your local repository before a checkout
Cleaning the Git repository can be achieved by runing the following command, which resets the local
repository to zero (no cached or temporary files remaining):
git clean -xdf
If the version tag (X.Y.z) needs to be updated, this should be made in the file :
@src/CMakeLists.txt@ :
# Version
set(ANTARES_VERSION_HI 5) # major index X
set(ANTARES_VERSION_LO 0) # minor index Y
set(ANTARES_VERSION_REVISION 0) # revision number z
3.2 Compiling for Linux
-----------------------
3.2.1 Set the path
------------------
$ cd ${ANTARES}
* Set the compiler to use if the default one is not compatible with C++11
* For instance, to use gcc-4.8, use :
export CC=/usr/local/gcc/4.8/bin/gcc-4.8
export CXX=/usr/local/gcc/4.8/bin/g++-4.8
3.2.2 Generate the makefiles
----------------------------
In debug mode:
$ cmake .
Or in release mode:
$ cmake . -DCMAKE_BUILD_TYPE=release
3.2.3 Compile Antares
---------------------
$ make
Tips : If you have more than one processor/core, you can run more than one job :
$ make -j X
where X is the number of jobs to run simultaneously.
Tips : `make VERBOSE=1` to see the real commands