compilation problem
Hi Linux users
I'm new in Linux. I tried to compile a Fortran program in ubuntu 11.10 with gcc. My fortran program is monte_pi. I saved it in the Desktop. But when I changed directory to /home/nagat/Desktop and run gcc -o monte_pi monte_pi.f . An error appeared to me gcc:error:monte_pi: no such file or directory gcc:fatal error:no input file compilation terminated please can any one help me to get over this error? Thanks in advance Bests Nagat |
Make sure you are in the correct directory with 'pwd'. Make sure that the file exists with 'ls'. It looks like the compiler cannot find monte_pi.f.
|
Welcome to LQ. http://www.dartmouth.edu/~rc/classes...simple_ex.html
The file name is monte_pi.f : It's a Fortran program → gcc cannot be used. Ubuntu 11.10 : 1) sudo apt-get install gfortran 2) gfortran -c monte_pi.f 3) gfortran -o monte_pi monte_pi.o : You get the executable 'monte_pi'. ... Or the simple way (2)(3) : gfortran monte_pi.f -o monte_pi 4) Run the pi test : ./monte_pi Code:
C Program to compute Pi using monte carlo methods . |
All times are GMT -5. The time now is 01:43 AM. |