Jarrod Wilcox
2011-11-09 14:21:49 UTC
Pearu et al
Thank you for response to previous post. My query now has more detail.
I am running on Intel Core 2 64 bit Windows 7. I reinstalled Python and
numpy using the Enthought free distribution, with Python 2.7.2 (32 bit) July
3, 2011.
To get C and Fortran compilers, I also installed MinGW using the prepackaged
executable version 0.3-alpha-2.1. It includes MSYS, although I did not use
it in what follows.
As a newbie, I am most comfortable running from IDLE rather than a terminal
window. An IDLE script follows:
----------------------------------------------------------------------------
-------------
import numpy
from numpy import f2py
import sys
print("sys.path:")
print(sys.path)
def main():
print("Entering main()")
if '-c' in sys.argv[1:]:
f2py.f2py2e.run_compile()
else:
f2py.f2py2e.run_main(sys.argv[1:])
print("RESULT OF: f2py -m fib1 -h fib1.pyf C:/pydev/data/fib1.f --build-dir
C:/pydev/data/temp/")
fcommand="f2py -m fib1 -h fib1.pyf C:/pydev/data/fib1.f --build-dir
C:/pydev/data/temp/"
sys.argv=fcommand.split()
answer1=main()
print(answer1)
print(' ')
print("RESULT OF: f2py -c --help-fcompiler")
fcommand="f2py -c --help-fcompiler"
sys.argv=fcommand.split()
answer2=main()
print(answer2)
print(' ')
print("RESULT OF: f2py -c c:/pydev/data/temp/fib1.pyf c:/pydev/data/fib1.f")
fcommand="f2py -c c:/pydev/data/temp/fib1.pyf c:/pydev/data/fib1.f"
sys.argv=fcommand.split()
answer3=main()
print(answer3)
----------------------------------------------------------------------------
--------------------------
THE OUTPUT OF RUNNING THE SCRIPT FOLLOWS, WITH ANNOTATIONS IN CAPS:
----------------------------------------------------------------------------
------------------------------
Python 2.7.2 |EPD_free 7.1-2 (32-bit)| (default, Jul 3 2011, 15:13:59) [MSC
v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
sys.path:
['C:\\pydev\\data', 'C:\\Python27\\Lib\\idlelib',
'C:\\Python27\\python27.zip', 'C:\\Python27\\DLLs', 'C:\\Python27\\lib',
'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27',
'C:\\Python27\\lib\\site-packages', 'C:\\Python27\\lib\\site-packages\\PIL',
'c:\\MinGW\\bin', 'c:\\pydev\\data',
'C:\\Python27\\lib\\site-packages\\win32',
'C:\\Python27\\lib\\site-packages\\win32\\lib',
'C:\\Python27\\lib\\site-packages\\Pythonwin']
-------------------------------------------------------------------------
NOTE: SYS.PATH INCLUDES LOCATION OF MINGW AND GFORTRAN AND GCC COMPILERS
--------------------------------------------------------------------------
RESULT OF: f2py -m fib1 -h fib1.pyf C:/pydev/data/fib1.f --build-dir
C:/pydev/data/temp/
Entering main()
Reading fortran codes...
Reading file 'C:/pydev/data/fib1.f' (format:fix,strict)
Post-processing...
Block: fib1
Block: fib
Post-processing (stage 2)...
Saving signatures to file "C:/pydev/data/temp/fib1.pyf"
None
----------------------------------------------------------------------------
---------------
NOTE: F2PY SEEMED TO WORK WELL IN PREPARING A WRAPPER FOR A SIMPLE FORTRAN
SUBROUTINE ON FIBONNACI SERIES
HOWEVER, NO FORTRAN COMPILER IS FOUND:
----------------------------------------------------------------------------
--------------------
RESULT OF: f2py -c --help-fcompiler
Entering main()
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.
None
----------------------------------------------------------------------------
----------
NOTE: GCC MAY ALSO NOT BE FOUND. AND THERE MAY BE ADDITIONAL PROBLEMS.
----------------------------------------------------------------------------
----------
RESULT OF: f2py -c c:/pydev/data/temp/fib1.pyf c:/pydev/data/fib1.f
Entering main()
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler
options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler
options
running build_src
build_src
building extension "fib1" sources
creating c:c:
Traceback (most recent call last):
File "C:\pydev\data\fib1test.py", line 37, in <module>
answer3=main()
File "C:\pydev\data\fib1test.py", line 16, in main
f2py.f2py2e.run_compile()
File "C:\Python27\lib\site-packages\numpy\f2py\f2py2e.py", line 574, in
run_compile
setup(ext_modules = [ext])
File "C:\Python27\lib\site-packages\numpy\distutils\core.py", line 186, in
setup
return old_setup(**new_attr)
File "C:\Python27\lib\distutils\core.py", line 169, in setup
raise SystemExit, "error: " + str(msg)
SystemExit: error: could not create 'c:c:': The filename, directory name, or
volume label syntax is incorrect
----------------------------------------------------------------------------
--------------------------------
NOTE: I MUST BE MISSING SOMETHING OBVIOUS. IF YOU OR ANYONE ELSE HAS
ADVICE, PLEASE ASSUME I HAVE ONLY VERY SLIGHT FAMILIARITY WITH C AND UNIX.
----------------------------------------------------------------------------
-------------------------------------
Thanks,
Jarrod
Thank you for response to previous post. My query now has more detail.
I am running on Intel Core 2 64 bit Windows 7. I reinstalled Python and
numpy using the Enthought free distribution, with Python 2.7.2 (32 bit) July
3, 2011.
To get C and Fortran compilers, I also installed MinGW using the prepackaged
executable version 0.3-alpha-2.1. It includes MSYS, although I did not use
it in what follows.
As a newbie, I am most comfortable running from IDLE rather than a terminal
window. An IDLE script follows:
----------------------------------------------------------------------------
-------------
import numpy
from numpy import f2py
import sys
print("sys.path:")
print(sys.path)
def main():
print("Entering main()")
if '-c' in sys.argv[1:]:
f2py.f2py2e.run_compile()
else:
f2py.f2py2e.run_main(sys.argv[1:])
print("RESULT OF: f2py -m fib1 -h fib1.pyf C:/pydev/data/fib1.f --build-dir
C:/pydev/data/temp/")
fcommand="f2py -m fib1 -h fib1.pyf C:/pydev/data/fib1.f --build-dir
C:/pydev/data/temp/"
sys.argv=fcommand.split()
answer1=main()
print(answer1)
print(' ')
print("RESULT OF: f2py -c --help-fcompiler")
fcommand="f2py -c --help-fcompiler"
sys.argv=fcommand.split()
answer2=main()
print(answer2)
print(' ')
print("RESULT OF: f2py -c c:/pydev/data/temp/fib1.pyf c:/pydev/data/fib1.f")
fcommand="f2py -c c:/pydev/data/temp/fib1.pyf c:/pydev/data/fib1.f"
sys.argv=fcommand.split()
answer3=main()
print(answer3)
----------------------------------------------------------------------------
--------------------------
THE OUTPUT OF RUNNING THE SCRIPT FOLLOWS, WITH ANNOTATIONS IN CAPS:
----------------------------------------------------------------------------
------------------------------
Python 2.7.2 |EPD_free 7.1-2 (32-bit)| (default, Jul 3 2011, 15:13:59) [MSC
v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
================================ RESTART
================================sys.path:
['C:\\pydev\\data', 'C:\\Python27\\Lib\\idlelib',
'C:\\Python27\\python27.zip', 'C:\\Python27\\DLLs', 'C:\\Python27\\lib',
'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27',
'C:\\Python27\\lib\\site-packages', 'C:\\Python27\\lib\\site-packages\\PIL',
'c:\\MinGW\\bin', 'c:\\pydev\\data',
'C:\\Python27\\lib\\site-packages\\win32',
'C:\\Python27\\lib\\site-packages\\win32\\lib',
'C:\\Python27\\lib\\site-packages\\Pythonwin']
-------------------------------------------------------------------------
NOTE: SYS.PATH INCLUDES LOCATION OF MINGW AND GFORTRAN AND GCC COMPILERS
--------------------------------------------------------------------------
RESULT OF: f2py -m fib1 -h fib1.pyf C:/pydev/data/fib1.f --build-dir
C:/pydev/data/temp/
Entering main()
Reading fortran codes...
Reading file 'C:/pydev/data/fib1.f' (format:fix,strict)
Post-processing...
Block: fib1
Block: fib
Post-processing (stage 2)...
Saving signatures to file "C:/pydev/data/temp/fib1.pyf"
None
----------------------------------------------------------------------------
---------------
NOTE: F2PY SEEMED TO WORK WELL IN PREPARING A WRAPPER FOR A SIMPLE FORTRAN
SUBROUTINE ON FIBONNACI SERIES
HOWEVER, NO FORTRAN COMPILER IS FOUND:
----------------------------------------------------------------------------
--------------------
RESULT OF: f2py -c --help-fcompiler
Entering main()
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.
None
----------------------------------------------------------------------------
----------
NOTE: GCC MAY ALSO NOT BE FOUND. AND THERE MAY BE ADDITIONAL PROBLEMS.
----------------------------------------------------------------------------
----------
RESULT OF: f2py -c c:/pydev/data/temp/fib1.pyf c:/pydev/data/fib1.f
Entering main()
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler
options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler
options
running build_src
build_src
building extension "fib1" sources
creating c:c:
Traceback (most recent call last):
File "C:\pydev\data\fib1test.py", line 37, in <module>
answer3=main()
File "C:\pydev\data\fib1test.py", line 16, in main
f2py.f2py2e.run_compile()
File "C:\Python27\lib\site-packages\numpy\f2py\f2py2e.py", line 574, in
run_compile
setup(ext_modules = [ext])
File "C:\Python27\lib\site-packages\numpy\distutils\core.py", line 186, in
setup
return old_setup(**new_attr)
File "C:\Python27\lib\distutils\core.py", line 169, in setup
raise SystemExit, "error: " + str(msg)
SystemExit: error: could not create 'c:c:': The filename, directory name, or
volume label syntax is incorrect
----------------------------------------------------------------------------
--------------------------------
NOTE: I MUST BE MISSING SOMETHING OBVIOUS. IF YOU OR ANYONE ELSE HAS
ADVICE, PLEASE ASSUME I HAVE ONLY VERY SLIGHT FAMILIARITY WITH C AND UNIX.
----------------------------------------------------------------------------
-------------------------------------
Thanks,
Jarrod