This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC suggestions needed


Niklaus wrote:
> Hi,
> 
>     I've an online judge system where i take the source code submitted
> by an user and compile it to an executable and then run it against a
> predetermined input to produce    an output which is checked against a
> predetermined output. This determines the results as Correct, Wrong or
> Compile error.
> 
>     The languages are C,C++,java.
> 
>     Please suggest solutions for the below problems
> 
>    1) How to tell gcc to stop after the first error. I use both gcc
> 4.2 and gcc 3.4. I tried -Wfatal-error and -Wfatal-error it says
> unrecognized option.

Trim the output to the first 50 lines.  If the output is 50 lines long,
kill the compiler process.

>    2) There are many people who submit code without compiling. If they
> submit C++ (STL or templates ) code which fails to compile due to some
> problem, it produces lots of output and it is slow, some take 3 - 5
> secs. So that is for each submission. In this way if you make 100
> submissions the whole system is slow. How to over come this problem? I
> tried -fsyntax-only but the difference is not that noticable because
> after that -fsynax-only i have to recompile.
> 
>    3) Can this submissions be collected for every 5 secs and then
> compiled in parallel to produce parallel output. Invoking gcc for each
> submission is going to be slow ?
> 
>    4) Can we do anything about  gcj ? Java compilation errors take the
> most time.

Recent gcj fires off an external process to run the Java front-end.  It
depends on how your system is configured, but it's possible you're
running an interpreted Java front-end.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]