-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README_EN.linux_x86_64.txt
588 lines (438 loc) · 21 KB
/
README_EN.linux_x86_64.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
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
* README_EN.linux_x86_64.txt
* 2020.04.06
* tacklelib
1. DESCRIPTION
2. DEPENDENCIES
3. PREREQUISITES
3.1. Linux Mint 18.3 x64
3.1.1. Preconfiguration
3.1.2. Locale
3.1.3. apt-get
3.1.4. GCC
3.1.5. 3dparty libraries
3.1.6. 3dparty utilities
3.1.7. VirtualBox shared folder mount
3.1.8. Postprocess files has copied into Linux directories
3.1.9. Boost library download and build
3.1.10. GoogleTest library build (optional)
3.1.11. xz library download, build and install
4. CONFIGURE
4.1. Manual copy step
4.2. Manual preparation step
5. RUN
5.1. Prepare environment variables
6. KNOWN ISSUES
6.1. Software issues
6.1.1. apt-get install issues
6.1.1.1. Message `Failed to fetch ... 404 Not Found`
6.1.2. Boost build
6.1.2.1. Boost build reports boost is not found, when the boost is completely
built and `BOOST_ROOT` has correct path.
6.1.3. Any project build
6.1.3.1. Make complains with error
`make: getcwd: No such file or directory`,
`make: *** No rule to make target '...'. Stop.`
6.1.3.2. Compilation complains with error
`<library>.so: error adding symbols: File in wrong format`.
6.1.3.3. Compilation complains with error
`/usr/bin/ld: <object>.o: undefined reference to symbol 'pthread_create@@GLIBC_2.1'`,
`//lib/i386-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line`.
6.2. Hardware issues
6.2.1. CDROM/DVDROM is empty or not unmountable
7. AUTHOR
-------------------------------------------------------------------------------
1. DESCRIPTION
-------------------------------------------------------------------------------
Tacklelib (taacklelib) project, initial steps for Linux only targets and
related build issues.
Read the `README_EN.txt` file for the start details to configure and build
for both under the Windows and under the Linux platforms.
CAUTION:
From here and after will be described ONLY additional steps to configure and
build under the Linux. All other steps which are the common here are left to
the `README_EN.txt` file.
-------------------------------------------------------------------------------
2. DEPENDENCIES
-------------------------------------------------------------------------------
Read the `README_EN.deps.txt` file for the common dependencies for the Windows
and the Linux like platforms.
Additional dependencies specific to the Linux:
* libz-dev:i386 (libarchive)
* libexpat-dev:i386 (libarchive)
-------------------------------------------------------------------------------
3. PREREQUISITES
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
3.1. Linux Mint 18.3 x64
-------------------------------------------------------------------------------
>
cd /home/tester
-------------------------------------------------------------------------------
3.1.1. Preconfiguration
-------------------------------------------------------------------------------
# to read the system and repository configuration
>
inxi -Sr
-------------------------------------------------------------------------------
3.1.2. Locale
-------------------------------------------------------------------------------
# update locale
>
echo "export LC_ALL=ru_RU.UTF-8" >> ~/.bash_profile
# !!! relogin !!!
>
sudo update-locale
-------------------------------------------------------------------------------
3.1.3. apt-get
-------------------------------------------------------------------------------
# prepare apt-get
>
sudo apt-get update
-------------------------------------------------------------------------------
3.1.4. GCC
-------------------------------------------------------------------------------
# prepare gcc
>
sudo apt-get install g++
sudo apt-get install gcc-multilib
sudo apt-get install g++-multilib
sudo apt-get install ia32-libs
sudo apt-get install libx32gcc-4.8-dev
sudo apt-get install libc6-dev:i386 libc6-dev-i386
-------------------------------------------------------------------------------
3.1.5. 3dparty libraries
-------------------------------------------------------------------------------
# prepare 3dparty required libs
>
sudo apt-get install libz-dev:i386 # required for libarchive 32-bit dependecy
sudo apt-get install libexpat-dev:i386 # required for libarchive 32-bit dependecy
# prepare 3dparty optional libs
>
sudo apt-get install libicu-dev
-------------------------------------------------------------------------------
3.1.6. 3dparty utilities
-------------------------------------------------------------------------------
# prepare utilities (required)
>
mkdir -p ~/Archive/Applications/Dev/CMake
cd ~/Archive/Applications/Dev/CMake
# download manually or through the wget utility
>
wget https://cmake.org/files/v3.14/cmake-3.14.0-Linux-x86_64.sh
>
sudo apt remove cmake
sudo bash ./cmake-3.14.0-Linux-x86_64.sh
>
mkdir -p ~/Applications/Dev/CMake
sudo mv ~/Archive/Applications/Dev/CMake/cmake-3.14.0-Linux-x86_64 ~/Applications/Dev/CMake
>
echo "export PATH=\$PATH:/home/tester/Applications/Dev/CMake/cmake-3.14.0-Linux-x86_64/bin" >> ~/.bash_profile
# !!! relogin !!!
# prepare utilities (optional)
>
sudo apt-get install git
sudo apt-get install git-flow
sudo apt-get install mono-complete
# prepare direct executable patch utility (required in an application post build stage)
>
sudo apt-get install patchelf:i386
-------------------------------------------------------------------------------
3.1.7. VirtualBox shared folder mount
-------------------------------------------------------------------------------
# To auto mount shared folder at boot:
# 1. Install Guest additions for VirtualBox.
# 2. Create persistent shared directory `common_rw` in the VirtualBox with
# auto-mount option enabled.
# 3. Add user `tester` into `vboxsf` group:
>
sudo gpasswd -a <username> vboxsf
# hint: after boot the folder will be created in the `/media` directory.
# To mount a shared folder explicitly:
>
mkdir ~/common_rw
sudo mount -t vboxsf common_rw ~/common_rw
-------------------------------------------------------------------------------
3.1.8. Postprocess files has copied into Linux directories
-------------------------------------------------------------------------------
After files has copied into `/media/sf_common_rw` or whatever else, you have to
grant permissions on the files recursively:
# for not executable files:
>
chown -R tester:tester /media/sf_common_rw
chmod -R ug+rw /media/sf_common_rw
# for executable files:
>
chown -R tester:tester /media/sf_common_rw
chmod -R ug+rwx /media/sf_common_rw/*.sh
# For the project root exists special script for such things:
>
cd .../_script/admin
sudo bash ./chown_mod.sh [<user> [<group>]]
-------------------------------------------------------------------------------
3.1.9. Boost library download and build
-------------------------------------------------------------------------------
WARNING:
Use the version described in the `README_EN.deps.txt` file in the respective
section or use links from there to find out the latest available package
version.
Here is we use specific version as a temporary example.
>
mkdir /home/opt
mkdir -p ~/_3dparty/linux_mint_gcc_x86/boost
cd ~/_3dparty/linux_mint_gcc_x86/boost
# download manually or through the wget utility
>
wget -O boost_1_72_0.tar.bz2 http://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.bz2/download
>
tar xvfo boost_1_72_0.tar.bz2
# configure
>
cd boost_1_72_0
./bootstrap.sh
# CAUTION
# 1. THE PREFIX ARGUMENT IS IMPORTANT HERE, OTHERWISE THE CMAKE `FindBoost` FUNCTION
# WOULD NOT FIND THE REQUIRED BOOST LIBRARIES LOCATED NOT IN THE BUILTIN PREFIX.
# 2. DO USE `-m32` on both compiler and linker, otherwise
# linkage with libraries will throw `error adding symbols: File in wrong format`
# error.
#
## full build, all static
##>
##./b2 --reconfigure --prefix=/home/opt/_3dparty/linux_mint_gcc_x86/boost/boost_1_72_0 --layout=versioned --build-type=complete "variant=release,debug" toolset=gcc address-model=32 architecture=x86 link=static runtime-link=static threading=multi debug-symbols=on --build-dir=__build-gcc-32 stage
#
## full build, all shared
##>
##./b2 --reconfigure --prefix=/home/opt/_3dparty/linux_mint_gcc_x86/boost/boost_1_72_0 --layout=versioned --build-type=complete "variant=release,debug" toolset=gcc address-model=32 architecture=x86 link=shared runtime-link=shared threading=multi debug-symbols=on --build-dir=__build-gcc-32 stage
# partial build, all static
>
./b2 --reconfigure --prefix=/home/opt/_3dparty/linux_mint_gcc_x86/boost/boost_1_72_0 --layout=versioned "variant=release,debug" toolset=gcc address-model=32 architecture=x86 link=static runtime-link=static threading=multi debug-symbols=on --build-dir=__build-gcc-32 --with-atomic --with-chrono --with-date_time --with-filesystem --with-system --with-iostreams --with-program_options --with-random --with-regex --with-serialization --with-thread --with-timer stage
# partial build, all shared
>
./b2 --reconfigure --prefix=/home/opt/_3dparty/linux_mint_gcc_x86/boost/boost_1_72_0 --layout=versioned "variant=release,debug" toolset=gcc address-model=32 architecture=x86 link=shared runtime-link=shared threading=multi debug-symbols=on --build-dir=__build-gcc-32 --with-atomic --with-chrono --with-date_time --with-filesystem --with-system --with-iostreams --with-program_options --with-random --with-regex --with-serialization --with-thread --with-timer stage
# install, all static
>
sudo ./b2 --reconfigure --prefix=/home/opt/_3dparty/linux_mint_gcc_x86/boost/boost_1_72_0 --layout=versioned "variant=release,debug" toolset=gcc address-model=32 architecture=x86 link=static runtime-link=static threading=multi debug-symbols=on --build-dir=__build-gcc-32 --with-atomic --with-chrono --with-date_time --with-filesystem --with-system --with-iostreams --with-program_options --with-random --with-regex --with-serialization --with-thread --with-timer install
# install, all shared
>
sudo ./b2 --reconfigure --prefix=/home/opt/_3dparty/linux_mint_gcc_x86/boost/boost_1_72_0 --layout=versioned "variant=release,debug" toolset=gcc address-model=32 architecture=x86 link=shared runtime-link=shared threading=multi debug-symbols=on --build-dir=__build-gcc-32 --with-atomic --with-chrono --with-date_time --with-filesystem --with-system --with-iostreams --with-program_options --with-random --with-regex --with-serialization --with-thread --with-timer install
-------------------------------------------------------------------------------
3.1.10. GoogleTest library build (optional)
-------------------------------------------------------------------------------
WARNING:
Use the version described in the `README_EN.deps.txt` file in the respective
section or use links from there to find out the latest available package
version.
Here is we use specific version as a temporary example.
# CHANGE DIRECTORY INTO UNPACKED `googletest` DIRECTORY BEFORE TYPE ANY COMMANDS
# >
# cd .../googletest-1.8.0
>
mkdir lib
mkdir linux_mint_gcc_x86
cd linux_mint_gcc_x86
# enable c++ standard usage for all targets, basically to avoid the default `-std=gnu++11` parameter for the GCC compiler
>
cmake -G "Unix Makefiles" -DBUILD_SHARED_LIBS=OFF "-DCMAKE_CXX_FLAGS=-m32" "-DCMAKE_CXX_STANDARD=11" "-DCMAKE_CXX_STANDARD_REQUIRED=ON" ..
>
cmake --build . --config Debug
mv libgtest_main.a libgtest_maind.a
mv libgtest.a libgtestd.a
cp libgtest_maind.a ../lib
cp libgtestd.a ../lib
>
cmake --build . --config Release
cp libgtest_main.a ../lib
cp libgtest.a ../lib
-------------------------------------------------------------------------------
3.1.11. xz library download, build and install
-------------------------------------------------------------------------------
WARNING:
Use the version described in the `README_EN.deps.txt` file in the respective
section or use links from there to find out the latest available package
version.
Here is we use specific version as a temporary example.
>
mkdir /home/opt
mkdir -p ~/_3dparty/linux_mint_gcc_x86/xz
cd ~/_3dparty/linux_mint_gcc_x86/xz
# download manually or through the wget utility
>
wget -O xz-5.2.4.tar.bz2 https://sourceforge.net/projects/lzmautils/files/xz-5.2.4.tar.bz2/download
>
tar xvfo xz-5.2.4.tar.bz2
>
mv xz-5.2.4 xz-5.2.4-src
# configure for 32-bit libraries build
>
mkdir xz-5.2.4-build
cd xz-5.2.4-build
../xz-5.2.4-src/configure --prefix=/home/opt/_3dparty/linux_mint_gcc_x86/xz/xz-5.2.4 CFLAGS=-m32 CPPFLAGS=-m32 LDFLAGS=-m32
# to build
>
make
# to install
>
make install
-------------------------------------------------------------------------------
4. CONFIGURE
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
4.1. Manual copy step
-------------------------------------------------------------------------------
To run bash shell scripts (`.sh` file extension) you should copy the
`bash_entry` module into the `/bin` directory of your platform:
>
sudo cp bash_entry /bin
-------------------------------------------------------------------------------
4.2. Manual preparation step
-------------------------------------------------------------------------------
# To make scripts executable:
>
sudo chmod ug+x /bin/bash_entry
sudo chmod o+r /bin/bash_entry
>
cd .../_scripts
sudo chmod ug+x *.sh
sudo chmod -R ug+rw
-------------------------------------------------------------------------------
5. RUN
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
5.1. Prepare environment variables
-------------------------------------------------------------------------------
Because the current directory path is not in the search paths for shared
objects to load then you have to setup it explicitly before run the
executable:
export LD_LIBRARY_PATH=.:./lib
-------------------------------------------------------------------------------
6. KNOWN ISSUES
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
6.1. Software issues
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
6.1.1. apt-get install issues
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
6.1.1.1. Message `Failed to fetch ... 404 Not Found`
-------------------------------------------------------------------------------
Cause:
1. Repository paths is invalid or has changed.
Solution #1:
https://superuser.com/questions/1004008/linux-mint-sudo-apt-get-update-404-errors/1009807#1009807
Update repository sources:
1. Backup directory `/etc/apt/sources.list.d`
2. Delete content of the directory `/etc/apt/sources.list.d`
3. `sudo software-sources`
4. Press button `Restore the default settings`
5. Press button `Update cache`
Solution #2:
Run the apt update:
>
sudo apt-get update
-------------------------------------------------------------------------------
6.1.2. Boost build
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
6.1.2.1. Boost build reports boost is not found, when the boost is completely
built and `BOOST_ROOT` has correct path.
-------------------------------------------------------------------------------
This may happend because:
1. The cmake version does not have appropriate implementation in the
`FindBoost.cmake` module to find required version of the boost library.
For example, the cmake of version 3.5 does not implement search for the
boost library of the version 1.63 and higher. So, you have to update the
cmake by yourself to enable the search for the appropriate library version.
2. Boost is built for one prefix path but located in another one. This can
break the search in the cmake. The solution is to rebuild and reinstall the
boost to the same path there the `BOOST_ROOT` variable would point it.
3. Boost built with the wrong architecture variant. Try to analyze name
components in the boost stage directory to find out the differences.
4. Missed to use the correct version of the `Boost_ARCHITECTURE` configuration
variable (for the boost 1.66+ only).
-------------------------------------------------------------------------------
6.1.3. Any project build
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
6.1.3.1. Make complains with error
`make: getcwd: No such file or directory`,
`make: *** No rule to make target '...'. Stop.`
-------------------------------------------------------------------------------
The issue:
Directory has deleted in another process while running current shell instance.
Solution #1:
If directory is recreated or exists, then update the current working directory
file handle in the current shell instance:
>
cd .
Solution #2:
Restart terminal application.
-------------------------------------------------------------------------------
6.1.3.2. Compilation complains with error
`<library>.so: error adding symbols: File in wrong format`.
-------------------------------------------------------------------------------
The issue #1:
Project has been linking without `-m32` flag.
See details here: https://stackoverflow.com/questions/5805874/the-proper-way-of-forcing-a-32-bit-compile-using-cmake/19310455#19310455
Solution:
Use flag `-m32` both for compiler and linker.
The issue #2:
Library `<library>.so` has linked with different address model or platform.
Solution:
Check the library format by the command:
>
objdump -f <library>.so
Get or rebuild the correct version of the library.
-------------------------------------------------------------------------------
6.1.3.3. Compilation complains with error
`/usr/bin/ld: <object>.o: undefined reference to symbol 'pthread_create@@GLIBC_2.1'`,
`//lib/i386-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line`.
-------------------------------------------------------------------------------
The issue #1:
The target required to be linked with the `pthread` library.
Solution:
Use flag `-pthread` in the compiler and linker.
The issue #2:
The flag `-lpthread` has used before objects linked versus `pthread` on the
linker command line instead after.
See details here:
https://stackoverflow.com/questions/19901934/strange-linking-error-dso-missing-from-command-line/19905704#19905704
https://stackoverflow.com/questions/24814698/how-can-i-add-a-flag-at-the-end-of-the-linking-command-line-using-cmake
Solution:
Move the flag to the end of the linker command line.
OR
Use flag `-pthread` both for the compiler and linker instead the `-lpthread`
flag.
-------------------------------------------------------------------------------
6.2. Hardware issues
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
6.2.1. CDROM/DVDROM is empty or not unmountable
-------------------------------------------------------------------------------
Can happens because:
1. The guest is running under VirtualBox 5.x and the previous cdrom image was
not properly unmounted before install a new version of the VirtualBox.
Solution #1:
Try to eject the disk by using one of these commands:
* `sudo eject -T`
* `sudo eject -r`
* `sudo eject -s`
From the command manual (http://man7.org/linux/man-pages/man1/eject.1.html ):
-r, --cdrom
This option specifies that the drive should be ejected using a
CDROM eject command.
-s, --scsi
This option specifies that the drive should be ejected using
SCSI commands.
-T, --traytoggle
With this option the drive is given a CD-ROM tray close
command if it's opened, and a CD-ROM tray eject command if
it's closed. Not all devices support this command, because it
uses the above CD-ROM tray close command.
-t, --trayclose
With this option the drive is given a CD-ROM tray close
command. Not all devices support this command.
-------------------------------------------------------------------------------
7. AUTHOR
-------------------------------------------------------------------------------
Andrey Dibrov (andry at inbox dot ru)