You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use f2py to create a python module.But it dosen't works. I use intel onapi and ifort.
This is my fortran code(test_add.f90):
subroutinemyadd(a,b,c)
implicit nonereal*8::a,b,c
c = a + b
endsubroutine
ifort works in my pc:
(base) PS C:\Users\yingzi\Documents\pythonfile\f2py_learn> ifort
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.12.0 Build 20240222_000000
Copyright (C) 1985-2024 Intel Corporation. All rights reserved.
ifort: remark #10448: Intel(R) Fortran Compiler Classic (ifort) is now deprecated and will be discontinued late 2024. Intel recommends that customers transition now to using the LLVM-based Intel(R) Fortran Compiler (ifx) for continued Windows* and Linux* support, new language support, new language features, and optimizations. Use '/Qdiag-disable:10448' to disable this message.
ifort: command line error: no files specified; for help type "ifort /help"
(base) PS C:\Users\yingzi\Documents\pythonfile\f2py_learn> f2py -c test_add.f90 -m testadd
`C:\Users\yingzi\AppData\Roaming\Python\Python310\site-packages\numpy\f2py\f2py2e.py:719: VisibleDeprecationWarning: distutils has been deprecated since NumPy 1.26.xUse the Meson backend instead, or generate wrapperswithout -c and use a custom build script
builder = build_backend(
running build
running config_cc
INFO: unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
INFO: unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
INFO: build_src
INFO: building extension "testadd" sources
INFO: f2py options: []
INFO: f2py:> C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\src.win-amd64-3.10\testaddmodule.c
creating C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\src.win-amd64-3.10
Reading fortran codes...
Reading file 'test_add.f90' (format:free)
Post-processing...
Block: testadd
Block: myadd
Applying post-processing hooks...
character_backward_compatibility_hook
Post-processing (stage 2)...
Building modules...
Building module "testadd"...
Generating possibly empty wrappers"
Maybe empty "testadd-f2pywrappers.f"
Constructing wrapper function "myadd"...
myadd(a,b,c)
Wrote C/API module "testadd" to file "C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\src.win-amd64-3.10\testaddmodule.c"
INFO: adding 'C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\src.win-amd64-3.10\fortranobject.c' to sources.
INFO: adding 'C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\src.win-amd64-3.10' to include_dirs.
copying C:\Users\yingzi\AppData\Roaming\Python\Python310\site-packages\numpy\f2py\src\fortranobject.c -> C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\src.win-amd64-3.10
copying C:\Users\yingzi\AppData\Roaming\Python\Python310\site-packages\numpy\f2py\src\fortranobject.h -> C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\src.win-amd64-3.10
INFO: adding 'C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\src.win-amd64-3.10\testadd-f2pywrappers.f' to sources.
INFO: build_src: building npy-pkg config files
C:\ProgramData\anaconda3\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build_ext
INFO: No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
INFO: customize MSVCCompiler
INFO: customize MSVCCompiler using build_ext
INFO: get_default_fcompiler: matching types: '['gnu', 'intelv', 'absoft', 'compaqv', 'intelev', 'gnu95', 'g95', 'intelvem', 'intelem', 'flang']'
INFO: customize GnuFCompiler
WARN: Could not locate executable g77
WARN: Could not locate executable f77
INFO: customize IntelVisualFCompiler
INFO: Found executable C:\Program Files (x86)\Intel\oneAPI\compiler\latest\bin\ifort.exe
WARN: Could not locate executable C:\Program
INFO: customize AbsoftFCompiler
WARN: Could not locate executable f90
INFO: customize CompaqVisualFCompiler
WARN: Could not locate executable DF
INFO: customize IntelItaniumVisualFCompiler
WARN: Could not locate executable efl
INFO: customize Gnu95FCompiler
WARN: Could not locate executable gfortran
WARN: Could not locate executable f95
INFO: customize G95FCompiler
WARN: Could not locate executable g95
INFO: customize IntelEM64VisualFCompiler
INFO: customize IntelEM64VisualFCompiler
INFO: customize IntelEM64VisualFCompiler using build_ext
INFO: building 'testadd' extension
INFO: compiling C sources
creating C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\Release\Users
creating C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\Release\Users\yingzi
creating C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\Release\Users\yingzi\AppData
creating C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\Release\Users\yingzi\AppData\Local
creating C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\Release\Users\yingzi\AppData\Local\Temp
creating C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\Release\Users\yingzi\AppData\Local\Temp\tmpf837pzn_
creating C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\Release\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\src.win-amd64-3.10
INFO: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\bin\HostX86\x64\cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DNPY_DISABLE_OPTIMIZATION=1 -IC:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\src.win-amd64-3.10 -IC:\Users\yingzi\AppData\Roaming\Python\Python310\site-packages\numpy\core\include -IC:\ProgramData\anaconda3\include -IC:\ProgramData\anaconda3\Include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\ATLMFC\include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt /TcC:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\src.win-amd64-3.10\testaddmodule.c /FoC:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\Release\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\src.win-amd64-3.10\testaddmodule.obj
INFO: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\bin\HostX86\x64\cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DNPY_DISABLE_OPTIMIZATION=1 -IC:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\src.win-amd64-3.10 -IC:\Users\yingzi\AppData\Roaming\Python\Python310\site-packages\numpy\core\include -IC:\ProgramData\anaconda3\include -IC:\ProgramData\anaconda3\Include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\ATLMFC\include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt /TcC:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\src.win-amd64-3.10\fortranobject.c /FoC:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\Release\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\src.win-amd64-3.10\fortranobject.obj
INFO: compiling Fortran sources
INFO: Fortran f77 compiler: C:\Program Files (x86)\Intel\oneAPI\compiler\latest\bin\ifort.exe Files (x86)\Intel\oneAPI\compiler\latest\bin\ifort.exe /nologo /MD /nbs /names:lowercase /assume:underscore /fpp /O1 /assume:minus0
Fortran f90 compiler: C:\Program Files (x86)\Intel\oneAPI\compiler\latest\bin\ifort.exe Files (x86)\Intel\oneAPI\compiler\latest\bin\ifort.exe /nologo /MD /nbs /names:lowercase /assume:underscore /fpp /O1 /assume:minus0
Fortran fix compiler: C:\Program Files (x86)\Intel\oneAPI\compiler\latest\bin\ifort.exe Files (x86)\Intel\oneAPI\compiler\latest\bin\ifort.exe /nologo /MD /nbs /names:lowercase /assume:underscore /fpp /O1 /assume:minus0
INFO: compile options: '-IC:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\src.win-amd64-3.10 -IC:\Users\yingzi\AppData\Roaming\Python\Python310\site-packages\numpy\core\include -IC:\ProgramData\anaconda3\include -IC:\ProgramData\anaconda3\Include -c'
INFO: ifort.exe:f90: test_add.f90
ifort: remark #10448: Intel(R) Fortran Compiler Classic (ifort) is now deprecated and will be discontinued late 2024. Intel recommends that customers transition now to using the LLVM-based Intel(R) Fortran Compiler (ifx) for continued Windows* and Linux* support, new language support, new language features, and optimizations. Use '/Qdiag-disable:10448' to disable this message.
ifort: command line warning #10161: unrecognized source type 'Files'; object file assumed
ifort: command line warning #10161: unrecognized source type '(x86)\Intel\oneAPI\compiler\latest\bin\ifort.exe'; object file assumed
ifort: command line warning #10006: ignoring unknown option '/c '
ifort: warning #10145: no action performed for file 'Files'
ifort: warning #10145: no action performed for file '(x86)\Intel\oneAPI\compiler\latest\bin\ifort.exe'
INFO: ifort.exe:f77: C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\src.win-amd64-3.10\testadd-f2pywrappers.f
ifort: remark #10448: Intel(R) Fortran Compiler Classic (ifort) is now deprecated and will be discontinued late 2024. Intel recommends that customers transition now to using the LLVM-based Intel(R) Fortran Compiler (ifx) for continued Windows* and Linux* support, new language support, new language features, and optimizations. Use '/Qdiag-disable:10448' to disable this message.
ifort: command line warning #10161: unrecognized source type 'Files'; object file assumed
ifort: command line warning #10161: unrecognized source type '(x86)\Intel\oneAPI\compiler\latest\bin\ifort.exe'; object file assumed
ifort: command line warning #10006: ignoring unknown option '/c '
ifort: warning #10145: no action performed for file 'Files'
ifort: warning #10145: no action performed for file '(x86)\Intel\oneAPI\compiler\latest\bin\ifort.exe'
INFO: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\ProgramData\anaconda3\libs /LIBPATH:C:\ProgramData\anaconda3 /LIBPATH:C:\ProgramData\anaconda3\PCbuild\amd64 /LIBPATH:C:\ProgramData\anaconda3\libs /LIBPATH:C:\ProgramData\anaconda3 /LIBPATH:C:\ProgramData\anaconda3\PCbuild\amd64 /LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\ATLMFC\lib\x64 /LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\lib\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22621.0\\um\x64 /EXPORT:PyInit_testadd C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\Release\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\src.win-amd64-3.10\testaddmodule.obj C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\Release\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\src.win-amd64-3.10\fortranobject.obj C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\Release\test_add.o C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\Release\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\src.win-amd64-3.10\testadd-f2pywrappers.o /OUT:.\testadd.cp310-win_amd64.pyd /IMPLIB:C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\Release\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\src.win-amd64-3.10\testadd.cp310-win_amd64.lib
LINK : fatal error LNK1104: �����ļ���ifconsol.lib��
error: Command "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\ProgramData\anaconda3\libs /LIBPATH:C:\ProgramData\anaconda3 /LIBPATH:C:\ProgramData\anaconda3\PCbuild\amd64 /LIBPATH:C:\ProgramData\anaconda3\libs /LIBPATH:C:\ProgramData\anaconda3 /LIBPATH:C:\ProgramData\anaconda3\PCbuild\amd64 /LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\ATLMFC\lib\x64 /LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\lib\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22621.0\\um\x64 /EXPORT:PyInit_testadd C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\Release\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\src.win-amd64-3.10\testaddmodule.obj C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\Release\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\src.win-amd64-3.10\fortranobject.obj C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\Release\test_add.o C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\Release\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\src.win-amd64-3.10\testadd-f2pywrappers.o /OUT:.\testadd.cp310-win_amd64.pyd /IMPLIB:C:\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\Release\Users\yingzi\AppData\Local\Temp\tmpf837pzn_\src.win-amd64-3.10\testadd.cp310-win_amd64.lib" failed with exit status 1104`
The text was updated successfully, but these errors were encountered:
I use f2py to create a python module.But it dosen't works. I use intel onapi and ifort.
This is my fortran code(test_add.f90):
ifort works in my pc:
(base) PS C:\Users\yingzi\Documents\pythonfile\f2py_learn> ifort
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.12.0 Build 20240222_000000
Copyright (C) 1985-2024 Intel Corporation. All rights reserved.
ifort: remark #10448: Intel(R) Fortran Compiler Classic (ifort) is now deprecated and will be discontinued late 2024. Intel recommends that customers transition now to using the LLVM-based Intel(R) Fortran Compiler (ifx) for continued Windows* and Linux* support, new language support, new language features, and optimizations. Use '/Qdiag-disable:10448' to disable this message.
ifort: command line error: no files specified; for help type "ifort /help"
The text was updated successfully, but these errors were encountered: