[DVDnav-discuss] parallel make problem

Dominik 'Rathann' Mierzejewski dominik at greysector.net
Sat Aug 30 16:05:49 CEST 2008


I'm experiencing a problem with make -j2:

I've added the following patch to make it easily reproducible:
Index: Makefile
===================================================================
--- Makefile    (revision 1122)
+++ Makefile    (working copy)
@@ -76,6 +76,7 @@
 # General targets
 
 $(.OBJDIR):
+       sleep 2
        mkdir $(.OBJDIR)
 
 ${DVDREAD_LIB}: version.h $(.OBJDIR) $(DVDREAD_OBJS) $(BUILDDEPS)


$ make clean && make -j2
rm -rf  *~ obj version.h
sh "/home/rathann/cvs/dvdnav/libdvdread"/version.sh "/home/rathann/cvs/dvdnav/libdvdread" "4.1.3"
sleep 2
cd obj && gcc -fPIC -DPIC -MD -O3  -g -Wall -funsigned-char -I/home/rathann/cvs/dvdnav/libdvdread -I"/home/rathann/cvs/dvdnav/libdvdread"/src -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DHAVE_CONFIG_H -DHAVE_DLFCN_H -I"/home/rathann/cvs/dvdnav/libdvdread"/src -c -o dvd_input.so /home/rathann/cvs/dvdnav/libdvdread/src/dvd_input.c
/bin/sh: line 0: cd: obj: No such file or directory
make: *** [dvd_input.so] Error 1
make: *** Waiting for unfinished jobs....
mkdir obj

Now, I tried this:
Index: Makefile
===================================================================
--- Makefile    (revision 1122)
+++ Makefile    (working copy)
@@ -85,10 +85,10 @@
 ${DVDREAD_SHLIB}: version.h $(.OBJDIR) $(DVDREAD_SHOBJS) $(BUILDDEPS)
        cd $(.OBJDIR) && $(CC) $(SHLDFLAGS) $(LDFLAGS) -ldl -Wl,-soname=$(DVDREAD_SHLIB).$(SHLIB_MAJOR) -o $@ $(DVDREAD_SHOBJS)
 
-.c.so: $(BUILDDEPS)
+.c.so: $(.OBJDIR) $(BUILDDEPS)
        cd $(.OBJDIR) && $(CC) -fPIC -DPIC -MD $(CFLAGS) -c -o $@ $<
 
-.c.o:  $(BUILDDEPS)
+.c.o:  $(.OBJDIR) $(BUILDDEPS)
        cd $(.OBJDIR) && $(CC) -MD $(CFLAGS) -c -o $@ $<
 
 
but it didn't help.
The only thing I could find to fix this is:
Index: Makefile
===================================================================
--- Makefile    (revision 1122)
+++ Makefile    (working copy)
@@ -168,3 +168,5 @@
 # include dependency files if they exist
 $(addprefix ${.OBJDIR}/, ${DEPS}): ;
 -include $(addprefix ${.OBJDIR}/, ${DEPS})
+
+.NOTPARALLEL: $(.OBJDIR)

But I'd rather have a proper fix instead of workarounds.
Ideas?

Regards,
R.

-- 
Fedora http://fedoraproject.org/wiki/User:Rathann
Livna http://rpm.livna.org | MPlayer http://mplayerhq.hu
"Faith manages."
        -- Delenn to Lennier in Babylon 5:"Confessions and Lamentations"



More information about the DVDnav-discuss mailing list