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 

Release win32

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



Joined: 21 Dec 2010
Posts: 81

PostPosted: Wed Feb 02, 2011 5:51 pm    Post subject: Release win32 Reply with quote

Hi,
Can someone explain what the above is wrt to compiling a programme.

My compiling as thus far been done under the 'default' degug 32. From which the programmes run ok etc...i believe its some kind of final release programme version? But what does it do exactly - it appears to do little different from what I have tried?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Feb 02, 2011 10:57 pm    Post subject: Reply with quote

"Release" has no debugging features.
"Debug" allows basic debugging allowing you to step through the program line by line etc.
"Checkmate" provides debugging and also various automatic runtime checking features.
Back to top
View user's profile Send private message AIM Address
colt1954



Joined: 21 Dec 2010
Posts: 81

PostPosted: Thu Feb 10, 2011 2:21 pm    Post subject: Ok But Reply with quote

So what do you use Release for, what does it do if you compile with that set...

Also can you explain why I often get a compilation failed but with no explanation...its usually something trivial but finding it can take an age...

Can you suggest a better way of dealing with this please?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu Feb 10, 2011 5:42 pm    Post subject: Reply with quote

Release mode is used when you have finished developing a program and you want to use it or send it to an end user. It will be faster and more efficient tha one of the debugging modes.

You should always get a good and clear failure message. If you are using Plato then these should appear in the Output window. Sometimes FTN95 falls short of this and I rely on users telling me about these cases.
Back to top
View user's profile Send private message AIM Address
colt1954



Joined: 21 Dec 2010
Posts: 81

PostPosted: Fri Feb 11, 2011 8:28 pm    Post subject: Hmmmm Reply with quote

Still unclear about release mode when you say faster to run an executable afterwards? Surely thats not what you mean?..

As to getting clear messages well thats precisley it, you do not get that it happens for trivial errors e.g. you have missed out a statement number or there is a small typed error....its not always clear it just states 'compilation has failed' and thats it !!!
The only way round it is to comment out areas that you have updated/changed its a process of elimination, or go back to a saved program earlier version, if you have one not too altered etc
Back to top
View user's profile Send private message
DrTip



Joined: 01 Aug 2006
Posts: 74
Location: Manchester

PostPosted: Fri Feb 11, 2011 10:48 pm    Post subject: Reply with quote

Paul means what he says

the release version is optimised to run quicker, try it on on a simple piece of code.

code running in debug mode has lots of checks to make sure things are all tickety boo. In release version these checks are removed (because the coding teams has done lots of test to make sure there are no problems like arrays indices going out of bounds and the like) and the code runs quicker.

on top of this the compiler is free to muck about with the binary code it produces to make it run quicker (obviously there are going to be no problems with this because of all of the tests...)

regarding error messages well they are generally pretty cryptic regardless of which compiler and language you are using when you start out. This is pretty much because you make lots of syntax errors and the compiler can't help much. believe it or not ftn95 is probably the least opaque fortran compilers on this front.

Have a go with the F# compiler if you want really cryptic error messages, or the visual studio c++ compiler.

Carl
Back to top
View user's profile Send private message
colt1954



Joined: 21 Dec 2010
Posts: 81

PostPosted: Sat Feb 12, 2011 4:11 pm    Post subject: Hi Carl Reply with quote

Will try the the release version but must say even with the large program I am using using the other modes its still bloody quick to run...seconds and it does alot of number crunching.

Beside surely testing it out a simple program will we not be comparing milli seconds to milliseconds!!!!!
Back to top
View user's profile Send private message
DrTip



Joined: 01 Aug 2006
Posts: 74
Location: Manchester

PostPosted: Sun Feb 13, 2011 10:41 am    Post subject: Reply with quote

yes your right if your program is quick optimisation will not be noticable.

but try doing things with many loops may be something like


n = 1000000
tot = 0.0
do i = n,1

tot = tot + 1.0/n

end do



also you need to do your test on the command line because the ide will slow things down whatever.


if it too quick to notice just make n bigger!

of course you have to think of a way of timing your code but I will leave that you its not too hard!



Carl
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Mon Feb 14, 2011 1:17 am    Post subject: Reply with quote

I assume /release mode is no compile option or possibly /opt.
Compiling with /debug mode provides more help finding errors that may occur when running your program. /debug mode includes the file and line number of the code where the error occurred.
Without debug mode, all you get is a memory address. There are also a reduced number of errors that are tested.
I always prefer /debug, as it gives me more information to try and identify the error, while not significantly compromising the run time.
Actually I have the program broken down into a number of files, with a range of compile options:
/check for routines that read data and allocate information to arrays. It checks array bound errors.
/debug for control routines that manage the program or have a small fraction of the total run time. If they are more likely to have an error this option at least gives the code line address.
/p6 /opt for compute intensive parts of the run that are fairly stable. (unlikely to have any errors).
If you are providing your .exe to third parties, you have to decide how much info is to be provided, but where you are providing a program to someone else, you do have to write more code that checks the validity of the data input, ie you replace the compiler checking by your own explicit data checking code.
Using /check in the data input section is my easy way of using the compiler to check my data.
The most common error is exceeding the size of an array and the most common array failure is addressing (zero), ie not defining an index value.

You find the code that contributes 80% of the run time and compile with /opt. It is typically only 20% of the code. Actually, I often find 1% of the code is 99% of the run time, so make sure there are no bugs in this and then compile the rest with /check of /debug.

John
Back to top
View user's profile Send private message
colt1954



Joined: 21 Dec 2010
Posts: 81

PostPosted: Tue Feb 15, 2011 4:58 pm    Post subject: Re: Reply with quote

DrTip wrote:
yes your right if your program is quick optimisation will not be noticable.

but try doing things with many loops may be something like


n = 1000000
tot = 0.0
do i = n,1

tot = tot + 1.0/n

end do



also you need to do your test on the command line because the ide will slow things down whatever.


if it too quick to notice just make n bigger!

of course you have to think of a way of timing your code but I will leave that you its not too hard!



Carl


Will try above but running from CM does not speed things up or moreover running from PLATO is not slower...at least on my program which is quite a number cruncher!

Sorry to be a pedant have now checked out the above run times there is no discernable difference in run times either in Plato or in command mode for both checkmate and release modes...even when I increased the loop size by factor 10
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1886

PostPosted: Tue Feb 22, 2011 11:50 am    Post subject: Re: Reply with quote

Code:
n = 1000000
do i = n,1
   ...
end do

is a zero-trip do loop. If you want the loop to be run n times, change to "do i=1,n".
Back to top
View user's profile Send private message
colt1954



Joined: 21 Dec 2010
Posts: 81

PostPosted: Tue Feb 22, 2011 7:10 pm    Post subject: Hmm Reply with quote

Yes you are correct a silly error..however there is still little difference when looped correctly as far as I can tell?
Back to top
View user's profile Send private message
DrTip



Joined: 01 Aug 2006
Posts: 74
Location: Manchester

PostPosted: Tue Feb 22, 2011 9:17 pm    Post subject: Reply with quote

actually the loop should have been

do n,1,-1

because for this sort of sum an accurate answer requires adding the smallest numbers first, and therefore the loop has to go backwards

but your are correct I mistyped the code!

Carl
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General 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