LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-07-2005, 02:53 PM   #1
nate1
LQ Newbie
 
Registered: Apr 2004
Posts: 14

Rep: Reputation: 0
list compilers, run fortran code?


Here are two presumably easy questions that I unfortunately cannot find the answers to anywhere on the net or in the useless 'Red Hat Linux Bible'


First, is there a command that lists the compilers available on a given system? I'm trying to compile some fortran programs that I downloaded, but when I type 'make' to run the makefile, I get the error message:

ifort -O3 -Bstatic -c heff-modules.f90
make: ifort: Command not found
make: *** [heff-modules.o] Error 127

The only solution that I can think of is that I don't have the ifort compiler, but I can't figure out how to check this.

Second, once (if) I do get this program compiled, then it would be nice if I could run it, and going on past experience I fully anticipate running into another roadblock here. It's probably safe to assume that the simple './prog_gw.exe filename.dat' that works for c programs wont work here? I have seen many "answers" to this question, all of which are different and, if my own past experience, again, is any indication, none of these will work, so maybe a simple, dumbed down answer would help?

I was running on Red Hat Linux 9, but have since "upgraded" to the next higher level, whatever that might be - the logical next step would be 10, but this was apparently not the case...

Thank you very much for any help that anybody can send my way!

Nate
 
Old 06-07-2005, 05:01 PM   #2
rstewart
Member
 
Registered: Feb 2005
Location: Sunnyvale, CA
Distribution: Ubuntu
Posts: 205

Rep: Reputation: 38
Hi,

The easiest way to make completely sure that you don't have the ifort program on your system is to use the find command to attempt to locate it. Do the following:

su
<root password>
find / -name ifort -print

Wait....... This will completely search your system and print out the location to any file named "ifort". When the search has completed (you will come back to the command line prompt) type "exit" (without the quotes) to return to a normal user. If the search does not report any ifort files, then you do not have it installed. If the search does come up with a file called ifort, then you should determine if it is the compiler that you are looking for. If it is, then make sure that your path is pointing to the location where the file is located. Once that has been completed, then your make should work.

As far as executing the compiled program, an executable is an executable is an executable. It does not matter what type of source was used to create the program, once it is an executable it is in binary machine code and will run like any other program.

I hope that this helps!
 
Old 06-08-2005, 12:20 AM   #3
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy jessie stretch
Posts: 1,593

Rep: Reputation: 97
I do not know much about this fortran complier. But, (in the C world) binaries of a.out format works (I guess) on same CPU .... (I am not sure)...
but I am sure that ELF format binaries do not work when run time libraries are not compatible. (libc.....)
 
Old 06-08-2005, 12:37 AM   #4
Genesee
Member
 
Registered: Dec 2002
Distribution: Slackware
Posts: 927

Rep: Reputation: 30
Re: list compilers, run fortran code?

Quote:
Originally posted by nate1
Second, once (if) I do get this program compiled, then it would be nice if I could run it, and going on past experience I fully anticipate running into another roadblock here. It's probably safe to assume that the simple './prog_gw.exe filename.dat' that works for c programs wont work here? I have seen many "answers" to this question, all of which are different and, if my own past experience, again, is any indication, none of these will work, so maybe a simple, dumbed down answer would help?
what did the many different "answers" say? afaik, there aren't that many different ways to do it. essentially, an executable file may be run in a shell (for example, bash) by typing the filename.

the "./" preceeding the filename is simply a way to tell the shell where the file is located, and means, basically, "in this directory". alternatively, you could specify an absolute path, such as /home/nate/filename - again, to tell the shell where to find the file. or, you could put the file in a directory listed in the PATH variable, which is a list of dir's the shell will search by default. if your attempt fails, post the error message here, which would be more helpful than simply saying it doesn't work.
 
Old 06-08-2005, 01:20 AM   #5
nate1
LQ Newbie
 
Registered: Apr 2004
Posts: 14

Original Poster
Rep: Reputation: 0
Ok, I found a really simple solution to the first part of my problem. I simply typed 'man ifort' and when I got an error message I tried 'man g77' which I am told is the more common fortran compiler nowadays(?). Since the first command was not recognized, this must mean that I do not have the ifort compiler, and since the second gave me the manual pages, I do have the g77 compiler. whoopee!

So far I suppose I have determined that my computer does not have the ifort compiler but rather the g77 compiler.

What, now, is the best way to get the makefile to work? If I edit the makefile to include 'g77' instead of 'ifort', then I have to change the flags (ifort -O3 -Bstatic -c), right? Would it be easier to search out and download/install the ifort compiler or to try and edit the makefile? Remember, my Linux knowledge/patience is rather limited...

...And thank you everyone for your help thus far. Your help is greatly appreciated.

Nate

oh, and to Genesee, I may have exaggerated about the "many answers" thing, as I have two: the first that I heard was to type something to the effect of:

prog_ge.exe inputfile outputfile (or vice versa)

the second was to simply type the name of the program.

As soon as I can compie the program, I will try to run it and then I'll post the error messages that I get.

Thanks again..
 
  


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
g77 Fortran - run time error (fmt: read unexpected character) rajeshdorai Programming 1 08-16-2006 08:07 AM
does linux fortran compiler in fedora 4 support VAX FORTRAN? terrence Programming 17 08-31-2005 09:59 AM
Fortran g95 source-code line truncation feature is annoying elavid Programming 1 06-09-2005 12:15 PM
Fortran compilers section8 Programming 1 03-30-2005 07:11 AM
fortran compilers rxs160 Programming 5 09-19-2004 01:28 AM


All times are GMT -5. The time now is 12:14 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration