rakhimov / scram

Probabilistic Risk Analysis Tool (fault tree analysis, event tree analysis, etc.)
https://scram-pra.org
GNU General Public License v3.0
131 stars 54 forks source link

Split Initializer into 2 source files to allow 32-bit debug build #274

Closed metorm closed 6 years ago

metorm commented 6 years ago

There is a trouble in src/Initializer.cc. Since the class includes a giant recursive template function Initializer::DefineExternFunction. Compiling 32-bit debug version produced so huge object file that as.exe throws "too many sections & file too big" error. I have to split the class into 2 files to evade the error.

See file src/initializer2.cc

CLAassistant commented 6 years ago

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

rakhimov commented 6 years ago

Thanks @metorm ! Indeed, the Initializer is complex, but the proposed quick-&-dirty splitting is not a proper solution since each module must be represented by a single header and implementation file.

This issue with debug info blow-up will show-up again when scram switches to Verdigris, which heavily uses a lot of template & compile time features. I would recommend trying with reduced debug info -g1 flag. Since 32bit archs are only target release platforms, I wouldn't worry much with debug builds.

metorm commented 6 years ago

OK, I understand that. I'll keep that in my fork since I may have to debug something on the 32Bit platform.

BTW, with my MSYS2, jemalloc throws segment fault in both 32/64Bit, debug and release version. I cannot figure out the reason.

rakhimov commented 6 years ago

BTW, with my MSYS2, jemalloc throws segment fault in both 32/64Bit, debug and release version. I cannot figure out the reason.

Yea, there is some strange issue mingw jemalloc: https://github.com/Alexpux/MINGW-packages/issues/2520#issuecomment-390658023

I'd recommend disabling it for now with -DWITH_JEMALLOC=OFF.

metorm commented 6 years ago

I already did that.

In addition, I have translated the program to Simplified Chinese at my fork. However, my fork and the original version is now out of sync, so I cannot create a proper PR. You can fetch the translation using cherry-pick if you like.

rakhimov commented 6 years ago

@metorm Please submit translations through Crowdin.

rakhimov commented 6 years ago

Also, you should not use the upstream branches in your development. As stated in the contributing guidelines, you must create topic branches and PR with them.

metorm commented 6 years ago

En…

rakhimov commented 6 years ago

En…

? @metorm

metorm commented 6 years ago

I mean, all right. Contributing to an open source project seems to require more experience than I thought.