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 

gFortran
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
kaliuzhkin



Joined: 17 Sep 2012
Posts: 33

PostPosted: Mon Aug 28, 2017 8:29 pm    Post subject: gFortran Reply with quote

Where do I learn about gFortran? I downloaded and installed it, but find the source files incomprehensible. I want to read up on the language, and how to compile and link it.

Thx,

Dan
Back to top
View user's profile Send private message Send e-mail
PaulLaidler
Site Admin


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

PostPosted: Tue Aug 29, 2017 7:25 am    Post subject: Reply with quote

Dan

This forum is for the FTN95 compiler and not gFortran.
Try Googling gFortran if you must use it otherwise download the free personal edition of FTN95 from here http://www.silverfrost.com/32/ftn95/ftn95_personal_edition.aspx
Back to top
View user's profile Send private message AIM Address
mecej4



Joined: 31 Oct 2006
Posts: 1885

PostPosted: Tue Aug 29, 2017 10:56 pm    Post subject: Re: gFortran Reply with quote

kaliuzhkin wrote:
Where do I learn about gFortran? I downloaded and installed it, but find the source files incomprehensible. I want to read up on the language, and how to compile and link it.

Let us not confuse the language, Fortran, with a specific compiler for that language, Gfortran.

We do not know what you downloaded and what you installed. If by "source files" you mean the source files from which the Gfortran compiler is built, those would be mostly in the C language and, if you are not familiar with parsers and code generation, you would find them incomprehensible regardless of whether those are in C or Fortran.

If you are new to Fortran, I recommend that you use Silverfrost FTN95 for now and postpone (or forget) using Gfortran. FTN95 is free for personal use, and provides excellent features that help the beginner to learn Fortran.
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Wed Aug 30, 2017 7:21 pm    Post subject: Reply with quote

On the grounds that the particular part of the Forum is dedicated to:

Quote:
"General discussions on FTN95 ..."


I think Paul's reply would have been fair enough, but isn't it a little harsh when the rest of the blurb states:

Quote:
"Fortran, Third Party tools...basically anything that takes your fancy!"


Indeed, as Clearwin64 was specifically targetted to gFortran initially, then again, it would seem that gF shouldn't be off limits.

You can even get an easy to install version with a GUI and lots of extensions from SimplyFortran. If you looked at the Polyhedron benchmarks, you might even go away with the idea that gF was better in some ways - the benchmarks show execution times lower than FTN95.

BUT. A lot of buts. If you use raw GNU stuff, as Mecej4 says, and the original poster knows, it is well nigh incomprehensible. In comparison to FTN95, it lacks the useful standard functions present in FTN since FTN77 days, as well as a fully-integrated Clearwin that enables very professional Windows applications to be developed. Indeed, if you want incomprehensible stuff, you can always tie FTN95 in with .NET !

Then again, FTN95 compiles extremely quickly, with great diagnostics: far more important to a developer than run times of a few seconds saved. You will be some time programming in Fortran before you create something with a significant run time.

SimplyFortran also has a free trial version - but it expires after 30 days, and if you can genuinely teach yourself Fortran in 30 days, then perhaps you have the brainpower to sort out a raw gF installation ...

You can try the rest, but perhaps as you found your way here, you should try the best.
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Sun Sep 03, 2017 8:32 pm    Post subject: Reply with quote

kaliuzhkin
you could ask him .....
https://www.youtube.com/watch?v=YqgPyqyh4X4

then again .....
http://lmgtfy.com/?q=how+to+compile+and+link+gfortran

then maybe go here ....

https://gcc.gnu.org/wiki/GFortranGettingStarted

and then find an appropriate forum specifically aimed at gfortran.
Back to top
View user's profile Send private message
kaliuzhkin



Joined: 17 Sep 2012
Posts: 33

PostPosted: Mon Sep 11, 2017 9:20 pm    Post subject: gFortran Reply with quote

I defend myself against Paul’s charge that I posted an inappropriate post. My 34 word post merely asked where I could learn about gFortran. I asked for a referral. That’s all. If this is an inappropriate forum, then I merely asked where else I could look.

Mecej4 asks “what you downloaded and what you installed.” In fact, I downloaded and installed Silverfrost’s version. So an inquiry on a Silverfrost forum about how to use a Silverfrost product is quite appropriate.

The "source files" I referred to are from Silverfrost, on my computer in C:\Program Files (x86)\Silverfrost\gFortran\gFortran\samples\ and C:\Fortran compilers\Silverfrost\GFortran\gFortran\samples\. There are 77 files with tag *.f95 and I can’t make sense of any of them. Readme.txt contains only limited information.

How do I compile and link gFortran? “x86_64-w64-mingw32-gfortran.exe/?” is useless.

Could I set up Plato to use it? Are there any other IDEs?

I’m not new to Fortran. I learned it in high school and college, professionally coded for five years in the 1970’s, and have continued on my own with Lahey Personal Fortran 77 and for the past five years or so with Silverfrost FTN95. My main references are “Fortran 95” by Counihan, “Introducing Fortran 95” by Slivers and Sleightholme, and “Fortran 95 Handbook” by Adams et al. I still have a lot to learn about Fortran 95.

Please, don’t assume the worst from a short post. Very Happy

Thanks for all the information.
Dan
Back to top
View user's profile Send private message Send e-mail
mecej4



Joined: 31 Oct 2006
Posts: 1885

PostPosted: Mon Sep 11, 2017 10:03 pm    Post subject: Reply with quote

You are confusing Gfortran and Silverfrost Fortran (FTN95) so thoroughly that it is nearly impossible to answer you.

Silverfrost does not distribute Gfortran or any Fortran compiler other than FTN95 at present. Any sample files included in the FTN95 installer would be FTN95 examples, not Gfortran examples.

Typically, the FTN95 sample files are installed in the user's home directory in a subdirectory called "FTN95 Examples". I have never used any of them, but they appear to be examples of GUI type programs, which I am not interested in.

You may have named the directory containing the FTN95 samples as "gfortran", but that does not make them Gfortran samples any more than naming a Windows PC "Torvalds" would make it a Linux PC.

From your mention of "...mingw..." I suspect that you may have also installed MINGW-Gfortran some time ago and have mixed up the two compiler directories.

You also state that you have been running FTN95 for a number of years. If so, you already know how to use FTN95 to compile and link the FTN95 sample files. What is the hold-up?
Back to top
View user's profile Send private message
kaliuzhkin



Joined: 17 Sep 2012
Posts: 33

PostPosted: Mon Sep 11, 2017 11:29 pm    Post subject: gFortran from Silverfrost Reply with quote

http://www.silverfrost.com/beta/gFortran.exe. In Plato, under Tools, there's an option for gFortran. You then have a choice of downloading or locating it. Downloading brings you to the aforementioned URL. What gives? Question Question
Back to top
View user's profile Send private message Send e-mail
kaliuzhkin



Joined: 17 Sep 2012
Posts: 33

PostPosted: Mon Sep 11, 2017 11:31 pm    Post subject: FTN95 Reply with quote

Oh, there's no hold up on FTN95. My question is limited to gFortran as furnished by Silverfrost.

Dan
Back to top
View user's profile Send private message Send e-mail
mecej4



Joined: 31 Oct 2006
Posts: 1885

PostPosted: Tue Sep 12, 2017 12:26 am    Post subject: Reply with quote

Thanks, I was not aware of the link that you provided. Searching the silverfrost main page with "gfortran" shows nothing. That is probably why many of us did not recognize what you were writing about!

However, this post may explain what that is: http://forums.silverfrost.com/viewtopic.php?t=2583 . The last line of that post says, "This folder contains a test suite of ClearWin+ samples that will run under either FTN95 or 64-bit gFortran."

That post was made in 2013, and refers to a beta release of 64-bit Clearwin+, and a link to a 300 MB download of Gfortran. At that time, the x64 version of FTN95 did not exist.

We now have V8.1 of FTN95, which contains a 64-bit Silverfrost compiler. There is probably no more need for Silverfrost to provide updates to the beta release and the Gfortran download. Perhaps Paul can comment on this.
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Tue Sep 12, 2017 5:47 am    Post subject: Reply with quote

When Clearwin 64 was released, as a 64 bit version of Clearwin to run with a 3rd party 64-bit compiler, Plato provided support for gFortran.
In Oct 2013, it supports 64-bit gFortran, I think supplied from mingw-w64.
this was to support 64-bit clearwin.
In 2016, FTN95 /64 was released, which provides a better support for 64-bit clearwin graphics.

However PLATO still supports other gFortran compilers. I find the mix of compiler support; from gFortran to FTN95 /64 and FTN95 (/32) /check to provide a good mix of compiler checking. And use them frequently.

For gFortran support in PLATO, you must set up the gFortran path and environment variables to be able to run gFortran in a cmd.exe window. This is poorly described !! It deserves a better description both here and on the gFortran download websites.
A problem area in PLATO for using gFortran is alternative compiler options, although it may simply be a problem with my usage. (I need to review how gFortran can operate with a PLATO project)

Using gFortran provides a number of advantages, which FTN95 is not expected to address in the near future.
# Inclusion of F03 and F08 standard features.
# !$OMP support with -fopenmp
# Extensive vector instruction support, eg -O3 -mavx -march=native -ffast-math

However, FTN95 offers extensive code checking, debug facilities and integration with newer Clearwin features.

You should better understand what features you are looking for.
If it is graphics then look to FTN95 /64 Clearwin features
If it is !$OMP then look to gFortran

I shall try to post an information sheet on using a 3rd party gFortran compiler with PLATO, by setting up environment variables for support.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Sep 12, 2017 6:58 am    Post subject: Reply with quote

Plato support for gFortran is of necessity fairly minimal. In particular, command line options for gFortran must be configured manually as opposed to selecting from a given list. Also we can't undertake to keep pace with new versions of gFortran as they are released.
Back to top
View user's profile Send private message AIM Address
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Tue Sep 12, 2017 1:25 pm    Post subject: Reply with quote

This thread has prompted me to build a project in PLATO. (In the past I have used a .bat file to do the build)
I have had some success!
Selecting Release x64 and
use Tools>Options>Use gFortran/gcc,
I have been able to set compile options in Project>Properties>gFortran options:
I will continue to investigate what is available, but it appears to work successfully.

To enable gFortran to work in PLATO, I have installed the following environment variables in Control Panel > SYSTEM > Advanced system settings > Environment Variables

copy path to orig_path

New environment variables for selecting FTN95 ver 8.10 and gFortran Ver 7.1.0 ( values taken from .bat file example )
Code:
set pf_32=C:\Program Files (x86)

set ftn95_dir=%pf_32%\Silverfrost\ftn95_8.10
set f95include=%ftn95_dir%\include
set mod_path=%ftn95_dir%\include
set ftn95_path=%ftn95_dir%

set gcc_ver=7.1.0
set gcc_dir=%pf_32%\gcc_%gcc_ver%
set EQ_LIBRARY_PATH=%gcc_dir%\x86_64-w64-mingw32\lib
set gcc_path=%gcc_dir%\bin;%gcc_dir%\libexec\gcc\x86_64-w64-mingw32\%gcc_ver%

set Path=%gcc_path%;%ftn95_path%;%orig_path%;c:\utils


In some cases the environment variables are not updated (eg gcc_ver), so the %variable% needs to be replaced by the text value.
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1885

PostPosted: Tue Sep 12, 2017 1:49 pm    Post subject: Reply with quote

John, if you can answer without much effort, I'm curious to know:

If you use Gfortran's -g option, can you do symbolic debugging of the resulting EXE, with SDBG/SDBG64? If not, with another debugger?

I'm curious because Lahey/Marlette, these days, focus most of their efforts on enabling symbolic debugging in Visual Studio of Gfortran-compiled programs, so that capability is probably out of reach without substantial effort from Silverfrost, but you never know when an obscure feature of a compiler package may afford a short cut!

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



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Wed Sep 13, 2017 12:50 am    Post subject: Reply with quote

mecej4,

Unfortunately I have limited experience with gFortran and have not yet tried any -g options. I used gdb a few times but again am not familiar with it's features. There are a huge number of compiler options available and I wonder which are incompatible. I still haven't found how to get a FTN95 .map file.

I have not used Lahey/Marlette lately, as the latest gFortran version I found was 5.3, while other sites are up to 7.1 ( equation.com and mingw-w64 )

My focus has been for using !$OMP, which again makes using debuggers more difficult and beyond my capability.

I am slow to change, as this week is the first time I have used projects in PLATO. I have been able to do most builds with .bat files, where environment variables and mixed compiler options can be easily managed. FTN95 /64 without the ability to create libraries makes a .bat file build a preferred approach.

I have also been experimenting by mixing different -f.. and -m.. gFortran features, which is easy to do in a .bat file. I find daxpy and ddot style routines can perform better with different options on different processors, although the benefits are questionable.


Last edited by JohnCampbell on Wed Sep 13, 2017 1:13 am; edited 1 time in total
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
Goto page 1, 2  Next
Page 1 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