farnulfo / ai-contest

Automatically exported from code.google.com/p/ai-contest
0 stars 0 forks source link

my cpp package doesn't compile on contest server #194

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Submit mybot-cpp-bug.zip package

What is the expected output? What do you see instead?
I expect that the package would be compiled.
It is compiled locally on my computer with compile_anything.py script.

=====================================================================
!!! compiled locally:
=====================================================================
$ python compile_anything.py
g++ -O3 -funroll-loops -c -o lapi.o lapi.cc
g++ -O3 -funroll-loops -c -o lauxlib.o lauxlib.cc
g++ -O3 -funroll-loops -c -o lbaselib.o lbaselib.cc
g++ -O3 -funroll-loops -c -o lcode.o lcode.cc
g++ -O3 -funroll-loops -c -o ldblib.o ldblib.cc
g++ -O3 -funroll-loops -c -o ldebug.o ldebug.cc
g++ -O3 -funroll-loops -c -o ldo.o ldo.cc
g++ -O3 -funroll-loops -c -o ldump.o ldump.cc
g++ -O3 -funroll-loops -c -o lfunc.o lfunc.cc
g++ -O3 -funroll-loops -c -o lgc.o lgc.cc
g++ -O3 -funroll-loops -c -o linit.o linit.cc
g++ -O3 -funroll-loops -c -o liolib.o liolib.cc
g++ -O3 -funroll-loops -c -o llex.o llex.cc
g++ -O3 -funroll-loops -c -o lmathlib.o lmathlib.cc
g++ -O3 -funroll-loops -c -o lmem.o lmem.cc
g++ -O3 -funroll-loops -c -o loadlib.o loadlib.cc
g++ -O3 -funroll-loops -c -o lobject.o lobject.cc
g++ -O3 -funroll-loops -c -o lopcodes.o lopcodes.cc
g++ -O3 -funroll-loops -c -o loslib.o loslib.cc
g++ -O3 -funroll-loops -c -o lparser.o lparser.cc
g++ -O3 -funroll-loops -c -o lstate.o lstate.cc
g++ -O3 -funroll-loops -c -o lstring.o lstring.cc
g++ -O3 -funroll-loops -c -o lstrlib.o lstrlib.cc
g++ -O3 -funroll-loops -c -o ltable.o ltable.cc
g++ -O3 -funroll-loops -c -o ltablib.o ltablib.cc
g++ -O3 -funroll-loops -c -o ltm.o ltm.cc
g++ -O3 -funroll-loops -c -o lundump.o lundump.cc
g++ -O3 -funroll-loops -c -o lvm.o lvm.cc
g++ -O3 -funroll-loops -c -o lzio.o lzio.cc
g++ -O3 -funroll-loops -c -o MyBot.o MyBot.cc
g++ -O3 -funroll-loops -c -o print.o print.cc
g++ -O2 -o MyBot lapi.o lauxlib.o lbaselib.o lcode.o ldblib.o ldebug.o ldo.o 
ldump.o lfunc.o lgc.o linit.o liolib.o llex
.o lmathlib.o lmem.o loadlib.o lobject.o lopcodes.o loslib.o lparser.o lstate.o 
lstring.o lstrlib.o ltable.o ltablib.o l
tm.o lundump.o lvm.o lzio.o MyBot.o print.o -lm
=====================================================================
No errors
=====================================================================

Here's what I get when the sources are compiled on contest servers:

=====================================================================
!!! compiled locally:
=====================================================================
g++ -O3 -funroll-loops -c -o lapi.o lapi.cc
g++ -O3 -funroll-loops -c -o lauxlib.o lauxlib.cc
g++ -O3 -funroll-loops -c -o lbaselib.o lbaselib.cc
g++ -O3 -funroll-loops -c -o lcode.o lcode.cc
g++ -O3 -funroll-loops -c -o ldblib.o ldblib.cc
g++ -O3 -funroll-loops -c -o ldebug.o ldebug.cc
g++ -O3 -funroll-loops -c -o ldo.o ldo.cc
g++ -O3 -funroll-loops -c -o ldump.o ldump.cc
g++ -O3 -funroll-loops -c -o lfunc.o lfunc.cc
g++ -O3 -funroll-loops -c -o lgc.o lgc.cc
g++ -O3 -funroll-loops -c -o linit.o linit.cc
g++ -O3 -funroll-loops -c -o liolib.o liolib.cc
g++ -O3 -funroll-loops -c -o llex.o llex.cc
g++ -O3 -funroll-loops -c -o lmathlib.o lmathlib.cc
g++ -O3 -funroll-loops -c -o lmem.o lmem.cc
g++ -O3 -funroll-loops -c -o loadlib.o loadlib.cc
g++ -O3 -funroll-loops -c -o lobject.o lobject.cc
g++ -O3 -funroll-loops -c -o lopcodes.o lopcodes.cc
g++ -O3 -funroll-loops -c -o loslib.o loslib.cc
g++ -O3 -funroll-loops -c -o lparser.o lparser.cc
g++ -O3 -funroll-loops -c -o lstate.o lstate.cc
g++ -O3 -funroll-loops -c -o lstring.o lstring.cc
g++ -O3 -funroll-loops -c -o lstrlib.o lstrlib.cc
g++ -O3 -funroll-loops -c -o ltable.o ltable.cc
g++ -O3 -funroll-loops -c -o ltablib.o ltablib.cc
g++ -O3 -funroll-loops -c -o ltm.o ltm.cc
g++ -O3 -funroll-loops -c -o lundump.o lundump.cc
g++ -O3 -funroll-loops -c -o lvm.o lvm.cc
g++ -O3 -funroll-loops -c -o lzio.o lzio.cc
g++ -O3 -funroll-loops -c -o MyBot.o MyBot.cc
g++ -O3 -funroll-loops -c -o print.o print.cc
g++ -O2 -o MyBot ltable.o ltablib.o ltm.o lundump.o lapi.o lauxlib.o lbaselib.o 
lvm.o lzio.o MyBot.o print.o -lm
=====================================================================
ltable.o: In function `luaH_getstr(Table*, TString*)':
ltable.cc:(.text+0x3a): undefined reference to `luaO_nilobject_'
ltable.o: In function `luaH_free(lua_State*, Table*)':
ltable.cc:(.text+0x88): undefined reference to `luaM_realloc_(lua_State*, 
void*, unsigned int, unsigned int)'
ltable.cc:(.text+0xac): undefined reference to `luaM_realloc_(lua_State*, 
void*, unsigned int, unsigned int)'
ltable.cc:(.text+0xc8): undefined reference to `luaM_realloc_(lua_State*, 
void*, unsigned int, unsigned int)'
ltable.o: In function `setnodevector(lua_State*, Table*, int)':
ltable.cc:(.text+0x114): undefined reference to `luaO_log2(unsigned int)'
ltable.cc:(.text+0x145): undefined reference to `luaM_toobig(lua_State*)'
ltable.cc:(.text+0x3b8): undefined reference to `luaM_realloc_(lua_State*, 
void*, unsigned int, unsigned int)'
ltable.cc:(.text+0x3cd): undefined reference to `luaG_runerror(lua_State*, char 
const*, ...)'
=====================================================================

What version of the product are you using? On what operating system?
I tried it with cygwin on win7 system

Please provide any additional information below.
The problem is with the last compilation step:

g++ -O2 -o MyBot ltable.o ltablib.o ltm.o lundump.o lapi.o lauxlib.o lbaselib.o 
lvm.o lzio.o MyBot.o print.o -lm

It doesn't include all source I submitted. That's why I get those undefined 
references.

I'm trying to submit lua interpreter with lua bot.

Original issue reported on code.google.com by buratin....@gmail.com on 8 Oct 2010 at 5:35

Attachments:

GoogleCodeExporter commented 9 years ago
(instead of the second "!!! compiled locally" there should be "!!! compiled on 
contest servers")

Original comment by buratin....@gmail.com on 8 Oct 2010 at 5:37

GoogleCodeExporter commented 9 years ago
I noticed that the cpp package is compiled twice.

When you upload a cpp bot, it compiles the package though it doesn't see all 
the generated *.o files:
g++ -O2 -o MyBot ltable.o ltablib.o ltm.o lundump.o lapi.o lauxlib.o lbaselib.o 
lvm.o lzio.o MyBot.o print.o -lm

May be the script executes linker too early, when the not all object files are 
generated?

After uploading my cpp package I see that my submission failed to compile. 
After ten seconds I refresh the page and cpp package is compiled without 
errors. That's because the script workarounded the above problem by compiling 
the cpp sources again.

That comes from two emails one to say compilation failed and another to say the 
compilation ok. Two emails for one submission.

Original comment by buratin....@gmail.com on 13 Oct 2010 at 2:56

GoogleCodeExporter commented 9 years ago
This should have been fixed with some older changes to prevent race conditions 
with multiple compile daemons.

Original comment by jokeserver on 18 Nov 2010 at 7:13