Compile fails when parallel compiling. Compiling of main.cc includes not yet generated version.h file: cat ./version_base.in version_tag.h > version.h x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -Wall -march=k8 -Os -pipe -m3dnow -MD -c main.cc -o main.o x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -Wall -march=k8 -Os -pipe -m3dnow -MD -c async.cc -o async.o mv async.d dep/async.d x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -Wall -march=k8 -Os -pipe -m3dnow -MD -c design_dump.cc -o design_dump.o main.cc: In function ‘int main(int, char**)’: main.cc:611: error: ‘VERSION’ was not declared in this scope main.cc:611: error: ‘VERSION_TAG’ was not declared in this scope Reproducible: Always Steps to Reproduce: 1. Set MAKEOPTS="-j2" in make.conf 2. Run compile of iverilog-0.9.1 3. Watch fail
Created attachment 211125 [details, diff] Proposed patch Force make to use "-j1"
While I can not reproduce the mentioned problem on some different machines with -j2..-j5 there really is a problem in the Makefile.in. Line 74 from Makefiel.in reads all: dep config.h _pli_types.h version.h ivl In a parallel make it starts the creation of version.h and the compilation of all in parallel. Some of the sources needs version.h (see reported error). The following patch request for all sources (hopefully), that version.h gets build 'before' any compilation of *.cc files to *.o. That fixes the problem for me, but maybe there are some more problems....
Created attachment 222045 [details, diff] Fixe for iverilog-0.9.1.ebuild to fix parallel make issue in Makefile.in
It was fixed by an -j in versions 0.9.1 and 0.9.3. I've added 0.9.5 today without emake -j1, it doesn't exhibit this problem - so far.