| New Reply |
Executing a compiled program in Unix |
Share Thread | Thread Tools |
| May22-12, 10:42 AM | #1 |
|
|
Executing a compiled program in Unix
I am using a makefile and the file is compiling without any errors. After compiling I try to execute the output file by typing ./output, but then the bash shell thing disappears and I can only type text but not give commands anymore. Anyone know what could be going on?
|
| May22-12, 11:10 AM | #2 |
|
Recognitions:
|
Welcome to PF, Arjani!
![]() I expect your program is running properly and is asking the user for input. If you type Ctrl+C or Ctrl+D your program will end and the bash shell should reappear. |
| May22-12, 12:15 PM | #3 |
|
|
Thanks! It seems you are correct. Is there any way to see what kind of commands I can put in?
|
| May22-12, 12:26 PM | #4 |
|
Mentor
|
Executing a compiled program in Unix
Did that program come with any documentation?
If not, you might try to read the source code and figure out what the program tries to do when it starts executing. |
| May22-12, 08:05 PM | #5 |
|
|
I got it from my supervisor without any documentation. Given that I really don't have any experience with Fortran, looking at the source code will probably be pointless for me. I guess the only way out is to ask my supervisor, though I was hoping to figure it out on my own.
Edit: I remember he said something about NAG library, but I don't recall what. Could that be a clue? The program in question is a model of El Nino by the way (Zebiak and Cane). |
| May23-12, 06:33 AM | #6 |
|
Recognitions:
|
It doesn't sound very good that your program asks for input, without showing you beforehand what kind of input it expects.
So for that it seems you should ask your supervisor. Alternatively you can try to identify the main module of your program. It's probably called "main.for" or something like that. It should contain a "program" statement. If you simply take a look at this module, chances are that it shows in readable form what it expects. |
| May23-12, 07:41 AM | #7 |
|
Admin
|
What files do you have? Chances are some of them are documentation.
If not, it is possible program is documented within code, look for comment lines. |
| May23-12, 09:16 AM | #8 |
|
|
Thanks for the help. I haven't figured it out yet so I'll show what I have, maybe you have an idea.
|
| May23-12, 10:27 AM | #9 |
|
Mentor
|
I would look at the .f files (the source code) with a text editor (or just use the 'cat' or 'more' command in the shell) and see if they contain comments that explain the operation of the program. I can't tell which one has the main program, but there are only seven files to look through.
|
| May31-12, 06:27 PM | #10 |
|
|
I talked to my supervisor and he explained that you simply have to run the program (./blub) and then the output will appear in output.f and a file called fort.51. The list of data that appears in fort.51 is what I need, but I just can't get it to work, the file remains empty. Before running back to my supervisor again, could anyone maybe test this program to see if they can get it work?
It comes with a makefile, so the only thing you need to do is use the make command and then ./blub. After that a list of data should appear in the file fort.51 The settings can be changed in continue.f, but it should work as is. Could anyone please try it? http://www.students.science.uu.nl/~3418138/ZC.tar |
| May31-12, 10:29 PM | #11 |
|
|
Arjani:
If anyone should attempt to compile such program, they would need to have nag library installed. Anyway... If you are really going to take on this project, I recommend that you stop postponing on learning a little fortran. You should go ahead and start placing a few "write" statements just to standard output and see how far in the program you get and see where it is that the program is stalling. A few 'grep' commands on your files reveal quite a few things...
good luck |
| New Reply |
| Thread Tools | |
Similar Threads for: Executing a compiled program in Unix
|
||||
| Thread | Forum | Replies | ||
| Compiling a program in Unix | Programming & Comp Sci | 3 | ||
| To query all the file attributes in unix using a c program. | Engineering, Comp Sci, & Technology Homework | 0 | ||
| C program to mimic wc command in UNIX | Programming & Comp Sci | 2 | ||