You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently we encountered intermittent failures while building luajit in parallel on a build server.
The error diagnostic appeared to be completely misleading (see below). It seemed almost like we missed a dependency to the generated file.
After some digging, I have concluded that generated dependencies are fine - also, should the file with macro definition be missing, first error should have been about that include file not found, unless we have some real bad header eclipsing issues here.
Another plausible explanation would be memory exhaustion that is somehow 'gracefully' handled by the compiler. The log shows that we had 2 huge amalgam files built in parallel.
I think the best way to fix it would be to add direct dependency between liajit and luajit-static targets:
IF(WITH_AMALG)
add_library(libluajit SHARED src/ljamalg.c ${DEPS} )
add_library(luajit-static STATIC src/ljamalg.c ${DEPS} )
set_property(TARGET luajit-static PROPERTY POSITION_INDEPENDENT_CODE 1)
# adding a fake dependency to serialize builds of ljamalg.c that needs memory
add_dependencies(luajit-static libluajit)
ELSE()
....
Another option (to which we have resorted at the moment) is to explicitly serialize make commands in distro/install.sh :
(make 2>&1 luajit-static || exit 1)
(make 2>&1 || exit 1)
(make install 2>&1 || exit 1)
In file included from /opt/torch/exe/luajit-rocks/luajit-2.1/src/ljamalg.c:67:0:
/opt/torch/exe/luajit-rocks/luajit-2.1/src/lj_opt_fold.c: In function 'lj_opt_fold':
/opt/torch/exe/luajit-rocks/luajit-2.1/src/lj_opt_fold.c:2408:18: warning: implicit declaration of function 'fold_hashkey' [-Wimplicit-function-declaration]
uint32_t h = fold_hashkey(k);
^
/opt/torch/exe/luajit-rocks/luajit-2.1/src/lj_opt_fold.c:2409:19: error: 'fold_hash' undeclared (first use in this function)
uint32_t fh = fold_hash[h]; /* Lookup key in semi-perfect hash table. */
^
/opt/torch/exe/luajit-rocks/luajit-2.1/src/lj_opt_fold.c:2409:19: note: each undeclared identifier is reported only once for each function it appears in
In file included from /opt/torch/exe/luajit-rocks/luajit-2.1/src/lj_jit.h:10:0,
from /opt/torch/exe/luajit-rocks/luajit-2.1/src/lj_trace.h:12,
from /opt/torch/exe/luajit-rocks/luajit-2.1/src/lj_gc.c:27,
from /opt/torch/exe/luajit-rocks/luajit-2.1/src/ljamalg.c:31:
/opt/torch/exe/luajit-rocks/luajit-2.1/src/lj_opt_fold.c:2411:29: error: 'fold_func' undeclared (first use in this function)
ref = (IRRef)tref_ref(fold_funcfh >> 24);
.....
make[2]: *** [exe/luajit-rocks/luajit-2.1/CMakeFiles/libluajit.dir/src/ljamalg.c.o] Error 1
make[1]: *** [exe/luajit-rocks/luajit-2.1/CMakeFiles/libluajit.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: *** [exe/luajit-rocks/luajit-2.1/CMakeFiles/luajit-static.dir/src/ljamalg.c.o] Error 1
make[1]: *** [exe/luajit-rocks/luajit-2.1/CMakeFiles/luajit-static.dir/all] Error 2
make: *** [all] Error 2
The text was updated successfully, but these errors were encountered:
Recently we encountered intermittent failures while building luajit in parallel on a build server.
The error diagnostic appeared to be completely misleading (see below). It seemed almost like we missed a dependency to the generated file.
After some digging, I have concluded that generated dependencies are fine - also, should the file with macro definition be missing, first error should have been about that include file not found, unless we have some real bad header eclipsing issues here.
Another plausible explanation would be memory exhaustion that is somehow 'gracefully' handled by the compiler. The log shows that we had 2 huge amalgam files built in parallel.
I think the best way to fix it would be to add direct dependency between liajit and luajit-static targets:
IF(WITH_AMALG)
add_library(libluajit SHARED src/ljamalg.c ${DEPS} )
add_library(luajit-static STATIC src/ljamalg.c ${DEPS} )
set_property(TARGET luajit-static PROPERTY POSITION_INDEPENDENT_CODE 1)
# adding a fake dependency to serialize builds of ljamalg.c that needs memory
add_dependencies(luajit-static libluajit)
ELSE()
....
Another option (to which we have resorted at the moment) is to explicitly serialize make commands in distro/install.sh :
(make 2>&1 luajit-static || exit 1)
(make 2>&1 || exit 1)
(make install 2>&1 || exit 1)
@soumith, please take a look.
Here is the build log showing the issue:
In file included from /opt/torch/exe/luajit-rocks/luajit-2.1/src/ljamalg.c:67:0:
/opt/torch/exe/luajit-rocks/luajit-2.1/src/lj_opt_fold.c: In function 'lj_opt_fold':
/opt/torch/exe/luajit-rocks/luajit-2.1/src/lj_opt_fold.c:2408:18: warning: implicit declaration of function 'fold_hashkey' [-Wimplicit-function-declaration]
uint32_t h = fold_hashkey(k);
^
/opt/torch/exe/luajit-rocks/luajit-2.1/src/lj_opt_fold.c:2409:19: error: 'fold_hash' undeclared (first use in this function)
uint32_t fh = fold_hash[h]; /* Lookup key in semi-perfect hash table. */
^
/opt/torch/exe/luajit-rocks/luajit-2.1/src/lj_opt_fold.c:2409:19: note: each undeclared identifier is reported only once for each function it appears in
In file included from /opt/torch/exe/luajit-rocks/luajit-2.1/src/lj_jit.h:10:0,
from /opt/torch/exe/luajit-rocks/luajit-2.1/src/lj_trace.h:12,
from /opt/torch/exe/luajit-rocks/luajit-2.1/src/lj_gc.c:27,
from /opt/torch/exe/luajit-rocks/luajit-2.1/src/ljamalg.c:31:
/opt/torch/exe/luajit-rocks/luajit-2.1/src/lj_opt_fold.c:2411:29: error: 'fold_func' undeclared (first use in this function)
ref = (IRRef)tref_ref(fold_funcfh >> 24);
.....
make[2]: *** [exe/luajit-rocks/luajit-2.1/CMakeFiles/libluajit.dir/src/ljamalg.c.o] Error 1
make[1]: *** [exe/luajit-rocks/luajit-2.1/CMakeFiles/libluajit.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: *** [exe/luajit-rocks/luajit-2.1/CMakeFiles/luajit-static.dir/src/ljamalg.c.o] Error 1
make[1]: *** [exe/luajit-rocks/luajit-2.1/CMakeFiles/luajit-static.dir/all] Error 2
make: *** [all] Error 2
The text was updated successfully, but these errors were encountered: