Silverfrost Forums

Welcome to our forums

make file to build executable in fortran

26 Jun 2014 5:03 #14268

Hi All I have multiple f95 files. I like to run a make file to compile & link the objs to create the executable files. I am using Silverfrost FTN95 Express.. Can any one help me with the sample make file for multiple f95 files compilation and linking... I tried so many options using FTN95 and SLINK, but it is failing.. Can anybody help with the perfect make file with whatever autoexec.bat configurations. I am using WIndows 7.. Thanks in advance

26 Jun 2014 5:55 #14269

You will find instructions and examples in ftn95.chm under FTN95->Using MK32.

26 Jun 2014 6:14 #14270

Hi Paul Thanks. I followed them, but not helpful. See the makefile that I used..

Step1.exe: Step1.obj store1.obj step1_arrayhandle.obj slink step1.lnk

Step1.obj: Step1.f95 ftn95 d:\c00\lfa\step1 /check

store1.obj: store1.f95 ftn95 d:\c00\lfa\store1 /check

step1_arrayhandle.obj: step1_arrayhandle.f95 ftn95 d:\c00\lfa\step1_arrayhandle /check

It says.. step1.lnk is missing.. any clues..

26 Jun 2014 12:11 #14275

The .lnk suffix is probably a bad choice of file extension name. Try changing the name of slink.lnk to slink.txt, making sure slink.txt contains the valid commands to link the program

John

26 Jun 2014 12:30 #14277

Thanks John.. let me try..

26 Jun 2014 1:56 #14279

Hi John The make file is working perfectly.. Thanks a lot for your help..

But I have another problem in compiler & linker... When I use /CHECK option in compilation, it gives error saying 'Salford Run-time library. Insufficient memory available for CHECK mode. Fatal run-time error' How do I get over this. I have Win7 OS and fine. The same in normal mode (without /CHECK), it runs fine.

Can you help me to fix this.

Thanks & Regards Narayanamoorthy

[/img]

26 Jun 2014 5:07 #14282

We need an estimate of how much memory you need.

Do you have large arrays? How many elements? How many bytes per element?

Given an estimate of the total size, we can then determine if the error report is spurious or if you might be reaching the limit.

Alternatively, try a short program like the following and iterate with n to find out when your error occurs...

double precision,allocatable::arr(:,:)
n = 32000
allocate(arr(n,n))
end
26 Jun 2014 5:20 #14283

Hi Paul Thanks for your reply. I use the arrays of array1(25:25) and array2(500) elements. I use default KIND allocations. I feel this size is very smaller.. But I will be expanding the arrays later.. But for this allocation of arrays, those error appeared..

How this insufficient memory error can be removed?

Thanks in advance

26 Jun 2014 7:29 #14284

This seems odd. Can you supply a small program that illustrates the error report?

27 Jun 2014 6:07 #14285

Hi Paul Good Morning.. Thanks for your reply and sample code. You are right. In my case, it can go upto 64000 size for two-ranked array. However, with /CHECK option, it stopped working while executing the exe file. If I stop the exe execution it displays the following error.

FortranApplication1.exe

Unhandled Exception: System.OverflowException: Arithmetic operation resulted in an overflo w. at FortranApplication1.MAIN() in D:\C00\t00.F95:line 9

Whereas, without /CHECK option, it is done without any runtime error. In that case, it runs smoothly for even n=292000.. How do I handle this in case of /CHECK option incorporated to check the errors during run time.. Thanks

27 Jun 2014 10:32 #14286

The error reports describes a bug in your program which you need to identify and fix.

Please login to reply.