Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 294543

Summary: sci-electronics/iverilog failt to compile when usign parallel compile (-j2)
Product: Gentoo Linux Reporter: Piotr Stachura <albert1>
Component: New packagesAssignee: The Soldering-Iron Brotherhood <sci-electronics>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Proposed patch
Fixe for iverilog-0.9.1.ebuild to fix parallel make issue in Makefile.in

Description Piotr Stachura 2009-11-25 08:25:00 UTC
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
Comment 1 Piotr Stachura 2009-11-25 08:26:05 UTC
Created attachment 211125 [details, diff]
Proposed patch

Force make to use "-j1"
Comment 2 Thomas Beierlein gentoo-dev 2010-03-04 17:05:08 UTC
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....
Comment 3 Thomas Beierlein gentoo-dev 2010-03-04 17:07:58 UTC
Created attachment 222045 [details, diff]
Fixe for iverilog-0.9.1.ebuild to fix parallel make issue in Makefile.in
Comment 4 Michael Weber (RETIRED) gentoo-dev 2012-05-25 13:31:30 UTC
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.