LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cant find Fortran File (https://www.linuxquestions.org/questions/linux-newbie-8/cant-find-fortran-file-222031/)

unixfreak 08-24-2004 10:16 PM

Cant find Fortran77 File After Installing
 
I just Installed the Fortran77 package from CD#2 and I dont know where the package is.
It asked me for CD2 and the Package was installed successfully, but the question is I cant find where it installed it to.

acid_kewpie 08-25-2004 01:44 AM

you should just need to access the g77 executable (assuming it was g77 you installed) from any old command line, as it should be on your path already.

unixfreak 08-25-2004 01:49 AM

I went to Xterm, and I typed g77 but no directory. Where could this be, that my question. Im tring to figure out where this package went. Its seems a mystery.

I will try Find Filea maybe it will pop up there, but I doubt it.

unixfreak 08-25-2004 02:18 AM

I really liked to find this file. It just bugs me.

btmiller 08-25-2004 03:34 AM

find / -name g77 -print

My guess is that it'll be in /usr/bin.

shengchieh 08-25-2004 04:33 PM

To find anything, use the whereis command, i.e.,

whereis g77 .

Mine is at /usr/bin/g77 .

Also, the find utility is nice. In KDE, it's kfind.
The find program is also probably (distribution-specific)
in your Home/Start/Launch menu at the very bottom
left corner.

Sheng-Chieh

unixfreak 08-25-2004 06:37 PM

Its in the Root Directory /usr/bin/g77 but I cant open the program.
I think I have to become root.

And I even typed 'su' in the terminal and it cant find the file or open the file.

btmiller 08-25-2004 07:11 PM

Post the results of "ls -l /usr/bin/g77" (no quotes) here if you're having further difficulties.

unixfreak 08-25-2004 07:39 PM

Results are:

lrwxrwxrwx 1root root /usr/bin/g77 (highlited blue) >> /etc/alternatives/g77* (hightlited green)

btmiller 08-25-2004 08:58 PM

Interesting ... what exactly happens if you try to run g77 from the command line (post the exact messages you get)? It looks like it's there, but I'm wondering why it's linked to something in /etc/alternatives...

unixfreak 08-26-2004 12:44 AM

It says 'No input Files'

I know its strange. I dont know. I have a feeling that these CDs I got some files or packages are corrupted. I just have a strange feeling.

Well, any other suggestions??? Although, it did say successful install.

btmiller 08-26-2004 01:44 AM

Oh, well in that case, it's all OK then. You need to pass g77 a Fortran source file for it to compile or it will complain in the manner you describe. Unix commands aren'tt known for their verbose errors messages :).

unixfreak 08-26-2004 01:50 AM

Ok, so i need to use Fortran77. So I cant use Fortran? Or what do I need to do to get this going?

How could I use it then?

unixfreak 08-26-2004 12:53 PM

I think Im being ignored here.

Im trying to locate this program. Please help me out.

michaelk 08-26-2004 02:13 PM

Not really... btmiller provided you with the answer but then I do not what you are looking for.

g77 is a command line compiler not a xwindows development environment.

Example
If the fortran source code file is named file.f then to compile the program from a console window:
g77 file.f

The compiler creates the executable application called a.out. To run your application you would enter in a console window.
./a.out


http://gcc.gnu.org/fortran/

unixfreak 08-26-2004 03:58 PM

Im still a very confused. In order to use Fortran77 what will I have to do in order to use it? Please list all the commands if possible.

I installed the package by popping in the CD2 of Mandrake 9.1. When it finished installing, it was successful.

I just need to find the Fortran program and open it. But how do I compile it in order for it to work?

Do I need to download extra stuff in order for this to work? If so, what do I need to download and where to put that downloaded file to???


Tinkster 08-26-2004 04:09 PM

Again a very plain case of read the man-page
man g77



Cheers,
Tink

shengchieh 08-26-2004 04:13 PM

>>> It says 'No input Files' <<<

I think you do have g77, but have no
program to run g77. Create a simple
fortran code, hello.f:

<6 spaces> PROGRAM HELLO
<6 spaces> WRITE(*,*) 'Hello World'
<6 spaces> STOP
<6 spaces> END

Then compile/execute it

g77 -o hello hello.f
./hello

What is your output says? Should says

Hello World

For docs, do a

man g77

Sheng-Chieh


p.s. My g77 is 88844 bytes. I.e,

rscheng@docs:~/xdisk/linux/rscdocs$ ls -l /usr/bin/g77
lrwxrwxrwx 1 root root 7 2004-08-18 19:56 /usr/bin/g77 -> g77-3.3

rscheng@docs:~/xdisk/linux/rscdocs$ ls -l /usr/bin/g77-3.3
-rwxr-xr-x 1 root root 88844 2003-10-05 14:52 /usr/bin/g77-3.3

unixfreak 08-26-2004 04:16 PM

I did the man g77

I opened the GNU Fortran 77 Compiler.

Now where and what should I do from here?

And the bottom it has like Objects, Synopsis etc

Dark_Helmet 08-26-2004 04:36 PM

Ok, step by step.

The g77 command requires you give it a filename on the command line. As michaelk mentioned, a valid command would be something like:
g77 some_file.f

You need to provide that file. You have to create it yourself. Open a text editor, type in the FORTRAN source code you want, and save it.

Then, at a command line, issue the command above, but change "some_file.f" to whatever filename you saved with the text editor previously.

When the command completes, it will either inform you of errors in your file that you need to correct, or it will produce an executable file.

If you do not see any errors, you run the program by executing:
./a.out

The g77 command does not open a text editor for you. It's not a development environment. Its only purpose is to convert the code you give it into an executable file. If you're looking for a development environment (like Visual C++, Borland Turbo Pascal, or other types you find in Windows), then you need to find another program. Chances are good that other program is simply a shell that will use the g77 command. So don't remove g77 if you go look for a development environment.

Tinkster 08-26-2004 04:44 PM

Quote:

Originally posted by unixfreak
I did the man g77

I opened the GNU Fortran 77 Compiler.

Now where and what should I do from here?

And the bottom it has like Objects, Synopsis etc

Tried reading the lot?

Man is Linux' help-file system. If you read it you may
understand how things work. man g77 doesn't bring up
an ide for g77.




Cheers,
Tink

stickman 09-03-2004 01:21 PM

Quote:

Originally posted by unixfreak
Ok, so i need to use Fortran77. So I cant use Fortran? Or what do I need to do to get this going?

How could I use it then?

You said that you're getting an error similar to "no input files". Do you have a Fortran source to compile. If yes, then pass the necessary parameters to g77. Read the g77 man page for proper command syntax. If you don't have any Fortran source handy, open your favorite text editor and start writing. I'm sure that if you did a Google search you could find a quick "hello world" program to use as a test compile.


All times are GMT -5. The time now is 04:45 AM.