我正在努力让F2PY在windows7上与intelfortran一起工作。这似乎是一个常见的问题,我已经尝试了在其他帖子中找到的一些建议(如下所述)。在
关于我的系统的一些信息:
在做了一点研究see here后,我发现这个问题可能与C++运行时相关,所以我为Python安装了微软Visual C++。在
不过,当我试图构建一个简单的测试用例时,我收到以下错误:
D:\python stuff\enthought_ course\demo\f2py_fcopy>f2py -c --fcompiler=intelv --c
ompiler=msvc -m fcopy fcopy.f
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler opti
ons
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler opt
ions
running build_src
build_src
building extension "fcopy" sources
f2py options: []
f2py:> c:\users\mshippen\appdata\local\temp\tmpthkqug\src.win32-2.7\fcopymodule.
c
creating c:\users\mshippen\appdata\local\temp\tmpthkqug\src.win32-2.7
Reading fortran codes...
Reading file 'fcopy.f' (format:fix,strict)
Post-processing...
Block: fcopy
Block: fcopy
Post-processing (stage 2)...
Building modules...
Building module "fcopy"...
Constructing wrapper function "fcopy"...
getarrdims:warning: assumed shape array, using 0 instead of '*'
getarrdims:warning: assumed shape array, using 0 instead of '*'
fcopy(ain,n,aout)
Wrote C/API module "fcopy" to file "c:\users\mshippen\appdata\local\temp
\tmpthkqug\src.win32-2.7\fcopymodule.c"
adding 'c:\users\mshippen\appdata\local\temp\tmpthkqug\src.win32-2.7\fortranob
ject.c' to sources.
adding 'c:\users\mshippen\appdata\local\temp\tmpthkqug\src.win32-2.7' to inclu
de_dirs.
copying C:\Users\mshippen\AppData\Local\Enthought\Canopy32\User\lib\site-package
s\numpy\f2py\src\fortranobject.c -> c:\users\mshippen\appdata\local\temp\tmpthkq
ug\src.win32-2.7
copying C:\Users\mshippen\AppData\Local\Enthought\Canopy32\User\lib\site-package
s\numpy\f2py\src\fortranobject.h -> c:\users\mshippen\appdata\local\temp\tmpthkq
ug\src.win32-2.7
build_src: building npy-pkg config files
running build_ext
customize MSVCCompiler
customize MSVCCompiler using build_ext
customize IntelVisualFCompiler
Could not locate executable ifort
Could not locate executable ifl
Traceback (most recent call last):
File "C:\Users\mshippen\AppData\Local\Enthought\Canopy32\User\Scripts\f2py-scr
ipt.py", line 28, in <module>
main()
File "C:\Users\mshippen\AppData\Local\Enthought\Canopy32\User\lib\site-package
s\numpy\f2py\f2py2e.py", line 648, in main
run_compile()
File "C:\Users\mshippen\AppData\Local\Enthought\Canopy32\User\lib\site-package
s\numpy\f2py\f2py2e.py", line 633, in run_compile
setup(ext_modules=[ext])
File "C:\Users\mshippen\AppData\Local\Enthought\Canopy32\User\lib\site-package
s\numpy\distutils\core.py", line 169, in setup
return old_setup(**new_attr)
File "C:\Users\mshippen\AppData\Local\Enthought\Canopy32\App\appdata\canopy-1.
7.1.3323.win-x86\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "C:\Users\mshippen\AppData\Local\Enthought\Canopy32\App\appdata\canopy-1.
7.1.3323.win-x86\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Users\mshippen\AppData\Local\Enthought\Canopy32\App\appdata\canopy-1.
7.1.3323.win-x86\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Users\mshippen\AppData\Local\Enthought\Canopy32\User\lib\site-package
s\numpy\distutils\command\build.py", line 47, in run
old_build.run(self)
File "C:\Users\mshippen\AppData\Local\Enthought\Canopy32\App\appdata\canopy-1.
7.1.3323.win-x86\lib\distutils\command\build.py", line 127, in run
self.run_command(cmd_name)
File "C:\Users\mshippen\AppData\Local\Enthought\Canopy32\App\appdata\canopy-1.
7.1.3323.win-x86\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Users\mshippen\AppData\Local\Enthought\Canopy32\App\appdata\canopy-1.
7.1.3323.win-x86\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Users\mshippen\AppData\Local\Enthought\Canopy32\User\lib\site-package
s\numpy\distutils\command\build_ext.py", line 222, in run
fcompiler.customize(self.distribution)
File "C:\Users\mshippen\AppData\Local\Enthought\Canopy32\User\lib\site-package
s\numpy\distutils\fcompiler\__init__.py", line 464, in customize
self.find_executables()
File "C:\Users\mshippen\AppData\Local\Enthought\Canopy32\User\lib\site-package
s\numpy\distutils\fcompiler\__init__.py", line 354, in find_executables
raise CompilerNotFound('%s: f90 nor f77' % ctype)
numpy.distutils.fcompiler.CompilerNotFound: intelv: f90 nor f77
D:\python stuff\enthought_ course\demo\f2py_fcopy>
以下是f2py编译器检查的输出:
^{pr2}$下面是一些相关的系统变量:
IFORT=C:\Program Files (x86)\Intel\Composer XE 2013 SP1\
IFORT_COMPILER14=C:\Program Files (x86)\Intel\Composer XE 2013 SP1\
INTEL_DEV_REDIST=C:\Program Files (x86)\Common Files\Intel\Shared Libraries\
INTEL_LICENSE_FILE=C:\Program Files (x86)\Common Files\Intel\Licenses
Path=C:\Users\mshippen\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\WinSDK\Bin; C:\Program Files (x86)\Intel\Composer XE 2013 SP1\bin\; etc …
我试过的一些事情:
然而,我得到了同样的结果。我很困惑,尽管我设置了路径和环境变量,但是ifort.exe文件找不到。任何想法或指导将不胜感激!在
谢谢, 麦克
经过进一步的实验,我终于解决了这个问题,并发布了一些有效的步骤,以防它可以帮助其他人解决类似的问题。在
然而,在这之后,我收到了一个错误:“错误无法找到vcvarsall.bat公司". 这是上面提到的microsoftc++forpython2.7运行时配置设置的批处理文件。正如我从其他帖子中收集到的,这是Python2.7.11中的一个bug,我可以通过编辑msvc9来纠正它编译器.py主(不是numpy)distutils文件夹中的文件。具体地说,我在第267行硬编码了该文件的路径:
相关问题 更多 >
编程相关推荐