8000 Possible Bug in F2PY Fortran Compiler Detection (Trac #1170) · Issue #1768 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
Possible Bug in F2PY Fortran Compiler Detection (Trac #1170) #1768
Closed
@thouis

Description

@thouis

Original ticket http://projects.scipy.org/numpy/ticket/1170 on 2009-07-14 by trac user selevercin, assigned to @dmcooke.

I believe there is a bug in the way f2py detects fortran compilers, where the executable name never gets entered. (I've tried posting this to the mailing list, but my post wont show up.)

Everything discussed here was performed on: Linux cluster1 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:59:20 EDT 2006 x86_64 x86_64 x86_64 GNU/Linux

Trying to get f2py to recognize ifort, I started to output comments in some of the code to help trace down the mistake.

I started in "numpy/distutils/fcompiler/init.py", which appears to check for the existence of a compiler based on whether or not it can find a version number in "numpy/distutils/fcompiler/init.py".

I've included my output, but I'll also add short summary:

  1. f2py successfully locates all compatible compilers with the platform (init.py)
  2. f2py begins trying to get versions for each possible compiler (init.py)
  3. f2py INCORRECTLY creates a version command, to test if the compiler exists (ccompiler.py)

Where the version command sticks with the wrong executables ('/opt/pgi/linux86-64/6.2/bin/pgf77' and '/opt/pgi/linux86-64/6.2/bin/pgf90').

For example, to detect if ifort is installed, the following command is (wrongly) run:

/opt/pgi/linux86-64/6.2/bin/pgf77 -FI -V -c /tmp/tmplG4_3d/ESXFqO.f -o /tmp/tmplG4_3d/ESXFqO.o

This command is garbage, because i 7457 t is trying pgf77 rather than ifort. Running this command is silly but I'll go ahead and include it:

---------------------------------------
pgf77-Warning-Unknown switch: -FI

pgf77 6.2-5 64-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.
PGFTN/x86-64 Linux/x86-64 6.2-5
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.
----------------------------------------

Since ifort is in the path:

$ which ifort
/home/user10/intel/fce/9.1.041/bin/ifort

The following works well:

$ /home/user10/intel/fce/9.1.041/bin/ifort -FI -V -c /tmp/tmplG4_3d/ESXFqO.f -o /tmp/tmplG4_3d/ESXFqO.o

Intel(R) Fortran Compiler for Intel(R) EM64T-based applications, Version 9.1    Build 20070109 Package ID: l_fc_c_9.1.041
Copyright (C) 1985-2007 Intel Corporation.  All rights reserved.
FOR NON-COMMERCIAL USE ONLY

 Intel Fortran 9.1-6565

I tried a quick hack to get the ifort executable in the version command, but this didn't cause ifort to be successfully detected.

My Test Output:

$ python setup.py install --prefix=${HOME}/numpy_dir | grep "NDR"

Running from numpy source directory.
/home/nreveles/numpy-1.3.0/numpy/distutils/command/config.py:361: DeprecationWarning:
+++++++++++++++++++++++++++++++++++++++++++++++++
Usage of get_output is deprecated: please do not
use it anymore, and avoid configuration checks
involving running executable on the target machine.
+++++++++++++++++++++++++++++++++++++++++++++++++

  DeprecationWarning)

NDR: self= <numpy.distutils.fcompiler.gnu.GnuFCompiler instance at 0x2aaaaee5d950>
NDR: version_cmd = ['/opt/pgi/linux86-64/6.2/bin/pgf77', '--version']
NDR: compiler =  <numpy.distutils.fcompiler.gnu.GnuFCompiler instance at 0x2aaaaee5d950>
NDR: comp. version =  None

NDR: self= <numpy.distutils.fcompiler.intel.IntelFCompiler instance at 0x2aaaaee62200>
NDR: version_cmd = ['/opt/pgi/linux86-64/6.2/bin/pgf77', '-FI', '-V', '-c', '/tmp/tmplG4_3d/ESXFqO.f', '-o', '/tmp/tmplG4_3d/ESXFqO.o']
NDR: compiler =  <numpy.distutils.fcompiler.intel.IntelFCompiler instance at 0x2aaaaee62200>
NDR: comp. version =  None

NDR: compiler =  <numpy.distutils.fcompiler.lahey.LaheyFCompiler instance at 0x2aaaaee62680>
NDR: self= <numpy.distutils.fcompiler.lahey.LaheyFCompiler instance at 0x2aaaaee62680>
NDR: version_cmd = ['/opt/pgi/linux86-64/6.2/bin/pgf90', '--version']
NDR: comp. version =  None

NDR: compiler =  <numpy.distutils.fcompiler.pg.PGroupFCompiler instance at 0x2aaaaee633b0>
NDR: self= <numpy.distutils.fcompiler.pg.PGroupFCompiler instance at 0x2aaaaee633b0>
NDR: version_cmd = ['/opt/pgi/linux86-64/6.2/bin/pgf77', '-V 2>/dev/null']
NDR: comp. version =  6.2-5

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0