den-run-ai / mipt-course

Automatically exported from code.google.com/p/mipt-course
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

CMAKE_BUILD_TYPE=Release не отличается от =Debug (по флагами компиляции) #27

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Cборка с -DCMAKE_BUILD_TYPE={debug,release}
$ ls -l {debug,release}/*_tests 
-rwx------ 1 buildslave buildbot 1321409 Nov 20 19:46 debug/base_tests
-rwx------ 1 buildslave buildbot 3784311 Nov 20 19:46 debug/sandbox_tests
-rwx------ 1 buildslave buildbot 1321417 Nov 20 19:49 release/base_tests
-rwx------ 1 buildslave buildbot 3784319 Nov 20 19:49 release/sandbox_tests

C -DCMAKE_BUILD_TYPE=Release
$ ls -l true_release/*_tests
-rwxr-xr-x 1 buildslave buildbot  612073 Nov 20 20:05 true_release/base_tests
-rwxr-xr-x 1 buildslave buildbot 1535607 Nov 20 20:05 true_release/sandbox_tests

Сравните размер файлов.

Original issue reported on code.google.com by timurrrr on 20 Nov 2011 at 8:05

GoogleCodeExporter commented 9 years ago
Насчёт первых чисел (132хххх, 378хххх): 
возможно, они не точные, так как я их 
получил на боте на "не clean" сборке.

Ошибка сейчас есть другого уровня: Release не 
отличается от Debug.
Проверка: берёшь r261+r262, собираешь Release и Debug, 
запускаешь `./base_tests --gtest_filter=CommonTest.DebugOrRelease`.

CMake (независимо от CMAKE_BUILD_TYPE) :
[ RUN      ] CommonTest.DebugOrRelease
NDEBUG is not defined, this is a Debug build
[       OK ] CommonTest.DebugOrRelease (0 ms)

А теперь просто `make BUILDTYPE=Release test`, в корне 
репозитория:
[ RUN      ] CommonTest.DebugOrRelease
NDEBUG defined, this is a Release build
[       OK ] CommonTest.DebugOrRelease (0 ms)

Посмотри, каковы различные настройки 
сборки в нашем Makefile'е - ты их не перенёс в CMake.

Ещё, я наблюдаю различные output sizes у Release 
сборки после CMake'а в зависимости от того, 
"чистая" ли сборка. Гм... Но вначале 
разберись с флагами компиляции.

Original comment by timurrrr on 21 Nov 2011 at 10:57

GoogleCodeExporter commented 9 years ago

Original comment by muxana...@gmail.com on 6 Dec 2011 at 2:51

GoogleCodeExporter commented 9 years ago
ping?

Original comment by timurrrr on 9 Dec 2011 at 7:09

GoogleCodeExporter commented 9 years ago
Сделано в r319

Original comment by Mikhail....@gmail.com on 18 Dec 2011 at 10:58

GoogleCodeExporter commented 9 years ago
На "нечистой" сборке эффекта не было:
http://ec2-79-125-98-54.eu-west-1.compute.amazonaws.com:8010/builders/linux-bot/
builds/116

а вот после `rm -rf Debug Release` сразу видно что 
компиляция дебага и релиза происходит 
по-разному:
http://ec2-79-125-98-54.eu-west-1.compute.amazonaws.com:8010/builders/linux-bot/
builds/117

Ты не знаешь, как побороться с проблемой 
"нечистых" сборок?

Original comment by timurrrr on 18 Dec 2011 at 9:40

GoogleCodeExporter commented 9 years ago
$ ls -l {Debug,Release}/*_tests
-rwx------ 1 buildslave buildbot 1355623 Dec 19 01:24 Debug/base_tests
-rwx------ 1 buildslave buildbot 4290239 Dec 19 01:39 Debug/sandbox_tests
-rwxr-xr-x 1 buildslave buildbot  350927 Dec 19 01:33 Release/base_tests
-rwx------ 1 buildslave buildbot  969628 Dec 19 01:39 Release/sandbox_tests

Original comment by timurrrr on 18 Dec 2011 at 9:41