LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   force gcc to deal with resource limitations (https://www.linuxquestions.org/questions/programming-9/force-gcc-to-deal-with-resource-limitations-625500/)

ta0kira 03-03-2008 07:57 PM

force gcc to deal with resource limitations
 
I've been trying to compile a program for a few days that has 5 insane 25,000-line C++ files (not to mention they use Qt) that can't seem to behave during compilation (segatex.) I've already contacted the maintainer asking him/her to break up the source files. My question immediately pertains to this problem but it also extends to the generality of all "inconsiderate" projects.

I've tried to control resources with ulimit: I set nearly everything to a generous 256MB, but gcc exits with "out of virtual memory." Run without the limitations it peaks out at about 1.5GB of memory for a single 25k-line file, around 800MB of which is real memory. Needless to say, I can barely run ls in another login at the same time. I've also tried to use a nice of 19 and compile without -pipe, but to no avail.

More than actually getting this program to compile, I'd like to know if one can force gcc to accept the limitations it's given and find a way through it. Thanks.
ta0kira

Mara 03-05-2008 03:09 PM

I'd try with lower optimization level (it has -O2). Also, I'd think of removing -pipe option (both in Makefile).

ta0kira 03-05-2008 05:58 PM

That seems to be working well. It doesn't seem to be going above 210MB now and it's compiling very quickly.

As a side note, qmake inconveniently generated sources with explicit includes which I had to remove in order to build as a normal user in a restricted directory. It generated sources on the fly, so I couldn't use sed -i. I had to choose between building as root or moving the entire build location.
ta0kira

exvor 03-05-2008 06:19 PM

My personal opinion on qt is that it needs to die.
It needs a rewrite so it doesn't suck / break so much.

And if your thinking that I think that gnome stuff is better then your mistaken cause thats another animal that needs a slaughter and rebuild.

ta0kira 03-05-2008 08:02 PM

Well, I'd much rather use a bunch of C macros with GTK than deal with qmake and not being able to do simple things such as have an interface inherit a class outside of the Qt realm. But generally speaking, I rarely do GUI programming because I think most well-designed, useful things can do what they need to from the command line and using config files. I think that all GUIs should just be shells that fit over a command-line interface or a library API. In other words, disposable and arbitrarily-replaceable. They certainly make things a lot easier and faster (most of the time,) but one has no business filling "click" and "modified" functions with real code.
ta0kira

paulsm4 03-05-2008 08:47 PM

Quote:

But generally speaking, ... I think most well-designed, useful things can do what they need to from the command line and using config files. I think that all GUIs should just be shells that fit over a command-line interface or a library API. In other words, disposable and arbitrarily-replaceable. They certainly make things a lot easier and faster (most of the time,) but one has no business filling "click" and "modified" functions with real code.
ta0kira
I couldn't agree more!


All times are GMT -5. The time now is 04:08 PM.