Linux - NewbieThis 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
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.
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.
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!
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 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.....)
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.