1

i wanna create python madule from fortran code( .f90) . i use windows 10 64 bit, python 3.9 64 bit and MinGW . i added C:\MinGW\bin path to environment variables. when i run ***f2py -c simple.f90 -m simple***, an error arise (below error):

gfortran.exe: error: /w: No such file or directory
gfortran.exe: error: /Qopenmp: No such file or directory
gfortran.exe: error: /F6000000: No such file or directory
gfortran.exe: error: /I:C:\Program Files (x86)\VNI\imsl\fnl600\IA32\include\dll: Invalid argument
gfortran.exe: error: /fpe:3: No such file or directory
gfortran.exe: error: /nologo: No such file or directory
Driving: C:\MinGW\bin\gfortran.exe -Wall -g -ffixed-form -fno-second-underscore /w /Qopenmp /F6000000 /I:C:\Program Files (x86)\VNI\imsl\fnl600\IA32\include\dll /fpe:3 /nologo -O3 -funroll-loops -v -l gfortran -shared-libgcc
gfortran.exe: error: /w: No such file or directory
gfortran.exe: error: /Qopenmp: No such file or directory
gfortran.exe: error: /F6000000: No such file or directory
gfortran.exe: error: /I:C:\Program Files (x86)\VNI\imsl\fnl600\IA32\include\dll: Invalid argument
gfortran.exe: error: /fpe:3: No such file or directory
gfortran.exe: error: /nologo: No such file or directory
Using built-in specs.
COLLECT_GCC=C:\MinGW\bin\gfortran.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/lto-wrapper.exe
Target: mingw32
Configured with: ../src/gcc-6.3.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --with-gmp=/mingw --with-mpfr=/mingw --with-mpc=/mingw --with-isl=/mingw --prefix=/mingw --disable-win32-registry --target=mingw32 --with-arch=i586 --enable-languages=c,c++,objc,obj-c++,fortran,ada --with-pkgversion='MinGW.org GCC-6.3.0-1' --enable-static --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw --enable-libstdcxx-debug --with-tune=generic --enable-libgomp --disable-libvtv --enable-nls
Thread model: win32
gcc version 6.3.0 (MinGW.org GCC-6.3.0-1) 
gfortran.exe: error: /w: No such file or directory
gfortran.exe: error: /Qopenmp: No such file or directory
gfortran.exe: error: /F6000000: No such file or directory
gfortran.exe: error: /I:C:\Program Files (x86)\VNI\imsl\fnl600\IA32\include\dll: Invalid argument
gfortran.exe: error: /fpe:3: No such file or directory
gfortran.exe: error: /nologo: No such file or directory
gfortran.exe: error: /w: No such file or directory
gfortran.exe: error: /Qopenmp: No such file or directory
gfortran.exe: error: /F6000000: No such file or directory
gfortran.exe: error: /I:C:\Program Files (x86)\VNI\imsl\fnl600\IA32\include\dll: Invalid argument
gfortran.exe: error: /fpe:3: No such file or directory
gfortran.exe: error: /nologo: No such file or directory
Driving: C:\MinGW\bin\gfortran.exe -Wall -g -ffixed-form -fno-second-underscore /w /Qopenmp /F6000000 /I:C:\Program Files (x86)\VNI\imsl\fnl600\IA32\include\dll /fpe:3 /nologo -O3 -funroll-loops -v -l gfortran -shared-libgcc
gfortran.exe: error: /w: No such file or directory
gfortran.exe: error: /Qopenmp: No such file or directory
gfortran.exe: error: /F6000000: No such file or directory
gfortran.exe: error: /I:C:\Program Files (x86)\VNI\imsl\fnl600\IA32\include\dll: Invalid argument
gfortran.exe: error: /fpe:3: No such file or directory
gfortran.exe: error: /nologo: No such file or directory
Using built-in specs.
COLLECT_GCC=C:\MinGW\bin\gfortran.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/lto-wrapper.exe
Target: mingw32
Configured with: ../src/gcc-6.3.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --with-gmp=/mingw --with-mpfr=/mingw --with-mpc=/mingw --with-isl=/mingw --prefix=/mingw --disable-win32-registry --target=mingw32 --with-arch=i586 --enable-languages=c,c++,objc,obj-c++,fortran,ada --with-pkgversion='MinGW.org GCC-6.3.0-1' --enable-static --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw --enable-libstdcxx-debug --with-tune=generic --enable-libgomp --disable-libvtv --enable-nls
Thread model: win32
gcc version 6.3.0 (MinGW.org GCC-6.3.0-1) 
gfortran.exe: error: /w: No such file or directory
gfortran.exe: error: /Qopenmp: No such file or directory
gfortran.exe: error: /F6000000: No such file or directory
gfortran.exe: error: /I:C:\Program Files (x86)\VNI\imsl\fnl600\IA32\include\dll: Invalid argument
gfortran.exe: error: /fpe:3: No such file or directory
gfortran.exe: error: /nologo: No such file or directory
error: Unable to find vcvarsall.bat

where is the problem?

behnam4444
  • 21
  • 4
  • f2py can detect your compiler automatically, and it seems it thinks you have Intel Fortran installed somewhere (hence the compiler options, like `/Qopenmp`, that are specific to Intel Fortran). It's also possible to tell f2py which compiler you want to use: lookup the `--fcompiler` option in the [manual](https://numpy.org/doc/stable/f2py/usage.html) or have a look here: https://stackoverflow.com/questions/48826283/compile-fortran-module-with-f2py-and-python-3-6-on-windows-10. When compiling from the MSYS2 terminal, the gfortran compiler is usually detected (if installed), you may try that. –  Sep 01 '21 at 05:14
  • By the way, to use gcc or gfortran on Windows, I strongly recommend [MSYS2](https://www.msys2.org/), as you will get both a recent compiler and a lot of additional packages, that you can install with pacman (Python and LAPACK, among others). Other Windows projects based on gcc use MSYS2 as well (for instance R, Octave, Strawberry Perl...). –  Sep 01 '21 at 05:19

0 Answers0