Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29251 ディスカッション

command not found error

Farzaneh_z_
ビギナー
2,757件の閲覧回数

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

 

0 件の賞賛
6 返答(返信)
Kevin_D_Intel
従業員
2,757件の閲覧回数

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

TimP
名誉コントリビューター III
2,758件の閲覧回数

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

Farzaneh_z_
ビギナー
2,758件の閲覧回数

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?

Farzaneh_z_
ビギナー
2,758件の閲覧回数

@ 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.

 

Farzaneh_z_
ビギナー
2,758件の閲覧回数

online@balm:~/group/Far/Fortran$ ./centroidmega-pimms2
-bash: ./centroidmega-pimms2: No such file or directory

Kevin_D_Intel
従業員
2,758件の閲覧回数

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.

返信