Re: NEW GENERATED DLL ERROR FOUND WITHIN f2PY.py

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gabriel Genellina

    Re: NEW GENERATED DLL ERROR FOUND WITHIN f2PY.py

    En Sun, 21 Sep 2008 19:42:10 -0300, Blubaugh, David A.
    <dblubaugh@belc an.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\Scr iptsC:\python25 \python f2py.py -c --fcompiler=gnu95
    --compiler=mingw3 2 -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:
    >

    <https://webmail.belcan. com/exchweb/bin/redir.asp?URL=h ttp://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>typ e 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>pyt hon -V
    Python 2.5.2

    C:\TEMP\for>pyt hon c:\apps\python2 5\scripts\f2py. py -v
    2_5590

    C:\TEMP\for>pyt hon c:\apps\python2 5\scripts\f2py. py -c -m dscal dscal.for
    [...lots of output...]
    Found executable c:\apps\mingw\b in\g77.exe
    gnu: no Fortran 90 compiler found
    customize Mingw32CCompile r using scons
    Found executable c:\apps\mingw\b in\g++.exe
    [...]
    gcc -mno-cygwin -O2 -Wall -Wstrict-prototypes
    -Ic:\docume~1\ga briel\config~1\ tem
    p\tmpoygjnk\src .win32-2.5
    -IC:\Apps\Python 25\lib\site-packages\numpy\ core\includ
    e -IC:\Apps\Python 25\include -IC:\Apps\Python 25\PC -c
    c:\docume~1\gab riel\config
    ~1\temp\tmpoygj nk\src.win32-2.5\dscalmodule .c -o
    c:\docume~1\gab riel\config~1\t e
    mp\tmpoygjnk\Re lease\docume~1\ gabriel\config~ 1\temp\tmpoygjn k\src.win32-2.5\dsca
    lmodule.o
    gcc -mno-cygwin -O2 -Wall -Wstrict-prototypes
    -Ic:\docume~1\ga briel\config~1\ tem
    p\tmpoygjnk\src .win32-2.5
    -IC:\Apps\Python 25\lib\site-packages\numpy\ core\includ
    e -IC:\Apps\Python 25\include -IC:\Apps\Python 25\PC -c
    c:\docume~1\gab riel\config
    ~1\temp\tmpoygj nk\src.win32-2.5\fortranobje ct.c -o
    c:\docume~1\gab riel\config~1\
    temp\tmpoygjnk\ Release\docume~ 1\gabriel\confi g~1\temp\tmpoyg jnk\src.win32-2.5\fo
    rtranobject.o
    [...]
    c:\apps\mingw\b in\g77.exe -g -Wall -mno-cygwin -g -Wall -mno-cygwin
    -shared c:\d
    ocume~1\gabriel \config~1\temp\ tmpoygjnk\Relea se\docume~1\gab riel\config~1\t emp\t
    mpoygjnk\src.wi n32-2.5\dscalmodule .o
    c:\docume~1\gab riel\config~1\t emp\tmpoygjnk
    \Release\docume ~1\gabriel\conf ig~1\temp\tmpoy gjnk\src.win32-2.5\fortranobje ct.o
    c:\docume~1\gab riel\config~1\t emp\tmpoygjnk\R elease\dscal.o
    -Lc:\apps\mingw\ lib
    -Lc:\apps\mingw\ lib\gcc\mingw32 \3.4.2 -LC:\Apps\Python 25\libs
    -LC:\Apps\Python 25
    \PCBuild -lpython25 -lg2c -o .\dscal.pyd
    [...]

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

    C:\TEMP\for>pyt hon
    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.__d oc__
    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(l en(v), 2, v)
    2.
    pyprint v
    [ 2. 4. 6. 8. 10.]

    --
    Gabriel Genellina

Working...