加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

python – 如何让setup.py测试使用特定的fortran编译器?

发布时间:2020-12-16 22:15:38 所属栏目:Python 来源:网络整理
导读:我正在尝试测试包含一些f90文件的package.如果我构建或安装并指定fortran编译器,它可以正常工作.但是,当我尝试测试时,我收到以下错误: C:Usersjsalvatierworkspacescikits.bvp_solverpython setup.py config_fc --fcompiler=gfortran testrunning confi

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

C:Usersjsalvatierworkspacescikits.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 'buildsrc.win32-2.6fortranobject.c' to sources.
  adding 'buildsrc.win32-2.6' to include_dirs.
  adding 'buildsrc.win32-2.6scikitsbvp_solverlibbvp_solverf-f2pywrappers2.f90' to sources.
building data_files sources
build_src: building npy-pkg config files
writing scikits.bvp_solver.egg-infoPKG-INFO
writing namespace_packages to scikits.bvp_solver.egg-infonamespace_packages.txt
writing top-level names to scikits.bvp_solver.egg-infotop_level.txt
writing dependency_links to scikits.bvp_solver.egg-infodependency_links.txt
reading manifest file 'scikits.bvp_solver.egg-infoSOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'scikits.bvp_solver.egg-infoSOURCES.txt'
running build_ext
customize Mingw32CCompiler
customize Mingw32CCompiler using build_ext
customize GnuFCompiler
Found executable C:mingwbing77.exe
gnu: no Fortran 90 compiler found
gnu: no Fortran 90 compiler found
Found executable C:mingwbing77.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: '-Ibuildsrc.win32-2.6 -IC:Python26libsite-packagesnumpycoreinclude -IC:Python26include -IC:Python26PC -c'
gcc -mno-cygwin -O2 -Wall -Wstrict-prototypes -Ibuildsrc.win32-2.6 -IC:Python26libsite-packagesnumpycoreinclude -IC:Python26include -IC:Python26PC -c buildsrc.win32-2.6scikitsbvp_solverlibbvp_solverfmodule.c -o buildtemp.win32-2.6Releasebuildsrc.win32-2.6scikitsbvp_solverlibbvp_solverfmodule.o
Found executable C:mingwbingcc.exe
gcc -mno-cygwin -O2 -Wall -Wstrict-prototypes -Ibuildsrc.win32-2.6 -IC:Python26libsite-packagesnumpycoreinclude -IC:Python26include -IC:Python26PC -c buildsrc.win32-2.6fortranobject.c -o buildtemp.win32-2.6Releasebuildsrc.win32-2.6fortranobject.o
compiling Fortran 90 module sources
XXX: module_build_dir='buildtemp.win32-2.6Releasescikitsbvp_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:mingwbing77.exe -g -Wall -fno-second-underscore -mno-cygwin -O3 -funroll-loops
compile options: '-Ibuildsrc.win32-2.6 -IC:Python26libsite-packagesnumpycoreinclude -IC:Python26include -IC:Python26PC -c'
error: f90 not supported by GnuFCompiler needed for scikitsbvp_solverlibBVP_M.f90

有办法解决这个问题吗?我在Windows 7,python 2.6,numpy 1.4.1.

最佳答案
该软件包的documentation建议如下构建:

python setup.py config --compiler=mingw32 build --compiler=mingw32 install

这应该与mfortw32版本的gfortran一起使用.我没有可访问的Windows机器,但是当我用gfortran构建其他Python模块(例如numpy)时,命令如下:

python setup.py build --fcompiler=gnu95

ETA:我误读了你问题的开头,现在我看到你可以构建但不能测试.你只用“–compiler = mingw32”试过这个吗?

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读