如何获得setup.py测试以使用特定的Fortran编译器? [英] How do I get setup.py test to use a specific fortran compiler?

查看:215
本文介绍了如何获得setup.py测试以使用特定的Fortran编译器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在测试一个包含一些f90文件的软件包。如果我构建或安装并指定fortran编译器,它工作正常。但是,当我尝试测试时,出现以下错误:

  C:\Users\jsalvatier\workspace\ scikits.bvp_solver> python setup.py config_fc --fcompiler = gfortran test 
运行config_fc
unifing config_fc,config,build_clib,build_ext,编译命令--fcompiler选项
运行测试
运行egg_info
正在运行build_src
build_src
扩展扩展名scikits.bvp_solver.bvp_solverf源
f2py选项:[]
添加'build\src.win32-2.6 \ fortranobject.c来源。
将'build \src.win32-2.6'添加到include_dirs。
将build \src.win32-2.6\scikits\bvp_solver\lib\bvp_solverf-f2pywrappers2.f90添加到源文件中。
构建data_files源
build_src:构建npy-pkg配置文件
编写scikits.bvp_solver.egg-info\PKG-INFO
将namespace_packages写入scikits.bvp_solver.egg-info \\\
amespace_packages.txt
将顶级名称写入scikits.bvp_solver.egg-info\top_level.txt
将dependency_links写入scikits.bvp_solver.egg-info\dependency_links.txt
阅读清单文件'scikits.bvp_solver.egg-info \SOURCES.txt'
阅读清单模板'MANIFEST.in'
编写清单文件'scikits.bvp_solver.egg-info\SOURCES.txt'
正在运行build_ext
自定义Mingw32CCompiler
使用build_ext自定义Mingw32CCompiler
自定义GnuFCompiler
找到可执行文件C:\\\\\\\\\\\\\\\\\\\\\\\\\ :没有Fortran 90编译器找到
gnu:没有Fortran 90编译器找到
找到可执行文件C:\明确\\\\\\\\\\\\\\\
自定义GnuFCompiler
gnu:no Fortran 90编译器发现
gnu:不Fortran 90编译器发现
使用build_ext自定义GnuFCompiler $ b $建立'scikits.bvp_solver.bvp_solverf'扩展名
编译C源
C编译器:gcc -mno-cygwin -O2 -Wall -Wstrict -prototypes

编译选项:'-Ibuild \src.win32-2.6 -IC:\Python26\lib\site-packages\\\
umpy\core\include -IC:\\ \\ Python26 \ include -IC:\Python26\PC -c'
gcc -mno-cygwin -O2 -Wall -Wstrict-prototypes -Ibuild\src.win32-2.6 -IC:\Python26\\ \\ lib \\ \\ site-packages \ numpy \core \ include -IC:\Python26\include -IC:\Python26\PC -c build\src.win32-2.6\scikits\bvp_solver \lib\bvp_solverfmodule.c -o build\temp.win32-2.6\Release\build\src.win32-2.6\scikits\bvp_solver\lib\bvp_solverfmodule.o
找到可执行文件C:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' 2.6-IC:\Python26\lib\site-packages\\\
umpy\core\include -IC:\\Python26\include -IC:\\Python26\PC -c build\src.win32 -2.6\fortranobject.c -o build\temp.win32-2.6\Release\build\src.win32-2.6\fortranobject.o
编译Fortran 90模块源
XXX: module_build_dir ='build \\temp.win32-2.6\\Release\\scikits\\bvp_solver'选项忽略
XXX:修复module_dir_switch for GnuFCompiler
XXX:module_dirs = [ ]选项被忽略
XXX:为GnuFCompiler修复module_include_switch
Fortran f77编译器:C:\明智\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -funroll-loops
编译选项:'-Ibuild \src.win32-2.6 -IC:\Python26\lib\site-packages\\\
umpy\core\include -IC:\Python26 \include -IC:\Python26\PC -c'
错误:f90不支持GnuFCompiler所需的scikits \\bvp_solver\lib\BVP_M.f90



有没有办法解决呢?我在windows 7,python 2.6,numpy 1.4.1上。我认为问题在于'测试'命令需要建立在原地。

  python setup.py config --fcompiler = gfortran build_ext --inplace 

产生的错误与以前相同,但是

  python setup.py config --fcompiler = gfortran build_ext 

不是。



我能够解决这个问题


  1. 运行设置为交互式
    模式(python setup.py)


  2. 将fortran编译器设置为gfortran


  3. 选择inplace build(3)



I am trying to test a package that includes some f90 files. If I build or install and specify the fortran compiler, it works fine. However, when I try to test I get the following error:

C:\Users\jsalvatier\workspace\scikits.bvp_solver>python setup.py config_fc --fcompiler=gfortran test
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running test
running egg_info
running build_src
build_src
building extension "scikits.bvp_solver.bvp_solverf" sources
f2py options: []
  adding 'build\src.win32-2.6\fortranobject.c' to sources.
  adding 'build\src.win32-2.6' to include_dirs.
  adding 'build\src.win32-2.6\scikits\bvp_solver\lib\bvp_solverf-f2pywrappers2.f90' to sources.
building data_files sources
build_src: building npy-pkg config files
writing scikits.bvp_solver.egg-info\PKG-INFO
writing namespace_packages to scikits.bvp_solver.egg-info\namespace_packages.txt
writing top-level names to scikits.bvp_solver.egg-info\top_level.txt
writing dependency_links to scikits.bvp_solver.egg-info\dependency_links.txt
reading manifest file 'scikits.bvp_solver.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'scikits.bvp_solver.egg-info\SOURCES.txt'
running build_ext
customize Mingw32CCompiler
customize Mingw32CCompiler using build_ext
customize GnuFCompiler
Found executable C:\mingw\bin\g77.exe
gnu: no Fortran 90 compiler found
gnu: no Fortran 90 compiler found
Found executable C:\mingw\bin\g77.exe
customize GnuFCompiler
gnu: no Fortran 90 compiler found
gnu: no Fortran 90 compiler found
customize GnuFCompiler using build_ext
building 'scikits.bvp_solver.bvp_solverf' extension
compiling C sources
C compiler: gcc -mno-cygwin -O2 -Wall -Wstrict-prototypes

compile options: '-Ibuild\src.win32-2.6 -IC:\Python26\lib\site-packages\numpy\core\include -IC:\Python26\include -IC:\Python26\PC -c'
gcc -mno-cygwin -O2 -Wall -Wstrict-prototypes -Ibuild\src.win32-2.6 -IC:\Python26\lib\site-packages\numpy\core\include -IC:\Python26\include -IC:\Python26\PC -c build\src.win32-2.6\scikits\bvp_solver\lib\bvp_solverfmodule.c -o build\temp.win32-2.6\Release\build\src.win32-2.6\scikits\bvp_solver\lib\bvp_solverfmodule.o
Found executable C:\mingw\bin\gcc.exe
gcc -mno-cygwin -O2 -Wall -Wstrict-prototypes -Ibuild\src.win32-2.6 -IC:\Python26\lib\site-packages\numpy\core\include -IC:\Python26\include -IC:\Python26\PC -c build\src.win32-2.6\fortranobject.c -o build\temp.win32-2.6\Release\build\src.win32-2.6\fortranobject.o
compiling Fortran 90 module sources
XXX: module_build_dir='build\\temp.win32-2.6\\Release\\scikits\\bvp_solver' option ignored
XXX: Fix module_dir_switch for  GnuFCompiler
XXX: module_dirs=[] option ignored
XXX: Fix module_include_switch for  GnuFCompiler
Fortran f77 compiler: C:\mingw\bin\g77.exe -g -Wall -fno-second-underscore -mno-cygwin -O3 -funroll-loops
compile options: '-Ibuild\src.win32-2.6 -IC:\Python26\lib\site-packages\numpy\core\include -IC:\Python26\include -IC:\Python26\PC -c'
error: f90 not supported by GnuFCompiler needed for scikits\bvp_solver\lib\BVP_M.f90

Is there a way to work around this? I'm on windows 7, python 2.6, numpy 1.4.1.

解决方案

I think the issue is that the 'test' command requires building inplace.

python setup.py config --fcompiler=gfortran build_ext --inplace

was generating the same error as before, but

python setup.py config --fcompiler=gfortran build_ext

was not.

I was able to work around the problem by

  1. Running setup in interactive mode(python setup.py)

  2. Setting the fortran compiler to gfortran

  3. selecting inplace build (3)

这篇关于如何获得setup.py测试以使用特定的Fortran编译器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆