- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@ 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
online@balm:~/group/Far/Fortran$ ./centroidmega-pimms2
-bash: ./centroidmega-pimms2: No such file or directory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page