Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
708 views
in Technique[技术] by (71.8m points)

python - How do I resolve "no Fortran compiler found" in f2py?

I am trying to implement this example of f2py, "the quick and smart way", https://numpy.org/doc/stable/f2py/f2py.getting-started.html#the-quick-and-smart-way

And get this error when I run the command:

running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building extension "fib3" sources
f2py options: []
f2py:> C:UsersNickAppDataLocalTempmpq7xlox0isrc.win-amd64-3.6fib3module.c
creating C:UsersNickAppDataLocalTempmpq7xlox0isrc.win-amd64-3.6
IOError: [Errno 2] No such file or directory: 'fib3.f'. Skipping file "fib3.f".
Reading fortran codes...
Post-processing...
Post-processing (stage 2)...
Building modules...
error: f2py target file 'C:\Users\Nick\AppData\Local\Temp\tmpq7xlox0i\src.win-amd64-3.6\fib3module.c' not generated

Beforehand I used the MinGW installation manager for Windows from here, https://gcc.gnu.org/wiki/GFortranBinaries#Windows and installed the dev toolkit, base, fortran, g++, and msys-base packages and I don't know what is going wrong.

Thank you for any advice related to f2py.

Edit: I used the suffix .f90 instead of .f and I'm getting different errors.

Could not locate executable g77
Could not locate executable f77
customize IntelVisualFCompiler
Could not locate executable ifort
Could not locate executable ifl
customize AbsoftFCompiler
Could not locate executable f90
customize CompaqVisualFCompiler
Could not locate executable DF
customize IntelItaniumVisualFCompiler
Could not locate executable efl
customize Gnu95FCompiler
Could not locate executable gfortran
Could not locate executable f95
customize G95FCompiler
Could not locate executable g95
customize IntelEM64VisualFCompiler
customize IntelEM64TFCompiler
Could not locate executable efort
Could not locate executable efc
customize PGroupFlangCompiler
Could not locate executable flang
don't know how to compile Fortran code on platform 'nt'
warning: build_ext: f77_compiler=None is not available.

building 'fib3' extension
error: extension 'fib3' has Fortran sources but no Fortran compiler found
question from:https://stackoverflow.com/questions/65844353/how-do-i-resolve-no-fortran-compiler-found-in-f2py

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...