python-dev and setting up setting up f2py on Windows XP

2006-08-16 Thread Sile
Hi,

I've been trying to get f2py working on Windows XP, I am using Python
2.3. I'm new to python so I'm not too sure what I'm doing yet. I need
the python-dev package to run f2py. I have been told this is just the
header files and .dll and I need to put them somewhere my C compiler
can find them. I've searched the web and none of the python-dev
packages I've found are for windows. I was wondering is this
automatically part of the windows version and if so how I set it up so
my C compiler can find them. If it is not part of the standard package
does anyone know where I can find it???

Any help at all would be much appreciated.
Thanks,
Sile

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python-dev and setting up setting up f2py on Windows XP

2006-08-18 Thread Sile
Hi John,

Thank you very much for your help and resolving my issue with
"python-dev". I'll hopefully get my problem sorted today, if not I'm
sure I'll be back with more questions! The C compiler I'm using is
Microsoft Visual Studio 8. I have been told there are potential
compatibility issues between this, my version of python and my fortran
compiler. I have to use python 2.3 as it is compatible with a CFD
package I'm using.  I've resinstalled python properley so I'll
persevere with my exsisting C compiler this morning and try MINGW32 if
I have no joy.

Thanks again,

Sile

John Machin wrote:
> Sile wrote:
> > Hi,
> >
> > I've been trying to get f2py working on Windows XP, I am using Python
> > 2.3. I'm new to python so I'm not too sure what I'm doing yet. I need
> > the python-dev package to run f2py. I have been told this is just the
> > header files and .dll and I need to put them somewhere my C compiler
> > can find them. I've searched the web and none of the python-dev
> > packages I've found are for windows. I was wondering is this
> > automatically part of the windows version and if so how I set it up so
> > my C compiler can find them. If it is not part of the standard package
> > does anyone know where I can find it???
> >
> > Any help at all would be much appreciated.
>
> The concept of "python-dev package" is a Debian concept which doesn't
> apply to Windows. The standard installation on Windows provides the
> header and library files that you need for interfacing with C.
>
> Don't put things where your C compiler can find them; do a standard
> no-frills install of Python2.4 using the .msi installer and tell your C
> compiler where the goodies are.
>
> E.g. using the MinGW32 gcc, you'd need things like:
>
> gcc -I\python24\include  -lpython24 -L\python24\libs
> [first is "i".upper(), second is "L".lower()]
>
> Which C compiler are you using?
>
> You will need to add "C:\Python24" to the path so that you can invoke
> python easily; that will also enable anything else finding python24.dll
> if you do a "me only" install of Python.
>
> So give that a whirl and if you have any dramas, come back with
> questions ...
> 
> HTH,
> John

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python-dev and setting up setting up f2py on Windows XP

2006-08-18 Thread Sile
Hi John,

Thank you very much for your help and resolving my issue with
"python-dev". I'll hopefully get my problem sorted today, if not I'm
sure I'll be back with more questions! The C compiler I'm using is
Microsoft Visual Studio 8. I have been told there are potential
compatibility issues between this, my version of python and my fortran
compiler. I have to use python 2.3 as it is compatible with a CFD
package I'm using.  I've resinstalled python properley so I'll
persevere with my exsisting C compiler this morning and try MINGW32 if
I have no joy.

Thanks again,

Sile

John Machin wrote:
> Sile wrote:
> > Hi,
> >
> > I've been trying to get f2py working on Windows XP, I am using Python
> > 2.3. I'm new to python so I'm not too sure what I'm doing yet. I need
> > the python-dev package to run f2py. I have been told this is just the
> > header files and .dll and I need to put them somewhere my C compiler
> > can find them. I've searched the web and none of the python-dev
> > packages I've found are for windows. I was wondering is this
> > automatically part of the windows version and if so how I set it up so
> > my C compiler can find them. If it is not part of the standard package
> > does anyone know where I can find it???
> >
> > Any help at all would be much appreciated.
>
> The concept of "python-dev package" is a Debian concept which doesn't
> apply to Windows. The standard installation on Windows provides the
> header and library files that you need for interfacing with C.
>
> Don't put things where your C compiler can find them; do a standard
> no-frills install of Python2.4 using the .msi installer and tell your C
> compiler where the goodies are.
>
> E.g. using the MinGW32 gcc, you'd need things like:
>
> gcc -I\python24\include  -lpython24 -L\python24\libs
> [first is "i".upper(), second is "L".lower()]
>
> Which C compiler are you using?
>
> You will need to add "C:\Python24" to the path so that you can invoke
> python easily; that will also enable anything else finding python24.dll
> if you do a "me only" install of Python.
>
> So give that a whirl and if you have any dramas, come back with
> questions ...
> 
> HTH,
> John

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python-dev and setting up setting up f2py on Windows XP

2006-08-18 Thread Sile
Thanks Anand !

-- 
http://mail.python.org/mailman/listinfo/python-list


f2py on windows XP - "Unknown Switch"??

2006-08-21 Thread Sile
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 complier reduced my errors
but I'm still having trouble. I think I have all the correct paths set
but I'm not sure. F2PY gets further when I specifically tell it what my
compilers are as follows.

C:\Program Files\ESI_Software\SileFortran\ExampleF2PY>f2py
--fcompiler=compaqv -
-compiler=mingw32 -c -m hello hello.f

If I don't specify the compliers it looks for a file cl.exe then
terminates when it can't find it.

Once the compliers are specified it seems to read my fortran code ok,
build the module "hello" and the wrapper function "foo" and writes a
temporary file "hellomodule.c"

Then it seems to use MINGW32 ok.

The problem arises right at the end when it tries to generate hello.pyd
and I'm not sure why, I've included the error below.

I've tried eveything I can think of but I'm very new to programming so
I'm not having much success.

Any help would be much appreciated.

Thanks,
Sile

DF:f77: hello.f
DF
c:\docume~1\esil\locals~1\temp\tmp-tajpa\Release\docume~1\esil\locals~1\temp\
tmp-tajpa\src.win32-2.3\hellomodule.o
c:\docume~1\esil\locals~1\temp\tmp-tajpa\R
elease\docume~1\esil\locals~1\temp\tmp-tajpa\src.win32-2.3\fortranobject.o
c:\do
cume~1\esil\locals~1\temp\tmp-tajpa\Release\hello.o
-LC:\PROGRA~1\ESI_SO~1\UTILS
_~1\PYTHON~1.3_C\libs
-LC:\PROGRA~1\ESI_SO~1\UTILS_~1\PYTHON~1.3_C\PCBuild -lpyt
hon23 /OUT:.\hello.pyd
DF: error: Unknown switch:
'-LC:\PROGRA~1\ESI_SO~1\UTILS_~1\PYTHON~1.3_C\libs'
error: Command "DF
c:\docume~1\esil\locals~1\temp\tmp-tajpa\Release\docume~1\esi
l\locals~1\temp\tmp-tajpa\src.win32-2.3\hellomodule.o
c:\docume~1\esil\locals~1\
temp\tmp-tajpa\Release\docume~1\esil\locals~1\temp\tmp-tajpa\src.win32-2.3\fortr
anobject.o c:\docume~1\esil\locals~1\temp\tmp-tajpa\Release\hello.o
-LC:\PROGRA~
1\ESI_SO~1\UTILS_~1\PYTHON~1.3_C\libs
-LC:\PROGRA~1\ESI_SO~1\UTILS_~1\PYTHON~1.3
_C\PCBuild -lpython23 /OUT:.\hello.pyd" failed with exit status 1

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: f2py on windows XP - "Unknown Switch"??

2006-08-28 Thread Sile
Cheers John -

I did finally getting f2py working on XP using MinGW, GnuFcompiler for
F77, and much help!  However, having set up everything correctly I have
been told in work I now need to use F90. I have downloaded and
installed G95 MinGW in my MinGW directory and this isn't working now,
I'm not having much joy with this! When I check the available fortran
compilers in F2PY I get the following...

customize Gnu95FCompiler

Could not locate executable f95

Executable f95 does not exist

Could not locate executable f95

Executable f95 does not exist

Could not locate executable f95

Executable f95 does not exist

customize IntelVisualFCompiler

Could not locate executable ifl

Executable ifl does not exist

customize G95FCompiler

Couldn't match compiler version for 'G95 (GCC 4.0.3 (g95 0.90!) Aug 22
2006) Copyright (C) 2002-2005 Free Software Foundation, Inc.nG95 comes
with NO WARRANTY, to the extent permitted by law. You may redistribute
copies of G95under the terms of the GNU General Public License.For more
information about these

...etc.


based on suggestions on the web I changed one line in g95.py to
version_pattern =r'G95.*\(GCC4.01)\(g95!) (?P<version>.\).
Unfortunately this didn't work for me. The problem seems to be with my
gcc version so I'm trying to find a way around this at the moment. Any
suggestions would be much appreciated, I have submitted this problem to
the f2py mailing list too.

thanks,

Sile

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: f2py on windows XP - "Unknown Switch"??

2006-08-28 Thread Sile
Thanks for your reply,
Sorry about the last post - pasting from another post didn't work so
well...

The --version output from my f95 compiler is as follows:

C:\>g95 --version
G95 (GCC 4.0.3 (g95 0.90!) Aug 22 2006)
Copyright (C) 2002-2005 Free Software Foundation, Inc.

G95 comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of G95
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING

The f95.py file is located under Numpy as follows...
C:\Program
Files\ESI_Software\UTILS_2006\Python2.3_CFD\Lib\site-packages\numpy\distutils\fcompiler\f95.py

import os
import sys

from numpy.distutils.cpuinfo import cpu
from numpy.distutils.fcompiler import FCompiler

class G95FCompiler(FCompiler):

compiler_type = 'g95'
version_pattern = r'G95.*\(GCC 4.0.3 \(g95!\) (?P.*)\).*'
THE LINE ABOVE WAS ORIGINALLY:
version_pattern = r'G95.*\(experimental \(g95!\)
(?Pf2py -c --help-fcompiler
...
Could not locate executable f95
Executable f95 does not exist
customize VastFCompiler
Could not locate executable vf90
Executable vf90 does not exist
customize GnuFCompiler
customize IbmFCompiler
Could not locate executable xlf
Executable xlf does not exist
customize Gnu95FCompiler
Could not locate executable f95
Executable f95 does not exist
Could not locate executable f95
Executable f95 does not exist
Could not locate executable f95
Executable f95 does not exist
customize IntelVisualFCompiler
Could not locate executable ifl
Executable ifl does not exist
customize G95FCompiler
Couldn't match compiler version for 'G95 (GCC 4.0.3 (g95 0.90!) Aug 22
2006)\nCo
pyright (C) 2002-2005 Free Software Foundation, Inc.\n\nG95 comes with
NO WARRAN
TY, to the extent permitted by law.\nYou may redistribute copies of
G95\nunder the terms of the GNU General Public License.\nFor more
information about these matters, see the file named COPYING'
customize IntelItaniumFCompiler
Could not locate executable efc
Executable efc does not exist
customize PGroupFCompiler
Could not locate executable pgf77
Executable pgf77 does not exist
customize LaheyFCompiler
Could not locate executable lf95
Executable lf95 does not exist
customize CompaqVisualFCompiler
customize MipsFCompiler
customize HPUXFCompiler
customize IntelItaniumVisualFCompiler
Could not locate executable efl
Executable efl does not exist
customize IntelEM64TFCompiler
Could not locate executable efc
Executable efc does not exist
List of available Fortran compilers:
  --fcompiler=compaqv  DIGITAL|Compaq Visual Fortran Compiler (6.5)
  --fcompiler=gnu  GNU Fortran Compiler (3.4.5)

I hope that makes it a bit clearer,

Thanks,

Sile

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: f2py on windows XP - "Unknown Switch"??

2006-08-28 Thread Sile
Thanks John,

Your help is very much appreciated - my f2py finally recognises my
fortran compiler - I'm very relieved!

>
> That won't match the guff your f95 puts out. The "!)" appears *after*
> the version number. See below.
>
> |>>> import re
> |>>> guff = 'G95 (GCC 4.0.3 (g95 0.90!) Aug 22 2006) etc etc'
> |>>> vp1 = r'G95.*\(GCC 4.0.3 \(g95!\) (?P.*)\).*'
> |>>> vp2 = r'G95.*\(GCC 4.0.3 \(g95 (?P.*)!\).*'

I changed my g95 file so that version_pattern was correct.
>
> > THE LINE ABOVE WAS ORIGINALLY:
> > version_pattern = r'G95.*\(experimental \(g95!\)
> > (?P
> No it wasn't. It would have had a ">" after "version" :-)
oops!

Many thanks again,

Sile

-- 
http://mail.python.org/mailman/listinfo/python-list