F2py and Compaq Visual Fortran 6.6, Win-XP 
Author Message
 F2py and Compaq Visual Fortran 6.6, Win-XP

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



Fri, 21 Apr 2006 04:57:07 GMT  
 F2py and Compaq Visual Fortran 6.6, Win-XP


 >> 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__
 >>     from distutils.msvccompiler import find_exe
 >> ImportError: cannot import name find_exe

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



Fri, 21 Apr 2006 07:05:32 GMT  
 F2py and Compaq Visual Fortran 6.6, Win-XP


<snip>

 >> This looks much better now, but I do not succeed in invoking the Visual
 >> Fortran Compiler. f2py always calls the mingw compiler. Do you have an
 >> idea? Thanks in advance Markus!

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



Fri, 21 Apr 2006 18:16:25 GMT  
 F2py and Compaq Visual Fortran 6.6, Win-XP

First get the lattest versions of f2py and scipy-distutils from CVS
(build, instal...) if you need help doing it just ask and I can guive
you more detailed instructions.

Then go to wherever you have Python installed to the directory scripts
delete f2py.bat and replace it by a Python script like this:

import f2py2e
f2py2e.main()

Name it f2py.py or whateever you prefer now it should work.

Be warned that f2py is buggy if you use complex numbers, lists and a few
other types you may face problems.

Best regards
Jos Rui

--
========================================================================
"We write to show what life looks like through our own little broken
piece of beer bottle." Robert Traver
========================================================================

Contact information: http://homepage.esoterica.pt/~jrfsousa/contact.html
========================================================================



Fri, 21 Apr 2006 06:50:44 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Announcing Compaq Visual Fortran 6.6

2. Difference between PGF90 and Compaq Visual Fortran 6.6

3. Compaq Visual Fortran 6.6 to read UNIX unformatted file

4. Compaq Visual Fortran 6.6 installation problem

5. Calling Matlab in Compaq visual fortran at Windows XP

6. Digital/Compaq/HP Visual Fortran on Windows 2000/XP

7. Calling C from Fortran link problems (Compaq Visual Fortran 6.6 & MS Visual Studio 8)...

8. Creating - Fortran 77 dll for use in Visual Basic 6.0 (not using Compaq Visual Fortran)

9. Building DLLs with Compaq Visual Fortran and Intel Visual Fortran

10. Solution: Installing Visual Fortran with Vis Basic 6.0 under Win XP

11. Mixing Compaq Visual Fortran 6 with Microsoft Visual C++ .NET

12. Question on using Compaq Visual FORTRAN with Microsoft Visual C++ 6.0

 

 
Powered by phpBB® Forum Software