[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::digital_unix

Title:DIGITAL UNIX(FORMERLY KNOWN AS DEC OSF/1)
Notice:Welcome to the Digital UNIX Conference
Moderator:SMURF::DENHAM
Created:Thu Mar 16 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:10068
Total number of notes:35879

9790.0. "Alpha not correctly noticing file was updated" by DV780::ENGQUIST (Eric Engquist) Mon May 12 1997 18:41

    A couple of months ago, a group here at Sandia National Labs was seeing
    a problem that caused make to fail.  The problem looks like the alpha
    compiles code so fast that make doesn't always work.  
    
    Well we just had it happen with another group and I have the code.  The
    problem seems that make isn't working correctly in passing $? in
    an ar. 
    
    We have a makefile that basically is compiling routines in a library. 
    Something
    like:
    .
    .
    .
    SRCS =  \
    ffistr.f frefld.f getinp.f quoted.f stripb.f gsupev.f
    OBJS = ${SRCS:.f=.o}
    
    .SUFFIXES: .F .f .c
    .c.o:
            $(RM) $@
            $(CC) -c $(CFLAGS) $*.c
    .f.o:
            $(RM) $@
            $(FC) -c $(STATICFLAGS) $(FFLAGS) $*.f
    .F.f:
            $(RM) $@
            $(CPP) -P $(F77CPPFLAGS) $*.F $*.f
    .F.o:
            $(RM) $@
            $(CPP) -P $(F77CPPFLAGS) $*.F $*.f
            $(FC) -c $(STATICFLAGS) $(FFLAGS) $*.f
    
    all:: ../libsupes.a
    ../libsupes.a:: $(OBJS)
            $(AR) $@ $?
            $(RANLIB) $@
    libsupes.a:: ../libsupes.a
     
    
    
    
    What happens is on the ar line, not all the newly compiled .o's are
    picked
    up.  You would see on a couple of the .o's on the ar command.
    
    You would do a make clean which removes the .a and all the .o's.
    
    Then your would do a make all.
    
    If you look at the output of the make you would see:
    
    making supesdp  in libraries/supesdp/fre_fld...
    rm -f ffistr.o
    f77 -c   -static -tune host -arch host -fast  -I./  -I/usr2/Access/inc
    ffistr.f
    rm -f frefld.o
    
    f77 -c   -static -tune host -arch host -fast  -I./  -I/usr2/Access/inc
    frefld.f
    rm -f getinp.o
    f77 -c   -static -tune host -arch host -fast  -I./  -I/usr2/Access/inc
    getinp.f
    rm -f quoted.o
    f77 -c   -static -tune host -arch host -fast  -I./  -I/usr2/Access/inc
    quoted.f
    rm -f stripb.o
    f77 -c   -static -tune host -arch host -fast  -I./  -I/usr2/Access/inc
    stripb.f
    rm -f gsupev.o
    f77 -c   -static -tune host -arch host -fast  -I./  -I/usr2/Access/inc
    gsupev.f
    ar clrs ../libsupes.a gsupev.o
    ranlib -t ../libsupes.a
    
    Then the make would fail with Unresolved which was due to the routines
    not being in the library.  (e.g.)
    Unresolved:
    frefld_
    
    If you change the $? in the AR to $(OBJS) it seems to fix it.  However
    when I talked with Sandia, they said even that doesn't work.  They said
    if
    you have several directories, one that has a couple of small programs
    and others, that typically they would not see the code from the smalll
    directories included in the ar.
    
    Any help would be appreciated.  We are competing with SGI, SUN and HP
    on this bid.  About 60 workstations are going to be bid.
    
    -Eric Engquist
     [email protected] (SNL address)
     [email protected] (DEC address)
     (505) 844-0974 (SNL)
             (505) 343-7252
    
T.RTitleUserPersonal
Name
DateLines
9790.1Too fast considered harmful?!TLE::EKLUNDAlways smiling on the inside!Tue May 13 1997 12:0313
    	You asserted that it "compiles code so fast that make doesn't
    always work."  Could you elaborate on why you think the speed of
    compilation contributes to this problem?  I don't have the
    foggiest notion of how make deals with file dates (you have to
    understand that I don't use make, since I like to take advantage
    of all the benefits of compiling everything at once - inlining,
    etc.).  I'd like to know whether anyone thinks the compiler(s)
    should do something about this (other than slow down!).
    
    Cheers!
    Dave Eklund
    (who admits to helping to speed up the compiler...)
      
9790.2Unique timestamps? Or NFS problem??HELIX::SONTAKKETue May 13 1997 12:216
    I wonder if being the "fast compiler" implies identical time stamp on
    the both source and obj file.  I still don't know why and how that will
    confuse make, but the recently discussed MICRO_TIME option would
    eliminate that as a possibility.
    
    - Vikas
9790.3Fast is GOOD!DV780::ENGQUISTEric EngquistTue May 13 1997 16:4612
    .1 - No, I think it is great, this problem was only every seen on a
         Cray.  Hence it does make us look real good.
    
         Make looks a time stamps to determine if a piece of code
         should be remade or not.  In the ar statement the $? is
         too do the archive on all the .o's that have changed. The
         fix that Cray did was to make sure that the date was
         checked to see if it was less than or equal.
    
    .2 - We did turn on MICRO_TIME, to no avail.  I need to check the
         kernel to make sure it is really on.  
    
9790.4TLE::EKLUNDAlways smiling on the inside!Tue May 13 1997 17:475
    	Are these nfs mounted disks?
    
    Cheers!
    Dave Eklund
    
9790.5HELIX::SONTAKKEWed May 14 1997 14:346
How does make handle case where the source and the object reside on
different nfs server?  OR rather how does NFS handle the timestamp?  A
clock skew on server/client could cause quite a grief if you don't have
synchronized time.

- Vikas
9790.6DECWET::MARTINWed May 14 1997 15:183
The timestamp for an NFS-served file is set to the time the client thinks it is.
So if source and object are both being modified from the same machine, even if
they're NFS served from different machines, make will work correctly.
9790.7Not NFS'edDV780::ENGQUISTEric EngquistWed May 14 1997 23:5713
    This is local code on the machine.  It is not NFS mounted.  I have
    a segment of the code and it is strange how it behaves on the make.  I
    did turn on MICRO_TIME and off KDEBUG to see if that was the problem.
    I have a tar of it, and played with it the other night.  I would do a
    make clean, then a make.  Each time it would get an unresolved
    due to one or more .o's not included in the archive.  It seems to
    be related to the ar $?.  If I use ar $(OBJS) it works.  $?
    says to include only the .o's that were made.  If you look at the
    makefile output the .o is made.  Each time you run it you get 
    a different error.  I am going to try it on my DEC 3000 which is slower
    and also on a 400MHz 500 I have to see what happens there.  Both
    of those are 4.0B.  The machine having the issue is 433au running 4.0c
    
9790.8NNTPD::"[email protected]"Shashi MangalatSat May 17 1997 00:3813
This may be an msync(2) problem.  As I understand it, ld now uses mmap() and
msync() to write the object files.  msync() has a known problem with not
updating file modification times.  Although the interface is msync() the
time stamps are updated by the underlying file system.  As far as I know both
UFS and AdvFS have problems with msync() and modification times.  A problem
report was filed some time back regarding the msync() behaviour on AdvFS.
Sorry, I don't know the current status of it.

You might want to check the file modification time manually after an
object module is built to verify the above.

--shashi
[Posted by WWW Notes gateway]
9790.9COL01::LINNARTZSun May 25 1997 07:3919
    Eric, give the "/usr/opt/ultrix/usr/bin/make" a try. I had similar
    problems with some objects not being fetched by using the standard
    make.
    I QAR'ed it first, but it end up in a discussion on how big the example
    makefile should be which is fed into a QAR and that make will soon
    change to standard POSIX and by this the problems should get solved.
    As I had different priorities, I changed softlinks to and PATH var
    that the "ultrix make is fetched first, which stopped at least customers
    compalint's. Our make isn't to good (also has some problems with
    white space) but after all the mail conversations with the engineer
    I've put myself on the hopers waitlist to get fixed in next release.
    
    By reading .-1 I'm not totally convinced that this is due to msync, as
    this should happen with the ultrix make too. If you want to look at the 
    timestamps, use the make options "-npd" which outputs you the
    timestamps (with a LOT" of other internal info)
    
    Pit