F2py and Compaq Visual Fortran 6.6, Win-XP

M

Markus Faust

Hi,

I'm trying to link Fortran files generated with “Compaq Visual Fortran
Optimizing Compiler Version 6.6 (Update B)” under “Enthought Edition
build 1028, Python 2.3 (#46, Aug 11 2003, 09:34:05) [MSC v.1200 32 bit
(Intel)] on win32” on Windows-XP”.

I changed mingw32_support.py as proposed by Pearu Peterson on April 8
2003 (I changed `if 1:` block into `if 0:` block).

When trying the following Python session:


import sys
from scipy_distutils.command.build_flib import
compaq_visual_fortran_compiler
class wrap(compaq_visual_fortran_compiler):
def announce(self, s):
sys.stdout.write(s+'\n')


wrap().get_version()

I get

detecting Compaq Fortran compiler...
DF /what
found Compaq Visual Fortran Optimizing Compiler Version 6.6 (Update B)
Traceback (most recent call last):
File "E:\Programme\F2PY-2.37.233-1545\docs\test_visualfortran.py",
line 8, in ?
wrap().get_version()
File
"E:\Python23\lib\site-packages\scipy_distutils\command\build_flib.py",
line 1443, in __init__
from distutils.msvccompiler import find_exe
ImportError: cannot import name find_exe

and

f2py -c –help-compiler results in

Not found/available: PG Fortran compiler
Not found/available: Absoft Fortran compiler
Not found/available: Intel Fortran compiler
Not found/available: Itanium Fortran compiler
Not found/available: NAG Fortran compiler
Traceback (most recent call last):
File "<string>", line 1, in ?
File "E:\Python23\lib\site-packages\f2py2e\f2py2e.py", line 522, in main
run_compile()
File "E:\Python23\lib\site-packages\f2py2e\f2py2e.py", line 514, in
run_compile
setup(ext_modules = [ext])
File "E:\Python23\lib\site-packages\scipy_distutils\core.py", line
42, in setup
return old_setup(**new_attr)
File ".\distutils\core.py", line 135, in setup
File ".\distutils\dist.py", line 422, in parse_command_line
File ".\distutils\dist.py", line 525, in _parse_command_opts
File
"E:\Python23\lib\site-packages\scipy_distutils\command\build_flib.py",
line 103, in show_compilers
compiler = compiler_class()
File
"E:\Python23\lib\site-packages\scipy_distutils\command\build_flib.py",
line 1443, in __init__
from distutils.msvccompiler import find_exe
ImportError: cannot import name find_exe

and

f2py -c --fcompiler-exec=D:\Program Files\Microsoft Visual
Studio\DF98\BIN\F77.EXE -DNO_APPEND
_FORTRAN -DUPPERCASE_FORTRAN -m hello hello.f
running build
running run_f2py
creating d:\dokume~1\faust\lokale~1\temp\tmptfnr7c
Reading fortran codes...
Reading file 'hello.f'
Post-processing...
Block: hello
Block: foo
Saving signatures to file
"d:\dokume~1\faust\lokale~1\temp\tmptfnr7c\hello.pyf"
Reading fortran codes...
Reading file
'd:\\dokume~1\\faust\\lokale~1\\temp\\tmptfnr7c\\hello.pyf'
Post-processing...
Block: hello
Block: foo
Building modules...
Building module "hello"...
Constructing wrapper function "foo"...
foo(a)
Wrote C/API module "hello" to file
"d:\dokume~1\faust\lokale~1\temp\tmptfnr7c/hellomodule.c"
running build_flib
Traceback (most recent call last):
File "<string>", line 1, in ?
File "E:\Python23\lib\site-packages\f2py2e\f2py2e.py", line 522, in main
run_compile()
File "E:\Python23\lib\site-packages\f2py2e\f2py2e.py", line 514, in
run_compile
setup(ext_modules = [ext])
File "E:\Python23\lib\site-packages\scipy_distutils\core.py", line
42, in setup
return old_setup(**new_attr)
File ".\distutils\core.py", line 149, in setup
File ".\distutils\dist.py", line 907, in run_commands
File ".\distutils\dist.py", line 927, in run_command
File ".\distutils\command\build.py", line 107, in run
File "E:\Python23\lib\cmd.py", line 333, in run_command

File ".\distutils\dist.py", line 926, in run_command
File "E:\Python23\lib\cmd.py", line 117, in ensure_finalized
line = self.cmdqueue.pop(0)
File
"E:\Python23\lib\site-packages\scipy_distutils\command\build_flib.py",
line 170, in finalize_options
verbose = self.verbose)
File
"E:\Python23\lib\site-packages\scipy_distutils\command\build_flib.py",
line 1561, in find_fortran_compiler
compiler = compiler_class(fc,f90c,verbose = verbose)
File
"E:\Python23\lib\site-packages\scipy_distutils\command\build_flib.py",
line 1443, in __init__
from distutils.msvccompiler import find_exe
ImportError: cannot import name find_exe

Has anybody an idea what could be wrong? Finally I would like to link
f90 files to Python.

Markus
 
M

Markus Faust

Pearu Peterson ([email protected]) replied by email:

>> Hi Pearu,
>>
>> I'm trying to link Fortran files generated with “Compaq Visual Fortran
>> Optimizing Compiler Version 6.6 (Update B)” under “Enthought Edition
>> build 1028, Python 2.3 (#46, Aug 11 2003, 09:34:05) [MSC v.1200 32 bit
>> (Intel)] on win32” on Windows-XP”.
>>
>>
>> I changed mingw32_support.py as proposed by you on April 8 2003 (I
>> changed `if 1:` block into `if 0:` block).
>>
>>
>> When trying the following Python session:
>>
>> import sys
>> from scipy_distutils.command.build_flib import compaq_visual_fortran_compiler
>> class wrap(compaq_visual_fortran_compiler):
>> def announce(self, s):
>> sys.stdout.write(s+'\n')
>>
>>
>> wrap().get_version()
>>
>> I get
>>
>>
>> detecting Compaq Fortran compiler...
>> DF /what
>> found Compaq Visual Fortran Optimizing Compiler Version 6.6 (Update B)
>> Traceback (most recent call last):
>> File "E:\Programme\F2PY-2.37.233-1545\docs\test_visualfortran.py", line 8, in ?
>> wrap().get_version()
>> File
"E:\Python23\lib\site-packages\scipy_distutils\command\build_flib.py",
line 1443, in __init__

Hooks related to find_exe were changed in Python 2.3 distutils and this
causes the import error above in your scipy_distutils that assumes Python
2.2 or earlier. CVS version of scipy_distutils works now also with Python
2.3. So, you should update scipy_distutils from scipy CVS when you are
planning to use Python 2.3.

Regards,
Pearu
 
M

Markus Faust

Pearu Peterson ([email protected]) replied by email:

On Mon, 3 Nov 2003 M wrote:



This is because f2py finds mingw compiler first. You can force f2py
to use other compilers either by defining

FC_VENDOR=Compaq

environment variable or using

--fcompiler=Compaq

switch. Note that the latter does not work with f2py.bat script on windows
and as a workaround write a f2py.py script containing two lines

import f2py2e
f2py2e.main()

In fact, I am dropping f2py.bat support for future f2py releases
(because I don't how to prevent .bat script to replace `=` with ` `). So,
you can remove f2py.bat altogether from your system.

Regards,
Pearu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,150
Members
46,697
Latest member
AugustNabo

Latest Threads

Top