Find the answer to your Linux question:
Results 1 to 10 of 10
I have made and compiled a programme,but the calculations are not good,because it has somehow problems with findfiff2d.o file(calulates travel-times on nodes).May be the problem is that findiff2d calls 6 ...
  1. #1
    Just Joined!
    Join Date
    May 2010
    Posts
    41

    fortran makefile problem!

    I have made and compiled a programme,but the calculations are not good,because it has somehow problems with findfiff2d.o file(calulates travel-times on nodes).May be the problem is that findiff2d calls 6 other subroutines.So main=>findiff2d=>expand,sort,pass,stensilcs2d,fnod e,fside.So how to tell them to look for these 6 subroutines?
    My makefile:
    FC= ifort
    LD = ifort
    FCFLAGS = -O2 -g
    LDFLAGS = $(FCFLAGS)
    # Executables
    main: main.o model.o findiff2d.o findnode.o timenearsrc.o readsrc.o fnode.o expand.o fside.o sort.o pass.o stencils2d.o find.o timeinterp.o timeinterp2d.o timelinear.o time1d.o timeb2d.o timec2d.o blkdat.o fd.par fd.com
    $(FC) $(FCLAGS) -o main main.o model.o findiff2d.o findnode.o timenearsrc.o readsrc.o fnode.o expand.o fside.o sort.o pass.o stencils2d.o find.o timeinterp.o timeinterp2d.o timelinear.o time1d.o timeb2d.o timec2d.o blkdat.o

    What should I change?

  2. #2
    drl
    drl is offline
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Location
    Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
    Posts
    1,117
    Hi.

    The easiest action to take seems to change the makefile to look like:
    Code:
    FC= ifort
    # LD = ifort
    FCFLAGS = -O2 -g
    LDFLAGS = $(FCFLAGS)
    
    main: main.o sub.o
    	$(FC) -o $@ $^
    which, for the short files main.f and sub.f, then make will produce:
    Code:
    % make
    ifort   -c -o main.o main.f
    ifort   -c -o sub.o sub.f
    ifort -o main main.o sub.o
    Best wishes ... cheers, drl
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

  3. #3
    Just Joined!
    Join Date
    May 2010
    Posts
    41
    Thanks drl.I am going to try now.

  4. #4
    Just Joined!
    Join Date
    May 2010
    Posts
    41
    $(FC) -c $(FCLAGS) -o $@ $^ main main.o model.o findiff2d.o findnode.o timenearsrc.o readsrc.o fnode.o expand.o fside.o sort.o pass.o stencils2d.o find.o timeinterp.o timeinterp2d.o timelinear.o time1d.o timeb2d.o timec2d.o blkdat.o

    There isn't any change,gives me:
    make: `main' is up to date.

  5. #5
    drl
    drl is offline
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Location
    Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
    Posts
    1,117
    Hi.
    Quote Originally Posted by milosavpejic View Post
    ... There isn't any change,gives me:
    make: `main' is up to date.
    That's a status, not an error.

    Do you have a specific error condition? ... cheers, drl
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

  6. #6
    Just Joined!
    Join Date
    May 2010
    Posts
    41
    So far as I know,I don't have error condition.Problem is that he does not see these variables.

  7. #7
    drl
    drl is offline
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Location
    Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
    Posts
    1,117
    Hi.
    Quote Originally Posted by milosavpejic View Post
    So far as I know,I don't have error condition.Problem is that he does not see these variables.
    What variables? ... cheers, drl
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

  8. #8
    Just Joined!
    Join Date
    May 2010
    Posts
    41
    $@ $^
    How do you call this up?Yes there are not variables.

  9. #9
    drl
    drl is offline
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Location
    Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
    Posts
    1,117
    Hi.
    Quote Originally Posted by milosavpejic View Post
    $@ $^
    How do you call this up?Yes there are not variables.
    If you are asking what these symbols mean, then here is a reference:
    Code:
    # Automatic Variables set after a rule match:
    #
    #   $@  Filename representing the target
    #   $%  Filename element of archive member specification
    #   $<  Filename of the first prerequisite
    #   $?  Names of all prerequisites newer than target, space separated
    #   $^  Names of all prerequisites, duplicates removed, spaced
    #   $+  Same as $^, but with duplicates removed, spaced
    #   $*  Stem of the target - typically file without suffix
    #   GNU make, 3rd, pages 16-17
    Best wishes ... cheers, drl
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

  10. #10
    Just Joined!
    Join Date
    May 2010
    Posts
    41
    Thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...