Topic: a third-party makefile

Dear All,

I tired to create a Windows 10 executable for a third-party Fortran 90 program called MDTEP.

The authors of the program include several makefiles that they claim should be easily modified for any system. MDTEP has been tested only on Intel Linux and Sun Solaris platforms, but no problems on other systems are anticipated.  I procedded in an authomatic manner by copying all files into one directory that was saved in SF3 as a new project, bulding the project in SF3 with the authomatic creation of a SF3-specific makefile, and producing an executable. Appart from two warnings from the compiler in SF3, everything went smoothly, and a target.exe was produced. However, when I ran the executable with the input file, mymdrun.md, distributed with MDTEP, a Fortran error would always appear:

At line 357 of file .\IO.f90 (unit = 25, file = 'mymdrun.md')
Fortran runtime error: Bad value during floating point read
Error termination.

From what I know, SF3 uses gfortran. The MDTEP developpers
include a gfortran make file in the program they distribute (see blow). However, they also note that GNUMake must be used with the originally distirbuted makefiles, which may be the problem here. I guess, the main question is whether the authomatically-SF3 -- generated makefile will do the same job as an externally provided one (like the one below). If not, I wonder if there is a way to use a third-party makefile in SF3.

Many thanks for any help,
Matthew


F90=gfortran
FFLAGS=-O3
LIBS= -static-libgfortran
MATH_LIBS=
.PRECIOUS: %.o
.PHONY:  clean

%: %.o
%.o: %.f90
    $(F90) $(FFLAGS) -c -o $@ $<
%: %.o
    $(F90) $(FFLAGS) -o $@ $^

mdtep : Constants.o Global.o Utility.o IO.o analyse.o Main.o

    $(F90)  $(FFLAGS) -o mdtep Constants.o Global.o Utility.o IO.o analyse.o Main.o  $(LIBS) $(MATH_LIBS)   
clog :
    -rm *{o,e}[1-9][0-9]*

clean :

    rm -f *.mod *.d *.il *.o work.*
    rm -f mdtep

Re: a third-party makefile

Sorry for the long delay here.  The error you're seeing:

At line 357 of file .\IO.f90 (unit = 25, file = 'mymdrun.md')
Fortran runtime error: Bad value during floating point read
Error termination.

is a runtime error.  Something is going wrong during a file read operation that really has nothing to do with the compiler or makefile.  I would look at the input file and check whether the program is expecting something different.  It might help to do so while running in the debugger to see if you can narrow down exactly where things go wrong.

Simply Fortran using a fork of Open Watcom Make to control the build process.  It is not compatible with GNU Make.  Simply Fortran can export GNU Makefiles, but it can't import or use them directly is they use any GNU extensions (which are almost always present).  We also don't include GNU Make at all with Simply Fortran, so it makes it somewhat complicated to use a GNU Makefile with Simply Fortran. 

If the Makefile is simple, though, you could use our Make system instead (wmake) from the command line, though I don't believe it is on the path by default after installation.

Regardless, the runtime error isn't dependent on the compiler or makefile.

Jeff Armstrong
Approximatrix, LLC