0

I have several Fortran source files that need to be compiled and link together to form an exe computational code. There is also a makefile.dos in the package but I don't know how to use it to compile the Fortran files.

I tried to compile source files with Intel parallel studio without using the makefile, with

ifort /O3 /QxHost /Qparallel /Qdiag-disable:warn  *.for 

The APP.exe created successfully but it seems that the timer routine has not been compiled properly. Because when I execute the code, the timing of processes are not recorded in the output file. I guess compiling with the makefile may resolve the issue.

Then I tried to compile the Fortran Files with the help of the makefile by:

nmake /f makefile.dos FPP=ifort LINK32=386link

This time I got the following error:

NMAKE : fatal error U1073: don't know how to make 'app.OBJ'

What am I doing wrong? My OS is WINDOWS 10 LTSC.

Here is the content of the makefile (In the code package there are those items that are listed in front of "SRCS" variable below):

FC        = f77l3
LINKER    = 386link
PROGRAM   = APP.exe

DEST      = APP 

EXTHDRS   =  
FFLAGS    = 
HDRS      = 
LDFLAGS   = 
LDMAP     = nul 
LIBS      = 
MAKEFILE  =  Makefile 
OBJS      = APP.OBJ TIMING.OBJ READDA.OBJ APPDL.OBJ PRELUD.OBJ \ 
            FIL1.OBJ FIL2.OBJ FILE3.OBJ FIL4.OBJ FIL5.OBJ \
            FIL6.OBJ FIL7.OBJ FIL8.OBJ FIL9.OBJ \
            FIL11.OBJ FIL12.OBJ FIL13.OBJ  \
            FIL14.OBJ FIL15.OBJ FIL16.OBJ 

SRCS      = APP.FOR TIMING.FOR READDA.FOR APPDL.FOR PRELUD.FOR \ 
            FIL1.FOR FIL2.FOR FIL3.FOR FIL4.FOR FIL5.FOR \
            FIL6.FOR FIL7.FOR FIL8.FOR FIL9.FOR  \ 
            FIL11.FOR FIL12.FOR FIL13.FOR  \ 
            FIL14.FOR FIL15.FOR FIL16.FOR  

STUB      = -stub runb 
 
$(PROGRAM):     $(OBJS) $(LIBS)
         $(LINKER) $(OBJS) $(STUB) -EXE $@ -LIB $(LIBS) $(LDFLAGS) 


APP: $(objects)
    $(FC)  -o $@  $(objects)
veryreverie
  • 2,871
  • 2
  • 13
  • 26
sanati
  • 1
  • 1
  • 2
    Why do you think that it would resolve the issue? What kind of operating system do you use? Windows? We need more information. The error message suggests that it doesn't know how to create the file `APP.OBJ`, and in the makefile there's no rule. It might be that the make program the other person was using knows how to create object files itself (and recognises `.OBJ` as object files, but you might have to add the rule. Have a look at this question: https://stackoverflow.com/questions/35234003/how-to-create-a-makefile-for-a-fortran-program-using-modules/35260489#35260489 – chw21 Apr 16 '22 at 07:17
  • I use WINDOWS 10. I just thought there is a reason that they include the file "makefile.dos" in the package. – sanati Apr 16 '22 at 07:37
  • 1
    It is very unlikely that compiling with a different Makefile will resolve your timing issue. Feel welcome to ask about that specific issue in a different question but many details will be necessary. – Vladimir F Героям слава Apr 16 '22 at 08:10
  • It was a typo. I forgot to type that backslash here. – sanati Apr 16 '22 at 10:35
  • Microsoft's `nmake` is a build-orchestration program inspired by `make`, but it is not compatible with `make`. I don't know what `make` implementation your `makefile.dos` may have been intended for, but `nmake` is unlikely to be it, or to be a suitable substitute. – John Bollinger Apr 16 '22 at 14:00

0 Answers0