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 

Using external procedures, subprograms or functions
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
JohnCampbell



Joined: 16 Feb 2006
Posts: 1959
Location: Sydney

PostPosted: Sat Oct 14, 2017 2:42 am    Post subject: Reply with quote

I agree with Dan, Often a quick video of getting started can be invaluable for someone who has not used a ftn95 "style" compiler before.

A get started script could be as simple as:

Here is a text file of Fortran code, called example.f90.
The .f90 indicates to the compiler it is a file containing Fortran code.
FTN95 is a command, like dir, that can be used in a cmd.exe box to convert the code to binary (named example.obj) than can be used by a linker to generate a run program,

"FTN95 example.f90" generates example.obj
"FTN95 example.f90 /link" generates example.exe, which can be "run"
"FTN95 example.f90 /lgo" will compile and run a Fortran program that is stored in a single file.
SLINK example.obj generates example.exe, which can be "run"
SLINK example.obj file2.obj file3.obj generates example.exe, when the program is stored in multiple files.

This would be more than sufficient for a first time user to learn how to use FTN95 and SLINK and get started.

The documentation is missing simple tutorials. I could think of others I could have used years ago, like:
* how to change the stack, then confirm you have !
* how to generate and use a .lib file
* how to generate and use a .dll file
* how to generate a load .map file

I could still benefit from these for using FTN95 /64 !!

I remember when I first tried to use gFortran or ifort, after having used FTN95 for many years, it would have been good to have a tutorial "where is the linker and do you need it !!"

Documentation is not designed for first time users .
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 1843
Location: South Pole, Antarctica

PostPosted: Sat Oct 14, 2017 5:19 pm    Post subject: Reply with quote

Perfect post, John. Exactly my thoughts.

/* Yesterday I tried to find how /timing works. And reading huge description in the Help file I found myself sleeping in the middle Smile
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 840

PostPosted: Sun Oct 15, 2017 6:34 am    Post subject: Reply with quote

been there, done it myself Dan - on numerous subjects !
I'm surprised that often the fall-back solution is to GOOGLE (!) silverfrost + query whcih oft gets the best results !

To be fair to Paul he has said several times in the past 3 years or so that I've been on the forum that he's fully aware of the documentations shortcomings .
Maybe now is the time to give an overhaul a bit of a higher priority though.
It's not easy, and there are many pitfalls along the way trying to satisfy what the demands of all levels of users are.
First step would be a poll of user expectations before planning the best approach.

A good solution might be to get a get a student/work-experience person onboard to do the donkey work on it, and hence relieve Paul of the spectre of hours of ploughing through the various documentations and leave him to act as guru/direcor on the subject.
Just a thought as I've seen a department in a major company before revolutionise it's working by employing a dedicated young 'documentalist' who worked wonders .
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 1959
Location: Sydney

PostPosted: Sun Oct 15, 2017 12:33 pm    Post subject: Reply with quote

Dan,

I am disappointed you have maligned /timing.
It works by timing all routines that are compiled with /timing, so you omit the /timing option from library or low level routines you know are not a problem.
I have found this to be an extremely useful option for finding slow code.

John

(I am sure I have posted about this option before)
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 840

PostPosted: Sun Oct 15, 2017 5:52 pm    Post subject: Reply with quote

we covered a lot of these documentation/°video discussions on the 2-years-ago post first mentioned on this post by Dan K and then by mecej4, here it is again....
http://forums.silverfrost.com/viewtopic.php?p=18711#18711
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 1843
Location: South Pole, Antarctica

PostPosted: Mon Oct 16, 2017 1:17 am    Post subject: Re: Reply with quote

JohnCampbell wrote:
Dan,

I am disappointed you have maligned /timing.


John, as you, JohnS and original poster noted above the problem is in documentation.

I expected that first what documentation about /timing has to show is

1) first line shows how /timing is applied (standard on any documentation)
for us this is obvious but for novices definitely not
2) take working example of some tiny code or take just a sketch of some arbitrary code
3) show where timing information is displayed and how it looks

and only then

4) add N pages and even pictures of explanation how it was implemented for those who have time to read that or those who are by some reason have problems with /timing or not satisfied with the method
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 1959
Location: Sydney

PostPosted: Mon Oct 16, 2017 4:24 am    Post subject: Reply with quote

Dan,

I think you are asking for a" how to ..." tutorial, which I agree would be very helpful.
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 1843
Location: South Pole, Antarctica

PostPosted: Mon Oct 16, 2017 5:10 am    Post subject: Reply with quote

John,
No I am asking that first two lines of the explanation for /timing in the HELP had to have almost all the essential information needed

1) how to apply /timing (trivial) and
2) where to look for the outcome of /timing.

I do not have time for try and faults to find that myself and have no interest to read two pages how it works because intuitively all is clear without this. Fun though was that after finally reading those two pages i found no answer on my question 2) which made me remembering Landau. Smile

Remember I wrote that I am always losing my keys, wallet, glasses and cellphone? I spent time to really realize this phenomenon. The answer is that all my life I lived on my good short memory. With aging, and with added with years stress i became more scatter-minded. In such cases everyone losing control of hands and the memory becomes more and more professional oriented and stops caring about small unimportant things like what is in your hands. Hands start living their own life Smile

After teaching myself to place these things strictly on one-two places only (i remembered that granddad tried to teach me to keep everything in order but i did not care much) i do not have any problems anymore. Things are that there are almost infinite amount of places to displace your stuff.

Same with new things and bad not-intuitive documentation. There exist infinite amount of possibilities for implementation of /timing so you do not proceed at all if it was not answered exactly. The keyword here is 'exactly'. Documentation has to show exactly how thing were done first laconic standard way, and then verbose way.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Oct 16, 2017 7:19 am    Post subject: Reply with quote

I haven't used this option recently so I had a quick look at the help file. In the first paragraph it tells me to use /TIMING on the command line. I tried this, ran the program and the output tells me where to find the report.

It has probably taken me longer to write this post.
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 1843
Location: South Pole, Antarctica

PostPosted: Mon Oct 16, 2017 7:28 am    Post subject: Reply with quote

Paul,

You had previous knowledge of that stuff so the amount of potential tries and faults hence is substantially reduced even if you forgotten some things.

I have 200 lines in BAT file, and 300,000 lines of sources total in 1000 subprograms. Trying is not exactly my priority when i have 100 other things in my to do list when my experience says that seemingly small and easy things may suck all your time. Look how much time took original poster just to start "elementary" thing to compile program. Days. And I am not sure he still finished it right. Smile How many milliseconds it would take to you?

This is also exactly the same matter why i did not try Plato.

And same like centering axis name on native %pl LOGLOG plots. I have done that in my own graphics programs and know that it is 15 minutes work though initially it took decent amount of time. You also know that it is potentially doable very easily but you have not done that before so isn't this the reason we do not see it's working for almost 6 months?

Like long ago one our professor told us, students, looking at our confused tired faces: "Yea, you will not believe but what a joy is to me to discuss this subject for the second time"
Back to top
View user's profile Send private message
kaliuzhkin



Joined: 17 Sep 2012
Posts: 33

PostPosted: Fri Oct 20, 2017 12:19 am    Post subject: Reply with quote

Still having problems with /64. From the command prompt, if I compile with the /64 option and then execute SLINK64 CotMain.obj CotFunction.obj, I get the error message “[SLINK64 v1.8, Copyright (c) Silverfrost Ltd. 2015-2017]
***Command file terminated unexpectedly - use a file command to save the load.”


And the two years was from the other post. Smile

I can do everything from Plato except linking the .obj files. That must be done by SLINK (not SLINK64) in command prompt.
Back to top
View user's profile Send private message Send e-mail
JohnCampbell



Joined: 16 Feb 2006
Posts: 1959
Location: Sydney

PostPosted: Fri Oct 20, 2017 1:38 am    Post subject: Reply with quote

"slink64 /help" will give some info on the commands. (why not /? also)
I prefer the option 3) approach as it is more convenient for many ( often 100's of ) files.

Here is an example I have taken from a much larger build.
the first file "test.bat" will compile and build program.exe.
the second file "CotMain_load.txt" are the commands for slink64.
All file names are arbitrary.

As slink64 does not support LE xxx.lib files, my equivalent CotMain_load.txt can get very long with many LOad commands, using tree names for all .obj files that I would normally place in my libraries.
I use .txt as the use of .lnk as a file suffix is not a good approach.

test.bat
Code:
date /T  >ftn95.tce
time /T >>ftn95.tce

rem build

del *.obj
del *.mod
del program.exe
 
rem  compile routines

ftn95 CotMain.f90      /64 >>ftn95.tce
ftn95 CotFunction.f90  /64 >>ftn95.tce
 
rem link routines and libraries

slink64 @CotMain_load.txt >> ftn95.tce
 
del *.obj
dir *.exe >> ftn95.tce

notepad ftn95.tce

CotMain_load.txt
Code:
lo CotMain.obj
lo CotFunction.obj
map CotMain.map
file program.exe
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Fri Oct 20, 2017 8:04 am    Post subject: Reply with quote

kaliuzhkin

SLINK will not link 64 bit object files. You must use SLINK64.

You should be able to link from Plato. Just make sure that you have selected the right "platform", that is x64 and not Win32 or .NET. If it doesn't work then maybe you are using an old Plato. The latest download is available from the Plato section of this forum.

A simple SLINK64 command line takes the form:

Code:
SLINK64 prog.obj sub.obj /file:prog.exe
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 1843
Location: South Pole, Antarctica

PostPosted: Fri Oct 20, 2017 8:50 am    Post subject: Reply with quote

Dan, Sorry, I made typo in my recommendation post above suggesting forgetting colon here /file:YourExeName.EXE.

/* And one more rocked failed to lift due to the typo
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 -> Support All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
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