Поскольку я обновился до Windows 10 и установил Python xy на свой 64-битный компьютер с Windows 10, я больше не могу компилировать модули f2py.
F2py находит компилятор gfortran и, по-видимому, mingw32, но все усилия заканчиваются ошибками и в конечном итоге приводят к ошибке с кодом 1:
U:\f2py Test>f2py fortran_sum.f90 -c --fcompiler=gnu95 --compiler=mingw32
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 "untitled" sources
f2py options: []
f2py:> c:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\src.win32-2.7\untitledmodule.c
creating c:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\src.win32-2.7
Reading fortran codes...
Reading file 'fortran_sum.f90' (format:free)
Post-processing...
Block: untitled
Block: fortran_sum
Post-processing (stage 2)...
Building modules...
Building module "untitled"...
Constructing wrapper function "fortran_sum"...
su = fortran_sum(a,b)
Wrote C/API module "untitled" to file "c:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\src.win32-2.7\untitledmodule.c"
adding 'c:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\src.win32-2.7\fortranobject.c' to sources.
adding 'c:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\src.win32-2.7' to include_dirs.
copying C:\Python27\lib\site-packages\numpy\f2py\src\fortranobject.c -> c:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\src.win32-2.7
copying C:\Python27\lib\site-packages\numpy\f2py\src\fortranobject.h -> c:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\src.win32-2.7
build_src: building npy-pkg config files
running build_ext
Cannot build msvcr library: "msvcr90d.dll" not found
customize Mingw32CCompiler
customize Mingw32CCompiler using build_ext
customize Gnu95FCompiler
Found executable C:\mingw32-xy\bin\gfortran.exe
Found executable C:\mingw32-xy\bin\gfortran.exe
customize Gnu95FCompiler using build_ext
building 'untitled' extension
compiling C sources
C compiler: gcc -O2 -Wall -Wstrict-prototypes
creating c:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\Release
creating c:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\Release\users
creating c:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\Release\users\username~1.hyd
creating c:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\Release\users\username~1.hyd\appdata
creating c:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\Release\users\username~1.hyd\appdata\local
creating c:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\Release\users\username~1.hyd\appdata\local\temp
creating c:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\Release\users\username~1.hyd\appdata\local\temp\tmpu30_2r
creating c:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\Release\users\username~1.hyd\appdata\local\temp\tmpu30_2r\src.win32-2.7
compile options: '-DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x0900 -Ic:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\src.win32-2.7 -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC -c'
gcc -O2 -Wall -Wstrict-prototypes -DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x0900 -Ic:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\src.win32-2.7 -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC -c c:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\src.win32-2.7\untitledmodule.c -o c:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\Release\users\username~1.hyd\appdata\local\temp\tmpu30_2r\src.win32-2.7\untitledmodule.o
Found executable C:\mingw32-xy\bin\gcc.exe
gcc -O2 -Wall -Wstrict-prototypes -DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x0900 -Ic:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\src.win32-2.7 -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC -c c:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\src.win32-2.7\fortranobject.c -o c:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\Release\users\username~1.hyd\appdata\local\temp\tmpu30_2r\src.win32-2.7\fortranobject.o
compiling Fortran sources
Fortran f77 compiler: C:\mingw32-xy\bin\gfortran.exe -Wall -g -ffixed-form -fno-second-underscore -O3 -funroll-loops
Fortran f90 compiler: C:\mingw32-xy\bin\gfortran.exe -Wall -g -fno-second-underscore -O3 -funroll-loops
Fortran fix compiler: C:\mingw32-xy\bin\gfortran.exe -Wall -g -ffixed-form -fno-second-underscore -Wall -g -fno-second-underscore -O3 -funroll-loops
compile options: '-Ic:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\src.win32-2.7 -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC -c'
gfortran.exe:f90: fortran_sum.f90
C:\mingw32-xy\bin\gfortran.exe -Wall -g -Wall -g -shared c:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\Release\users\username~1.hyd\appdata\local\temp\tmpu30_2r\src.win32-2.7\untitledmodule.o c:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\Release\users\username~1.hyd\appdata\local\temp\tmpu30_2r\src.win32-2.7\fortranobject.o c:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\Release\fortran_sum.o -Lc:\mingw32-xy\lib\gcc\mingw32\4.5.2 -LC:\Python27\libs -LC:\Python27\PCbuild -lpython27 -lgfortran -o .\untitled.pyd
C:\Python27\libs/libpython27.a(dmmes00281.o):(.idata$7+0x0): undefined reference to `_head_C__build27_cpython_PCBuild_libpython27_a'
C:\Python27\libs/libpython27.a(dmmes00105.o):(.idata$7+0x0): undefined reference to `_head_C__build27_cpython_PCBuild_libpython27_a'
C:\Python27\libs/libpython27.a(dmmes01026.o):(.idata$7+0x0): undefined reference to `_head_C__build27_cpython_PCBuild_libpython27_a'
C:\Python27\libs/libpython27.a(dmmes00712.o):(.idata$7+0x0): undefined reference to `_head_C__build27_cpython_PCBuild_libpython27_a'
C:\Python27\libs/libpython27.a(dmmes00054.o):(.idata$7+0x0): undefined reference to `_head_C__build27_cpython_PCBuild_libpython27_a'
C:\Python27\libs/libpython27.a(dmmes00220.o):(.idata$7+0x0): more undefined references to `_head_C__build27_cpython_PCBuild_libpython27_a' follow
collect2: ld returned 1 exit status
error: Command "C:\mingw32-xy\bin\gfortran.exe -Wall -g -Wall -g -shared c:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\Release\users\username~1.hyd\appdata\local\temp\tmpu30_2r\src.win32-2.7\untitledmodule.o c:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\Release\users\username~1.hyd\appdata\local\temp\tmpu30_2r\src.win32-2.7\fortranobject.o c:\users\username~1.hyd\appdata\local\temp\tmpu30_2r\Release\fortran_sum.o -Lc:\mingw32-xy\lib\gcc\mingw32\4.5.2 -LC:\Python27\libs -LC:
\Python27\PCbuild -lpython27 -lgfortran -o .\untitled.pyd" failed with exit status 1
Вот информация из -c --help-fcompiler: Найдены компиляторы Fortran: --fcompiler=gnu95 Компилятор GNU Fortran 95 (4.5.2)
На моем старом сервере Python тот же код fortran компилируется в PYD, который можно использовать, но не в моей новой среде. Поскольку компилятор FORTRAN можно найти, ошибка должна быть где-то еще. Любые идеи?