LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-03-2008, 07:57 PM   #1
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
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
 
Old 03-05-2008, 03:09 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
I'd try with lower optimization level (it has -O2). Also, I'd think of removing -pipe option (both in Makefile).
 
Old 03-05-2008, 05:58 PM   #3
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Original Poster
Rep: Reputation: Disabled
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
 
Old 03-05-2008, 06:19 PM   #4
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
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.
 
Old 03-05-2008, 08:02 PM   #5
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Original Poster
Rep: Reputation: Disabled
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
 
Old 03-05-2008, 08:47 PM   #6
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
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!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: The Fourth ‘Patent Deal’ was with Europe… and the Sixth Deal That Won’t be LXer Syndicated Linux News 0 10-24-2007 03:40 PM
Traffic Limitations Equin Linux - Software 3 08-16-2005 02:06 PM
new user limitations Longinus Linux - Newbie 1 04-22-2004 03:02 AM
force gcc to compile in different version??? mu664life Linux - Newbie 5 04-07-2004 11:56 PM
where can I find the resource of GCC and c++ for linux documents? wolfshome Programming 2 06-05-2002 06:08 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration