Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Possible Bug in F2PY Fortran Compiler Detection (Trac #1170) #1768

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
thouis opened this issue Oct 19, 2012 · 4 comments
Closed

Possible Bug in F2PY Fortran Compiler Detection (Trac #1170) #1768

thouis opened this issue Oct 19, 2012 · 4 comments

Comments

@thouis
Copy link
Contributor

thouis commented Oct 19, 2012

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 it 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
@thouis
Copy link
Contributor Author

thouis commented Oct 19, 2012

Milestone changed to Unscheduled by @cournape on 2009-11-25

@thouis
Copy link
Contributor Author

thouis commented Oct 19, 2012

@rgommers wrote on 2010-12-12

What command did you run to start the build? It seems you do have the pgf77 compiler installed, so distutils correctly finds a working compiler. I suspect you did not specify which compiler you want, like so:

$ python setup.py build --fcompiler=intelem

@thouis
Copy link
Contributor Author

thouis commented Oct 19, 2012

@rgommers wrote on 2011-03-25

The Intel Fortran version detection was also updated in ce9fea2c20. So this should be fixed. Please reopen and answer my question above if this is still an issue for you.

@thouis
Copy link
Contributor Author

thouis commented Oct 19, 2012

Milestone changed to 1.6.0 by @mwiebe on 2011-05-31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant