Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
01-28-2009, 07:02 AM
|
#1
|
LQ Newbie
Registered: Apr 2008
Location: Helsinki, Finland
Posts: 26
Rep:
|
How to get Fortran90 compiler
I have g77 working fine in Fedora 9 (Sulphur), but recently I have got some files which can be compiled using Fortran 90 compiler. My system has Fortran 95 compiler but unfortunately it is of no help, as I cannot compile files using it. For compiling I need to use f90 command.
So please, some one can suggest how I can get fortran 90 compiler.
Thanks!
|
|
|
01-28-2009, 11:21 AM
|
#2
|
Senior Member
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197
Rep: 
|
According to the Wikipedia entry on Fortran, Fortran 95 was a minor upgrade to Fortran 90. It should be compatible. So, are you saying the Fortran 95 compiler you have is nonfunctional in general or that it just doesn't work on these particular files?
At the end of the Wikipedia entry there are links to the GNU Fortran project (95/2003) and to the g95 project. Both are open source, and perhaps you could try them.
|
|
|
01-28-2009, 12:14 PM
|
#3
|
LQ Newbie
Registered: Apr 2008
Location: Helsinki, Finland
Posts: 26
Original Poster
Rep:
|
First of all thanks for the reply!
Quote:
Originally Posted by choogendyk
According to the Wikipedia entry on Fortran, Fortran 95 was a minor upgrade to Fortran 90. It should be compatible. So, are you saying the Fortran 95 compiler you have is nonfunctional in general or that it just doesn't work on these particular files?
|
Well, I also believed that f95 should be fine, but it seems that it does not works on these files. Actually I have some codes, which I am trying to compile for calculations and when I use f95 command it just does not produce the executable file. I have tried on other system having f90 and there it's all fine. But you can understand that it's quite difficult to always switch over systems.
Quote:
At the end of the Wikipedia entry there are links to the GNU Fortran project (95/2003) and to the g95 project. Both are open source, and perhaps you could try them.
|
I have tried this also but some how I don't find anywhere support to fortran 90. If you can suggest some other option it will be quite helpful.
Thank you again!
|
|
|
01-28-2009, 09:48 PM
|
#4
|
Senior Member
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197
Rep: 
|
Any error messages? Are you a programmer who knows Fortran and could possibly fix incompatibilities in the code?
|
|
|
01-29-2009, 04:42 AM
|
#5
|
LQ Newbie
Registered: Apr 2008
Location: Helsinki, Finland
Posts: 26
Original Poster
Rep:
|
Quote:
Originally Posted by choogendyk
Any error messages? Are you a programmer who knows Fortran and could possibly fix incompatibilities in the code?
|
When I try to use f90 command on my system it just says command not found, which means Fortran 90 is not there. When I use f95 command, there is no error message but the executable file is not produced to execute the program further.
I am not a technical programmer.
|
|
|
01-29-2009, 05:50 AM
|
#6
|
Senior Member
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705
Rep:
|
Look at the gcc docs and there will almost certainly be, amongst the millions of unwanted and confusing switches, a switch that will compile your program in F90 mode.
|
|
|
01-29-2009, 05:56 AM
|
#7
|
LQ Guru
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509
|
Quote:
Originally Posted by nelufarup
When I try to use f90 command on my system it just says command not found, which means Fortran 90 is not there. When I use f95 command, there is no error message but the executable file is not produced to execute the program further.
|
Can you post the exact command line you used? That one with f95, I mean. Also post the output of the following command
just to have an idea of which compiler it really is. I suspect f95 is just a link to another executable.
Anyway, you can try to install gcc-gfortran. Look for "fortran" in the search form of Add/Remove software or try the following if you prefer the command line package manager:
Code:
yum install gcc-gfortran
|
|
|
01-30-2009, 03:57 PM
|
#8
|
LQ Newbie
Registered: Apr 2008
Location: Helsinki, Finland
Posts: 26
Original Poster
Rep:
|
Quote:
Originally Posted by colucix
Can you post the exact command line you used? That one with f95, I mean. Also post the output of the following command
just to have an idea of which compiler it really is. I suspect f95 is just a link to another executable.
|
I used following command line
Code:
f90 dpi.exe -o *.for
The output of the command
is
Code:
lrwxrwxrwx 1 root root 8 2008-08-05 04:43 /usr/bin/f95 -> gfortran
Quote:
Anyway, you can try to install gcc-gfortran. Look for "fortran" in the search form of Add/Remove software or try the following if you prefer the command line package manager:
Code:
yum install gcc-gfortran
|
Unfortunately there is some problem with Add/Remove software, as it never activates. So if you can tell which compiler is this (which I guess, to be gfortran) and if it supports f90? I would prefer to install gcc-fortran as last option.
Thanks!
|
|
|
01-30-2009, 04:07 PM
|
#9
|
LQ Guru
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509
|
Yes, it is gfortran, which currently supports F77, F90 and F95 standard. The package gcc-fortran is already installed on your system, since it is that one which provides the gfortran executable in Fedora. However, the command line used to compile is wrong:
Code:
f90 dpi.exe -o *.for
since the -o option must be followed by a custom name for the compiled executable and must not be put after. The solution to your issue is
Code:
f90 -o dpi.exe *.for
provided f90 is a valid link to gfortran the same way as f95!
|
|
|
01-31-2009, 08:44 AM
|
#10
|
LQ Newbie
Registered: Apr 2008
Location: Helsinki, Finland
Posts: 26
Original Poster
Rep:
|
Quote:
Originally Posted by colucix
Yes, it is gfortran, which currently supports F77, F90 and F95 standard. The package gcc-fortran is already installed on your system, since it is that one which provides the gfortran executable in Fedora. However, the command line used to compile is wrong:
Code:
f90 dpi.exe -o *.for
since the -o option must be followed by a custom name for the compiled executable and must not be put after. The solution to your issue is
Code:
f90 -o dpi.exe *.for
provided f90 is a valid link to gfortran the same way as f95!
|
First of all, I am sorry for sending the wrong command. I have used the command as suggested by you.
But it seems that f90 is not a valid link to gfortran since this command does not works. So could you tell how can I make a valid link of f90 to gfortran?
Thanks!
|
|
|
01-31-2009, 04:55 PM
|
#11
|
Member
Registered: Jan 2007
Location: Melbourne, Australia
Distribution: Fedora 38 x86_64
Posts: 539
Rep:
|
Quote:
Originally Posted by nelufarup
First of all, I am sorry for sending the wrong command. I have used the command as suggested by you.
But it seems that f90 is not a valid link to gfortran since this command does not works. So could you tell how can I make a valid link of f90 to gfortran?
Thanks!
|
If you have gfortran, then why not simply use that command; i.e. gfortran fred.f90 -o fred?
Cheers,
Terry
|
|
|
01-31-2009, 05:53 PM
|
#12
|
LQ Guru
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509
|
I agree with terry-duell. You don't need links to gfortran, unless for mnemonic aid. Use gfortran command directly. Anyway, the command to create a symbolic link is ln -s. Take a look at man ls for further details.
|
|
|
02-01-2009, 08:32 AM
|
#13
|
LQ Newbie
Registered: Apr 2008
Location: Helsinki, Finland
Posts: 26
Original Poster
Rep:
|
Thanks for the command help terry-duell! I did not use it, as I did not know about it.
Anyway, I used the command but with no success. It did not produce executable file instead gave list of complains with the declarations and dimensions in the codes. Now I am completely sure that there is no problem with that, as the codes can be compiled properly on other system with out any problem.
Let me write the exact commands that I have been using on this other system to compile different files in a directory together.
Code:
f90 -o tm.exe *.for
chmod 700 tm.exe
./tm.exe
This is the reason why I have been insisting on f90 compiler. Using other compiler say gfortran or f95, though they might be supporting f90, always list complains.
Thanks!
Last edited by nelufarup; 02-01-2009 at 08:34 AM.
|
|
|
02-01-2009, 05:07 PM
|
#14
|
LQ Guru
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509
|
Quote:
Originally Posted by nelufarup
Thanks for the command help terry-duell! I did not use it, as I did not know about it.
|
Well, we were talking about gfortran from the very beginning of this thread and you did not know about it? You sure?
Quote:
Originally Posted by nelufarup
It did not produce executable file instead gave list of complains with the declarations and dimensions in the codes.
|
Why don't you show us the exact error messages and eventually the code you're trying to compile?! Maybe we can be of more help.
Quote:
Originally Posted by nelufarup
This is the reason why I have been insisting on f90 compiler. Using other compiler say gfortran or f95, though they might be supporting f90, always list complains.
|
As far as I know in Linux there is not a f90 compiler, unless it is a link to some other GNU fortran only for mnemonic purposes. A f90 command was provided on Sun systems, instead. Anyway, if your code works on some machines and not on other, maybe it is not written taking in account compatibility issues. There is a chance you have just to pass some specific options to the compiler in order to achieve the compatibility, but again if we don't see the code and/or the error messages we cannot be of any help.
|
|
|
02-01-2009, 05:09 PM
|
#15
|
Member
Registered: Jan 2007
Location: Melbourne, Australia
Distribution: Fedora 38 x86_64
Posts: 539
Rep:
|
Quote:
Originally Posted by nelufarup
Thanks for the command help terry-duell! I did not use it, as I did not know about it.
Anyway, I used the command but with no success. It did not produce executable file instead gave list of complains with the declarations and dimensions in the codes. Now I am completely sure that there is no problem with that, as the codes can be compiled properly on other system with out any problem.
Let me write the exact commands that I have been using on this other system to compile different files in a directory together.
Code:
f90 -o tm.exe *.for
chmod 700 tm.exe
./tm.exe
This is the reason why I have been insisting on f90 compiler. Using other compiler say gfortran or f95, though they might be supporting f90, always list complains.
Thanks!
|
What is your 'other system' and which Fortran 90 compiler is it running?
Maybe the source is non standard.
What result do you get if you try to compile only one of the fortran source files?
Try this ... 'gfortran fred.for -o fred' where fred.for is any one of your *.for source files, and let us know the result. If you still get error messages please provide some of these so we can get an idea of what is happening. If there are only complaints (warnings) that is not unusual.
Cheers,
Terry
|
|
|
All times are GMT -5. The time now is 10:54 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|