bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #19309] parallel make issue with archive members


From: anonymous
Subject: [bug #19309] parallel make issue with archive members
Date: Mon, 12 Mar 2007 02:09:00 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7

URL:
  <http://savannah.gnu.org/bugs/?19309>

                 Summary: parallel make issue with archive members
                 Project: make
            Submitted by: None
            Submitted on: Monday 03/12/2007 at 02:08 UTC
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: 3.81
        Operating System: POSIX-Based
           Fixed Release: None

    _______________________________________________________

Details:

Hello,

I am having issues with parallel make and archive members.  I have a rule
which puts all the changed objects in the same archive.  However, it doesn't
work with the parallel "make -j2" option.

1. Copy this Makefile into a directory and create some files.
mkdir makeprob
cd makeprob
touch foo1.cc
touch foo2.cc
touch foo3.cc
touch foo4.cc

2. Create destination directory:
mkdir /tmp/dest

3. Do a make -j2 and it works fine:
> make -j2
g++   -c -o /tmp/dest/foo1.o foo1.cc
g++   -c -o /tmp/dest/foo2.o foo2.cc
g++   -c -o /tmp/dest/foo3.o foo3.cc
g++   -c -o /tmp/dest/foo4.o foo4.cc
cd /tmp/dest; \
        ar rv libfoo.a foo1.o foo2.o foo3.o foo4.o;
ar: creating libfoo.a
a - foo1.o
a - foo2.o
a - foo3.o
a - foo4.o

4. touch all the .cc files and do another make -j2 and it does not load the
archive work without doing a second make:
> touch *cc
> make -j2
g++   -c -o /tmp/dest/foo1.o foo1.cc
g++   -c -o /tmp/dest/foo2.o foo2.cc
g++   -c -o /tmp/dest/foo3.o foo3.cc
g++   -c -o /tmp/dest/foo4.o foo4.cc
cd /tmp/dest; \
        ar rv libfoo.a ;
> make -j2
cd /tmp/dest; \
        ar rv libfoo.a /tmp/dest/foo1.o /tmp/dest/foo2.o /tmp/dest/foo3.o
/tmp/dest/foo4.o;
r - /tmp/dest/foo1.o
r - /tmp/dest/foo2.o
r - /tmp/dest/foo3.o
r - /tmp/dest/foo4.o 

5. Do the same procedure with single threaded make and it works fine:
> touch *.cc
> make
g++   -c -o /tmp/dest/foo1.o foo1.cc
g++   -c -o /tmp/dest/foo2.o foo2.cc
g++   -c -o /tmp/dest/foo3.o foo3.cc
g++   -c -o /tmp/dest/foo4.o foo4.cc
cd /tmp/dest; \
        ar rv libfoo.a foo1.o foo2.o foo3.o foo4.o;
r - foo1.o
r - foo2.o
r - foo3.o
r - foo4.o

It is my suspicion this has something to do with vpath and parallel make. 
Please let me know if you are able to reproduce this.  This was not an issue
before I started using VPATH and a destination directory outside of the
source area.  My temporary fix is to change the $? in the archive rule to
$(CXX_OBJS).  This is make 3.81 and I am able to reproduce it on both a 32
bit and a 64 bit gentoo system.

I tried the same tests at work and it seems that many of the most recent
versions of Make exhibit this issue.

Thanks,
Juan




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Monday 03/12/2007 at 02:08 UTC  Name: Makefile  Size: 302B   By: None
Makefile exhibiting issue.
<http://savannah.gnu.org/bugs/download.php?file_id=12181>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?19309>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]