- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi guys,
I am pretty a new learner in Fortran. I am running a code in Fortran 90 on linux. I am using gfortran -macmodel=medium -o file silename.f90 to compile the code and making it executable. After doing this I got the error
online@balmr:~/group/Far/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 )
I am pretty sure that the code that I am working is bug free as my colleague run it his self. Any help would be very appreciated.
Best,
Farzaneh
コピーされたリンク
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
You accidently tried to execute the Fortran source file and not the executable you built. Maybe you just need to drop the ".f90" assuming you named the executable: centroidmega-pimms2
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
gfortran isn't a subject of this forum, although Intel Fortran shares the relevant options.
I guess, by misspelling -mcmodel, the compiler may ignore that option.
As you named the executable "file," you would run it by ./file
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Thanks for your reply.
I also do this but I got No such file or directory error.
Is there any thing wrong with the compiling way?
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
@ Tim:
sorry I did not know here is not a good place to ask this question.
I typed it mcmodel in the terminal. Still no success.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
online@balm:~/group/Far/Fortran$ ./centroidmega-pimms2
-bash: ./centroidmega-pimms2: No such file or directory
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
We might be able to better advise you if you capture and post the actual compilation line that you are using.
To compile and run the resulting executable you basically do something like what is shown below.
To compile with our Intel Fortran compiler (ifort) use:
$ ifort -o sample.exe sample.f90 $ ./sample.exe Testing 123....
To compile with gfortran, use:
$ gfortran -o sample.exe sample.f90 $ ./sample.exe Testing 123....
The -o option specifies the executable name.
