View previous topic :: View next topic |
Author |
Message |
narayanamoorthy_k
Joined: 19 Jun 2014 Posts: 142 Location: Chennai, IN
|
Posted: Thu Jun 26, 2014 6:03 am Post subject: make file to build executable in fortran |
|
|
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 _________________ Thanks and Regards
Moorthy |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7936 Location: Salford, UK
|
Posted: Thu Jun 26, 2014 6:55 am Post subject: |
|
|
You will find instructions and examples in ftn95.chm under FTN95->Using MK32. |
|
Back to top |
|
|
narayanamoorthy_k
Joined: 19 Jun 2014 Posts: 142 Location: Chennai, IN
|
Posted: Thu Jun 26, 2014 7:14 am Post subject: |
|
|
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.. _________________ Thanks and Regards
Moorthy |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2560 Location: Sydney
|
Posted: Thu Jun 26, 2014 1:11 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
narayanamoorthy_k
Joined: 19 Jun 2014 Posts: 142 Location: Chennai, IN
|
Posted: Thu Jun 26, 2014 1:30 pm Post subject: |
|
|
Thanks John.. let me try.. _________________ Thanks and Regards
Moorthy |
|
Back to top |
|
|
narayanamoorthy_k
Joined: 19 Jun 2014 Posts: 142 Location: Chennai, IN
|
Posted: Thu Jun 26, 2014 2:56 pm Post subject: |
|
|
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] _________________ Thanks and Regards
Moorthy |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7936 Location: Salford, UK
|
Posted: Thu Jun 26, 2014 6:07 pm Post subject: |
|
|
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...
Code: | double precision,allocatable::arr(:,:)
n = 32000
allocate(arr(n,n))
end |
|
|
Back to top |
|
|
narayanamoorthy_k
Joined: 19 Jun 2014 Posts: 142 Location: Chennai, IN
|
Posted: Thu Jun 26, 2014 6:20 pm Post subject: |
|
|
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 _________________ Thanks and Regards
Moorthy |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7936 Location: Salford, UK
|
Posted: Thu Jun 26, 2014 8:29 pm Post subject: |
|
|
This seems odd. Can you supply a small program that illustrates the error report? |
|
Back to top |
|
|
narayanamoorthy_k
Joined: 19 Jun 2014 Posts: 142 Location: Chennai, IN
|
Posted: Fri Jun 27, 2014 7:07 am Post subject: |
|
|
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 _________________ Thanks and Regards
Moorthy |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7936 Location: Salford, UK
|
Posted: Fri Jun 27, 2014 11:32 am Post subject: |
|
|
The error reports describes a bug in your program which you need to identify and fix. |
|
Back to top |
|
|
|