- #1
- 88
- 0
Hi!
I've never done any programming in fortran and got stuck trying to test run a program.
Note that I am not learning how to program in fortran, this is for an astrophysics course.
Basically what I need is an instruction how to run a fortran code if I have some .f files and .o files as well as an input file.
The detailed description of what I'm trying to do:
I'm trying to run the code Nbody1 from this http://www.ast.cam.ac.uk/~sverre/web/pages/nbody.htm" [Broken]
The first problem is making the file. After I download and uncompressed nbody1.tar.Z I can't really make the file since I'm a Mac user and I don't have the f77 compiler (I have g77). So I edited Makefile in dir /nbody1/Real8 by changing line fortran compiler = f77 to FC = g77.
When I make file I then get an error:
O3 nbody1.o block.o bodies.o cmcorr.o check.o cputim.o data.o define.o energy.o escape.o fpoly1.o fpoly2.o frame.o input.o intgrt.o modify.o mydump.o nbint.o output.o ran2.o remove.o scale.o start.o stepi.o steps.o subsys.o verify.o xvpred.o zero.o -o nbody1
make: O3: No such file or directory
make: [nbody1] Error 1 (ignored)
Which might not be relevant since all object files seem to be created. I then try to run nbody1 using "intest" input file. I get really stuck here. In the instructions from the lecturer it says that the command to run is: 3. Run the code (“../Real8/nbody1 < intest”) I have no idea how this should work. If I type the above in I always get bash: no such file or directory. If I indeed have to type that in, which directory should I be in when typing that in?
I tried going to Real8 and typing ./nbody1.o or ./nbody1.f but I always get :
MacBook-Pro-Jan-Zaucha:Real8 janzaucha$ ./nbody1.f < intest
./nbody1.f: line 1: Makefile: command not found
./nbody1.f: line 2: Makefile: command not found
./nbody1.f: line 3: Makefile: command not found
./nbody1.f: line 4: Makefile: command not found
./nbody1.f: line 5: Makefile: command not found
./nbody1.f: line 6: Makefile: command not found
./nbody1.f: line 7: Makefile: command not found
./nbody1.f: line 8: Makefile: command not found
./nbody1.f: line 9: Makefile: command not found
./nbody1.f: line 10: Makefile: command not found
./nbody1.f: line 11: Makefile: command not found
./nbody1.f: line 12: PROGRAM: command not found
./nbody1.f: line 13: Makefile: command not found
./nbody1.f: line 14: INCLUDE: command not found
./nbody1.f: line 15: Makefile: command not found
./nbody1.f: line 16: Makefile: command not found
./nbody1.f: line 17: Makefile: command not found
./nbody1.f: line 18: syntax error near unexpected token `('
./nbody1.f: line 18: ` CALL CPUTIM(CPU0) '
or:
MacBook-Pro-Jan-Zaucha:Real8 janzaucha$ ./nbody1.o < intest
Illegal instruction: 4
Fortran users please help me, I don't have time to learn fortran now, as I'm supposed to perform some Nbody simulations and write a report. If I don't figure out how to make this work quick, I'll run out of time!
Great thanks in advance!
I've never done any programming in fortran and got stuck trying to test run a program.
Note that I am not learning how to program in fortran, this is for an astrophysics course.
Basically what I need is an instruction how to run a fortran code if I have some .f files and .o files as well as an input file.
The detailed description of what I'm trying to do:
I'm trying to run the code Nbody1 from this http://www.ast.cam.ac.uk/~sverre/web/pages/nbody.htm" [Broken]
The first problem is making the file. After I download and uncompressed nbody1.tar.Z I can't really make the file since I'm a Mac user and I don't have the f77 compiler (I have g77). So I edited Makefile in dir /nbody1/Real8 by changing line fortran compiler = f77 to FC = g77.
When I make file I then get an error:
O3 nbody1.o block.o bodies.o cmcorr.o check.o cputim.o data.o define.o energy.o escape.o fpoly1.o fpoly2.o frame.o input.o intgrt.o modify.o mydump.o nbint.o output.o ran2.o remove.o scale.o start.o stepi.o steps.o subsys.o verify.o xvpred.o zero.o -o nbody1
make: O3: No such file or directory
make: [nbody1] Error 1 (ignored)
Which might not be relevant since all object files seem to be created. I then try to run nbody1 using "intest" input file. I get really stuck here. In the instructions from the lecturer it says that the command to run is: 3. Run the code (“../Real8/nbody1 < intest”) I have no idea how this should work. If I type the above in I always get bash: no such file or directory. If I indeed have to type that in, which directory should I be in when typing that in?
I tried going to Real8 and typing ./nbody1.o or ./nbody1.f but I always get :
MacBook-Pro-Jan-Zaucha:Real8 janzaucha$ ./nbody1.f < intest
./nbody1.f: line 1: Makefile: command not found
./nbody1.f: line 2: Makefile: command not found
./nbody1.f: line 3: Makefile: command not found
./nbody1.f: line 4: Makefile: command not found
./nbody1.f: line 5: Makefile: command not found
./nbody1.f: line 6: Makefile: command not found
./nbody1.f: line 7: Makefile: command not found
./nbody1.f: line 8: Makefile: command not found
./nbody1.f: line 9: Makefile: command not found
./nbody1.f: line 10: Makefile: command not found
./nbody1.f: line 11: Makefile: command not found
./nbody1.f: line 12: PROGRAM: command not found
./nbody1.f: line 13: Makefile: command not found
./nbody1.f: line 14: INCLUDE: command not found
./nbody1.f: line 15: Makefile: command not found
./nbody1.f: line 16: Makefile: command not found
./nbody1.f: line 17: Makefile: command not found
./nbody1.f: line 18: syntax error near unexpected token `('
./nbody1.f: line 18: ` CALL CPUTIM(CPU0) '
or:
MacBook-Pro-Jan-Zaucha:Real8 janzaucha$ ./nbody1.o < intest
Illegal instruction: 4
Fortran users please help me, I don't have time to learn fortran now, as I'm supposed to perform some Nbody simulations and write a report. If I don't figure out how to make this work quick, I'll run out of time!
Great thanks in advance!
Last edited by a moderator: