Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

command not found error

Status
Not open for further replies.

farzaneh2620

Programmer
Feb 19, 2016
2
US
Hello ALL,

I am a new learner in Fortran. I want to run my code on linux but after compiling get this error. Can any one by chance have some idea what is causing this problem here? Any help would be much appreciated.

Best,

Farzaneh

aronline@balmer:~/argroup/Farzaneh/Fortran$ gfortran -mcmodel=medium -o file centroidmega-pimms2.f90
aronline@balmer:~/argroup/Farzaneh/Fortran$ ./centroidmega-pimms2
-bash: ./centroidmega-pimms2: No such file or directory
aronline@balmer:~/argroup/Farzaneh/Fortran$ ^C
aronline@balmer:~/argroup/Farzaneh/Fortran$ ./centroidmega-pimms2.f90
./centroidmega-pimms2.f90: line 1: Program: command not found
./centroidmega-pimms2.f90: line 2: $'\r': command not found
./centroidmega-pimms2.f90: line 3: Implicit: command not found
./centroidmega-pimms2.f90: line 4: $'!\r': command not found
./centroidmega-pimms2.f90: line 5: Centroids: command not found
./centroidmega-pimms2.f90: line 6: Kasra: command not found
./centroidmega-pimms2.f90: line 7: $'!\r': command not found
./centroidmega-pimms2.f90: line 8: $'\r': command not found
./centroidmega-pimms2.f90: line 9: syntax error near unexpected token `('
./centroidmega-pimms2.f90: line 9: ` Integer, Parameter :: wp = Selected_real_k'nd( 12, 70 )

 
Let us analyze what you've done
Code:
gfortran -mcmodel=medium -o file centroidmega-pimms2.f90
This compiles the program centroidmega-pimms2.f90 to create the executable file. To run this program you should type

./file

The executable is not called centroidmega-pimms2. If you wanted that, you should have used
Code:
gfortran -mcmodel=medium -o centroidmega-pimms2 centroidmega-pimms2.f90
The rest of it: you're trying to execute the source code. This basically tries to execute every line as shell script and fails.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top