LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 01-28-2009, 07:02 AM   #1
nelufarup
LQ Newbie
 
Registered: Apr 2008
Location: Helsinki, Finland
Posts: 26

Rep: Reputation: 15
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!
 
Old 01-28-2009, 11:21 AM   #2
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
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.
 
Old 01-28-2009, 12:14 PM   #3
nelufarup
LQ Newbie
 
Registered: Apr 2008
Location: Helsinki, Finland
Posts: 26

Original Poster
Rep: Reputation: 15
First of all thanks for the reply!

Quote:
Originally Posted by choogendyk View Post
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!
 
Old 01-28-2009, 09:48 PM   #4
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
Any error messages? Are you a programmer who knows Fortran and could possibly fix incompatibilities in the code?
 
Old 01-29-2009, 04:42 AM   #5
nelufarup
LQ Newbie
 
Registered: Apr 2008
Location: Helsinki, Finland
Posts: 26

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by choogendyk View Post
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.
 
Old 01-29-2009, 05:50 AM   #6
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
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.
 
Old 01-29-2009, 05:56 AM   #7
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Quote:
Originally Posted by nelufarup View Post
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
Code:
ls -l $(which f95)
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
 
Old 01-30-2009, 03:57 PM   #8
nelufarup
LQ Newbie
 
Registered: Apr 2008
Location: Helsinki, Finland
Posts: 26

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by colucix View Post
Can you post the exact command line you used? That one with f95, I mean. Also post the output of the following command
Code:
ls -l $(which f95)
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
Code:
ls -l $(which f95)
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!
 
Old 01-30-2009, 04:07 PM   #9
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
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!
 
Old 01-31-2009, 08:44 AM   #10
nelufarup
LQ Newbie
 
Registered: Apr 2008
Location: Helsinki, Finland
Posts: 26

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by colucix View Post
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!
 
Old 01-31-2009, 04:55 PM   #11
terry-duell
Member
 
Registered: Jan 2007
Location: Melbourne, Australia
Distribution: Fedora 38 x86_64
Posts: 539

Rep: Reputation: 59
Quote:
Originally Posted by nelufarup View Post
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
 
Old 01-31-2009, 05:53 PM   #12
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
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.
 
Old 02-01-2009, 08:32 AM   #13
nelufarup
LQ Newbie
 
Registered: Apr 2008
Location: Helsinki, Finland
Posts: 26

Original Poster
Rep: Reputation: 15
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.
 
Old 02-01-2009, 05:07 PM   #14
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Quote:
Originally Posted by nelufarup View Post
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 View Post
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 View Post
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.
 
Old 02-01-2009, 05:09 PM   #15
terry-duell
Member
 
Registered: Jan 2007
Location: Melbourne, Australia
Distribution: Fedora 38 x86_64
Posts: 539

Rep: Reputation: 59
Quote:
Originally Posted by nelufarup View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
checking for C compiler default output... configure: error: C compiler cannot create fiorejm Linux - Software 6 11-12-2009 01:35 PM
So I need a C compiler to install a c compiler. Makes sense. vic305 Linux - Software 8 12-17-2008 11:30 PM
fortran90 kostis Programming 3 11-06-2006 03:12 PM
Compiler conundrum: Which came first, a compiler, or it's source code? fr0zen Programming 21 01-29-2004 05:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration