Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel build intermittent failures #39

Open
borisfom opened this issue Feb 10, 2017 · 1 comment
Open

Parallel build intermittent failures #39

borisfom opened this issue Feb 10, 2017 · 1 comment

Comments

@borisfom
Copy link
Contributor

borisfom commented Feb 10, 2017

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

@truetqy
Copy link

truetqy commented Jul 26, 2017

I have the same error here, is it solved?

squeek502 added a commit to squeek502/luv that referenced this issue Jan 29, 2020
Addresses the "'fold_hash' undeclared" compile errors in luvit/luvi#225

See also torch/luajit-rocks#39
Timothy- pushed a commit to luvitred/luv that referenced this issue Apr 17, 2020
Addresses the "'fold_hash' undeclared" compile errors in luvit/luvi#225

See also torch/luajit-rocks#39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants