forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

make file to build executable in fortran

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Plato
View previous topic :: View next topic  
Author Message
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 142
Location: Chennai, IN

PostPosted: Thu Jun 26, 2014 6:03 am    Post subject: make file to build executable in fortran Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Thu Jun 26, 2014 6:55 am    Post subject: Reply with quote

You will find instructions and examples in ftn95.chm under FTN95->Using MK32.
Back to top
View user's profile Send private message AIM Address
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 142
Location: Chennai, IN

PostPosted: Thu Jun 26, 2014 7:14 am    Post subject: Reply with quote

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
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Thu Jun 26, 2014 1:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 142
Location: Chennai, IN

PostPosted: Thu Jun 26, 2014 1:30 pm    Post subject: Reply with quote

Thanks John.. let me try..
_________________
Thanks and Regards
Moorthy
Back to top
View user's profile Send private message
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 142
Location: Chennai, IN

PostPosted: Thu Jun 26, 2014 2:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Thu Jun 26, 2014 6:07 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 142
Location: Chennai, IN

PostPosted: Thu Jun 26, 2014 6:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Thu Jun 26, 2014 8:29 pm    Post subject: Reply with quote

This seems odd. Can you supply a small program that illustrates the error report?
Back to top
View user's profile Send private message AIM Address
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 142
Location: Chennai, IN

PostPosted: Fri Jun 27, 2014 7:07 am    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Fri Jun 27, 2014 11:32 am    Post subject: Reply with quote

The error reports describes a bug in your program which you need to identify and fix.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Plato All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group