473,382 Members | 1,420 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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.p yf"
Reading fortran codes...
Reading file
'd:\\dokume~1\\faust\\lokale~1\\temp\\tmptfnr7c\\h ello.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

Jul 18 '05 #1
2 5284
Pearu Peterson (pe***@cens.ioc.ee) replied by email:

On Sun, 2 Nov 2003 M wrote:

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


Jul 18 '05 #2
Pearu Peterson (pe***@cens.ioc.ee) replied by email:

On Mon, 3 Nov 2003 M wrote:

<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

Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Carl | last post by:
I have been experimenting with f2py and some fortran code that I want to port to Python. I have the following fortran file (TEST_00.f): C FILE: TEST_00.f SUBROUTINE FOO(WORK) IMPLICIT REAL*8...
5
by: Flavio | last post by:
Hi, has anyone tried to build extensions for win32 on Linux using xmingw? I need to use f2py to compile code for the win32 platform and I want to do this in Linux. I googled aroung but could...
1
by: Andrea Gavana | last post by:
Hello NG, I am using the latest Numpy release 1.0rc2 which includes F2PY. I have switched to Python 2.5 so this is the only alternative I have (IIUC). With Python 2.4, I was able to build a very...
5
by: Tyler | last post by:
Hello All: Since my last post I have attempted to use the f2py program which comes with numpy. I am able to create a <module_name>.so file fine; however, when I import it into Python, I receive...
1
by: Blubaugh, David A. | last post by:
Pauli, Yes, I am utilizing the windows environment. I cannot install f2py. I obtain the following error when I try to execute the setup.py file within the f2py folder located within the...
3
by: john | last post by:
I have a simple module which performs basic operations on plot3d files (below). I wrapped like: f2py --fcompiler=gfortran -m plot3d -c prec.f90 plot3d.f90 That seems to work fine, but i get...
0
by: Blubaugh, David A. | last post by:
Sir, Let me state that do have extensive experience with developing binary files. Please note that I have followed all of the instructions to the letter as far as developing a DLL to be...
0
by: John [H2O] | last post by:
I can try, would you mind giving very brief instructions on how to 'run it under gdb'... thanks! I'll post results over at numpy-discussions. Robert Kern-2 wrote: -- View this message in...
1
by: bkamrani | last post by:
Hi Python gurus, I have installed numpy and interested in testing f2py module using the first example in the documentation. First I tried: C:\test>python "C:\Program...
0
by: Gabriel Genellina | last post by:
En Wed, 19 Nov 2008 20:06:37 -0200, Yann Vonder <yann.vonderscher@gmail.comescribió: If you put tmod in both libraries, you'll have two copies of it, and two copies of the data. Can't you join...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.