2016-06-12 6 views
0

Windows 7에서 인텔 포트란에서 F2PY를 사용하는 데 어려움을 겪고 있습니다. 일반적인 문제인 것처럼 보입니다. 아래에서 설명하는 다른 게시물에서 많은 제안을 시도했습니다.F2PY가 Windows 7에서 인텔 포트란 컴파일러를 찾을 수 없습니다.

내 시스템에 대한 정보의 비트 :

  • 윈도우 7 64 비트
  • Enthought 캐노피 32 비트를 통해
  • 파이썬 2.7.11 (2016 년 6 월 (12)의 같은 날짜까지)
  • 인텔 포트란 14 (인텔 \는 작곡가 XE 2013 SP1) 나는이 문제는 C++ 런타임 관련이있을 수 있다는 것을 발견 (32 비트 및 64 비트)

연구 see here의 조금을 수행 한 후 내가 설치 M icrosoft Visual C++ for Python. 여기에 몇 가지 있습니다

D:\python stuff\enthought_ course\demo\f2py_fcopy>ff2py -c --help-fcompiler 
Fortran compilers found: 
Compilers available for this platform, but not found: 
    --fcompiler=absoft Absoft Corp Fortran Compiler 
    --fcompiler=compaqv DIGITAL or Compaq Visual Fortran Compiler 
    --fcompiler=g95  G95 Fortran Compiler 
    --fcompiler=gnu  GNU Fortran 77 compiler 
    --fcompiler=gnu95  GNU Fortran 95 compiler 
    --fcompiler=intelem Intel Fortran Compiler for 64-bit apps 
    --fcompiler=intelev Intel Visual Fortran Compiler for Itanium apps 
    --fcompiler=intelv Intel Visual Fortran Compiler for 32-bit apps 
    --fcompiler=intelvem Intel Visual Fortran Compiler for 64-bit apps 
Compilers not available on this platform: 
    --fcompiler=compaq Compaq Fortran Compiler 
    --fcompiler=hpux  HP Fortran 90 Compiler 
    --fcompiler=ibm  IBM XL Fortran Compiler 
    --fcompiler=intel Intel Fortran Compiler for 32-bit apps 
    --fcompiler=intele Intel Fortran Compiler for Itanium apps 
    --fcompiler=lahey Lahey/Fujitsu Fortran 95 Compiler 
    --fcompiler=mips  MIPSpro Fortran Compiler 
    --fcompiler=nag  NAGWare Fortran 95 Compiler 
    --fcompiler=none  Fake Fortran compiler 
    --fcompiler=pathf95 PathScale Fortran Compiler 
    --fcompiler=pg  Portland Group Fortran Compiler 
    --fcompiler=sun  Sun or Forte Fortran 95 Compiler 
    --fcompiler=vast  Pacific-Sierra Research Fortran 90 Compiler 
For compiler details, run 'config_fc --verbose' setup command. 
Removing build directory c:\users\mshippen\appdata\local\temp\tmpiopwe2 

그리고 다음은

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 컴파일러 검사의 출력입니다 : 나는 간단한 테스트 케이스를 구축 할 때 여전히

, 나는 다음과 같은 오류가 발생합니다 관련된 시스템 변수 :

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 … 

내가 시도한 것들 :

0 here
  • 추가 [IFORT (intelv가 올바른되어야하더라도) 다양한 --fcompiler = intelv, intelvem, 인텔 intelem 옵션을 시도 here
  • 을 제안 ifortvars.bat는
    • 란 ] 시스템 변수를 [IFORT_COMPILER14] F2PY가 버전 특정 키를 우연히 찾은 경우
    • 이러한 경로를 다음으로 확장하려고했습니다. C : \ Program Files (Intel) \ Intel \ Composer XE 2013 SP1 \ 빈 \ ia32 (didnt 일, 그래서 되돌아 갔다 back)

    그러나 같은 결과가 나옵니다. 내 경로와 환경 변수 설정에도 불구하고 ifort.exe를 찾을 수 없다는 것이 당황 스럽다. 어떤 아이디어 나 지침도 많은 도움이 될 것입니다!

    덕분에, 맥

  • +0

    : 특히, 나는 라인에서 같은이 파일에 267을 경로를 하드 코딩 \ Composer XE 2013 SP1 \ bin \ ia32를 실행하고 재부팅하십시오. –

    +0

    부끄러워하지 마십시오. 응답으로 포함하고 응답하지 않은 질문으로 표시되지 않도록 (필요한 지연 후) 표시하십시오. –

    +0

    감사합니다 조나단 ... 내가 제출 한 첫 번째 stackoverflow 대답은 내 자신의 질문에 대한 것이라고 기대하지 않았다! :) –

    답변

    1

    몇 가지 더 실험 후, 나는이 문제를 해결할 수 있었다 그것은 비슷한 문제로 다른 사람을 도움이 될 경우 작업 단계를 게시하고있다.

    1. f2py 이제 C의 경로를 설정 한 후 인텔 포트란을 찾을 수 있습니다 : \ 프로그램 파일 인텔 \ 컴포저 XE 2013 SP1 \ 빈 \의 IA32 \ (86)이 후, 그러나
    2. 를 재부팅, 내가받은 오류 : "vcvarsall.bat를 찾을 수 없습니다"오류가 발생했습니다. 이것은 위에 언급 된 Microsoft C++ for Python 2.7 런타임에 대한 구성 설정이있는 배치 파일입니다. 필자가 다른 게시물에서 모았 듯이이 파일은 Python 2.7.11의 버그로 distutils 폴더가 아닌 주 (numpy가 아닌) msvc9compiler.py 파일을 편집하여 수정할 수있었습니다.\ Program 파일 (x 86) \ 인텔 : 몇 가지 더 실험 후, f2py 이제 C의 경로를 설정 한 후 인텔 포트란을 찾을 수 있습니다

      def query_vcvarsall(version, arch="x86"): 
      """Launch vcvarsall.bat and read the settings from its environment """ 
          vcvarsall = find_vcvarsall(version) 
          vcvarsall = "C:/Users/mshippen/AppData/Local/Programs/Common/Microsoft/Visual C++ for Python/9.0/vcvarsall.bat" 
          interesting = set(("include", "lib", "libpath", "path")) 
          result = {} 
      
    +1

    추가 할 또 한가지, 나는 또한 다음과 같은 오류가 발생했습니다 : 치명적인 오류 LNK1104 : LIBPATH 변수에있는 파일의 위치를 ​​정의 했음에도 불구하고 'ifconsol.lib'파일을 열 수 없습니다. 그래서이 경로를 f2py 명령 줄에 만들어야했습니다. 예를 들면 : f2py -m fcopy fcopy.f -c -L "C : \ Program Files (x86) \ Intel \ Composer XE 2013 SP1 \ compiler \ lib \ ia32" –

    관련 문제