473,287 Members | 1,663 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,287 software developers and data experts.

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 1419

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

Similar topics

2
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
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
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
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
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
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
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
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
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
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.