473,480 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Re: NEW GENERATED DLL ERROR FOUND WITHIN f2PY.py

En Sun, 21 Sep 2008 19:42:10 -0300, Blubaugh, David A.
<db*******@belcan.comescribió:
Sir,
Thank you for your reply. This is as to how I developed my .pyd file.
I entered the following commands within my MS-DOS prompt within Windows
XP:

C:\python25\ScriptsC:\python25\python f2py.py -c --fcompiler=gnu95
--compiler=mingw32 -m hello hello.f90

I am using the gfortran compiler, that was prescribed to use, as well
as, the required commands on the following website:

http://www.scipy.org/F2PY_Window
<https://webmail.belcan.com/exchweb/bin/redir.asp?URL=http://www.scipy.org/F2PY_Window>

I comes down to that yes, I am able to generate a .pyd file, which was
generated by f2py. However, when I tried to import this file into my
python script program I was given the following error:
error 193??
I do not know as to what I am doing incorrectly, since I am generating a
.pyd file by f2py? If I am doing anything that is incorrect, then why
am I EVEN ABLE TO GENERATE A .PYD FILE IN THE FIRST PLACE??? Any Help
will be greatly appreciated!!!!!
Below there is a transcript of a compile session. I've used a somewhat old
version of mingw and g77, scipy 1.1.1, python 2.5.2:

C:\TEMP\for>dir /b
dscal.for

C:\TEMP\for>type dscal.for
SUBROUTINE DSCAL(N, ALPHA, X)
*
* X <- ALPHA * X
*
INTEGER N
DOUBLE PRECISION ALPHA
DOUBLE PRECISION X(*)

DO I = 1, N
X(I) = ALPHA * X(I)
END DO
WRITE (*,*) ALPHA
RETURN
END
C:\TEMP\for>g77 --version
GNU Fortran (GCC) 3.4.2 (mingw-special)
Copyright (C) 2004 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING
or type the command `info -f g77 Copying'.

C:\TEMP\for>python -V
Python 2.5.2

C:\TEMP\for>python c:\apps\python25\scripts\f2py.py -v
2_5590

C:\TEMP\for>python c:\apps\python25\scripts\f2py.py -c -m dscal dscal.for
[...lots of output...]
Found executable c:\apps\mingw\bin\g77.exe
gnu: no Fortran 90 compiler found
customize Mingw32CCompiler using scons
Found executable c:\apps\mingw\bin\g++.exe
[...]
gcc -mno-cygwin -O2 -Wall -Wstrict-prototypes
-Ic:\docume~1\gabriel\config~1\tem
p\tmpoygjnk\src.win32-2.5
-IC:\Apps\Python25\lib\site-packages\numpy\core\includ
e -IC:\Apps\Python25\include -IC:\Apps\Python25\PC -c
c:\docume~1\gabriel\config
~1\temp\tmpoygjnk\src.win32-2.5\dscalmodule.c -o
c:\docume~1\gabriel\config~1\te
mp\tmpoygjnk\Release\docume~1\gabriel\config~1\tem p\tmpoygjnk\src.win32-2.5\dsca
lmodule.o
gcc -mno-cygwin -O2 -Wall -Wstrict-prototypes
-Ic:\docume~1\gabriel\config~1\tem
p\tmpoygjnk\src.win32-2.5
-IC:\Apps\Python25\lib\site-packages\numpy\core\includ
e -IC:\Apps\Python25\include -IC:\Apps\Python25\PC -c
c:\docume~1\gabriel\config
~1\temp\tmpoygjnk\src.win32-2.5\fortranobject.c -o
c:\docume~1\gabriel\config~1\
temp\tmpoygjnk\Release\docume~1\gabriel\config~1\t emp\tmpoygjnk\src.win32-2.5\fo
rtranobject.o
[...]
c:\apps\mingw\bin\g77.exe -g -Wall -mno-cygwin -g -Wall -mno-cygwin
-shared c:\d
ocume~1\gabriel\config~1\temp\tmpoygjnk\Release\do cume~1\gabriel\config~1\temp\t
mpoygjnk\src.win32-2.5\dscalmodule.o
c:\docume~1\gabriel\config~1\temp\tmpoygjnk
\Release\docume~1\gabriel\config~1\temp\tmpoygjnk\ src.win32-2.5\fortranobject.o
c:\docume~1\gabriel\config~1\temp\tmpoygjnk\Releas e\dscal.o
-Lc:\apps\mingw\lib
-Lc:\apps\mingw\lib\gcc\mingw32\3.4.2 -LC:\Apps\Python25\libs
-LC:\Apps\Python25
\PCBuild -lpython25 -lg2c -o .\dscal.pyd
[...]

C:\TEMP\for>dir /b
dscal.for
dscal.pyd

C:\TEMP\for>python
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit
(Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
pyimport numpy
pyimport dscal
pyprint dscal.dscal.__doc__
dscal - Function signature:
dscal(n,alpha,x)
Required arguments:
n : input int
alpha : input float
x : input rank-1 array('d') with bounds (*)

pyv = numpy.array([1,2,3,4,5], 'd')
pyprint v
[ 1. 2. 3. 4. 5.]
pydscal.dscal(len(v), 2, v)
2.
pyprint v
[ 2. 4. 6. 8. 10.]

--
Gabriel Genellina

Sep 22 '08 #1
0 1426

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

Similar topics

2
5290
by: Markus Faust | last post by:
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,...
6
2204
by: M. Faust | last post by:
Hi, after having installed F2PY-2.43.239_1806 I get the following error when trying to run the hello.f example from the /docs directory: f2py.py --fcompiler=compaqv -c -m hello hello.f...
6
2749
by: Sile | last post by:
Hello, I'm trying to get f2py working from the command line on windows XP. I have mingw32 as my C complier (after some advice on a previous thread) and Compaq Visual Fortran 6.5. Changing my C...
1
2441
by: Martin Z | last post by:
I'm getting acquainted with the whole XML/XSD thing, and I've run into a wall. I have a tree of objects that I deserialize from XML for configuration reasons. I have generated XSD from the...
5
2014
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...
0
882
by: Fredrik Lundh | last post by:
Blubaugh, David A. wrote: (no need to shout when filling in the subject line, thanks) Error code 193 is ERROR_BAD_EXE_FORMAT, which means that the thing you're trying to import is not a...
0
1486
by: Blubaugh, David A. | last post by:
Sir, Thank you for your reply. This is as to how I developed my .pyd file. I entered the following commands within my MS-DOS prompt within Windows XP: C:\python25\ScriptsC:\python25\python ...
0
1337
by: John [H2O] | last post by:
Hello, I have a module created from a Fortran file to read in unformatted binary fortran output. It works fine for some datasets, but crashes with others. The strange thing is it will loop...
0
1796
by: John [H2O] | last post by:
There's a lot of greek for me here ... should I post to numpy-discussions as well??? The backtrace is at the bottom.... Thanks! GNU gdb Fedora (6.8-21.fc9) Copyright (C) 2008 Free...
0
7033
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6903
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7071
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6726
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5318
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4763
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
2987
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
557
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
170
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.