Re: [Numpy-discussion] f2py NotImplementedError

2016-07-26 Thread Aronne Merrelli
Hello Andy, I'm not an expert on f2py, but I've used it in a few cases. I can recreate a NotImplementedError by copying your commands. The problem is that you are using -l (lower case L), which I think is supposed to specify the library name, not a path. The NotImplementedError is not really what

[Numpy-discussion] f2py NotImplementedError

2016-07-24 Thread andy buzza
Hello all, I have been trying to compile a relatively simple pair of Fortran files, one referencing a subroutine from another file (mainmodule.f90 references othermodule.f90). I have been able to compile them using a Fortran compiler, but receive a NotImplementedError when using f2py. Steps I us

Re: [Numpy-discussion] F2PY subroutine referenced in another file

2016-07-10 Thread Jonathan Stickel
To: numpy-discussion@scipy.org Subject: [Numpy-discussion] F2PY subroutine referenced in another file Message-ID: <1468090643073-43261.p...@n7.nabble.com> Content-Type: text/plain; charset=us-ascii Hello everyone, I am relatively new to f2py and have been trying to create a module of a main fort

[Numpy-discussion] F2PY subroutine referenced in another file

2016-07-09 Thread asbuzza
Hello everyone, I am relatively new to f2py and have been trying to create a module of a main fortran file that references a subroutine in another fortran file. I have been doing: >f2py -c -m mainmodule mainmodule.f90 othermodule.f90 Any help would be greatly appreciated. Thanks, Andy -- Vi

Re: [Numpy-discussion] f2py output module name

2016-07-05 Thread klo uo
So on Linux too, there is "ABI" suffix too, for generated module... I misunderstood. I was renaming generated module to "fib3.pyd" to be able to do "import fib3", but now I see it's not necessary - it's importable the same regardless the name of generated module :) Thanks ___

Re: [Numpy-discussion] f2py output module name

2016-07-05 Thread Ralf Gommers
On Tue, Jul 5, 2016 at 9:18 PM, klo uo wrote: > Hi, I'm following this guide: > http://docs.scipy.org/doc/numpy-dev/f2py/getting-started.html#the-quick-and-smart-way > > I'm on Windows with gfortran and VS2015. When I run: > > f2py -c -m fib3 fib3.f > > as output I dont get "fib3.pyd", but "f

[Numpy-discussion] f2py output module name

2016-07-05 Thread klo uo
Hi, I'm following this guide: http://docs.scipy.org/doc/numpy-dev/f2py/getting-started.html#the-quick-and-smart-way I'm on Windows with gfortran and VS2015. When I run: f2py -c -m fib3 fib3.f as output I dont get "fib3.pyd", but "fib3.cp35-win_amd64.pyd". Does anyone know how to get correct

Re: [Numpy-discussion] f2py: ram usage

2016-04-11 Thread Vasco Gervasi
Using order='F' solved the problem. Thanks for reply. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] f2py: ram usage

2016-04-11 Thread George Nurser
Yes, f2py is probably copying the arrays; you can check this by appending -DF2PY_REPORT_ON_ARRAY_COPY=1 to your call to f2py. I normally prefer to keep the numpy arrays C-order (most efficient for numpy) and simply pass the array transpose to the f2py-ized fortran routine. This means that the for

Re: [Numpy-discussion] f2py: ram usage

2016-04-10 Thread Sebastian Berg
On So, 2016-04-10 at 12:04 +0200, Vasco Gervasi wrote: > Hi all, > I am trying to write some code to do calculation onto an array: for > each row I need to do some computation and have a number as return. > To speed up the process I wrote a fortran subroutine that is called > from python [using f2p

[Numpy-discussion] f2py: ram usage

2016-04-10 Thread Vasco Gervasi
Hi all, I am trying to write some code to do calculation onto an array: for each row I need to do some computation and have a number as return. To speed up the process I wrote a fortran subroutine that is called from python [using f2py] for each row of the array, so the input of this subroutine is

Re: [Numpy-discussion] f2py, numpy.distutils and multiple Fortran source files

2015-12-05 Thread David Verelst
Thanks a lot for providing the example Sturla, that is exactly what we are looking for! On 4 December 2015 at 11:34, Sturla Molden wrote: > On 03/12/15 22:07, David Verelst wrote: > > Can this workflow be incorporated into |setuptools|/|numpy.distutils|? >> Something along the lines as: >> > > T

Re: [Numpy-discussion] f2py, numpy.distutils and multiple Fortran source files

2015-12-04 Thread Sturla Molden
On 03/12/15 22:07, David Verelst wrote: Can this workflow be incorporated into |setuptools|/|numpy.distutils|? Something along the lines as: Take a look at what SciPy does. https://github.com/scipy/scipy/blob/81c096001974f0b5efe29ec83b54f725cc681540/scipy/fftpack/setup.py Multiple Fortran fi

Re: [Numpy-discussion] f2py, numpy.distutils and multiple Fortran source files

2015-12-03 Thread Tim Cera
On Thu, Dec 3, 2015 at 4:07 PM David Verelst wrote: > Hi, > > For the wafo [1] package we are trying to include the extension > compilation process in setup.py [2] by using setuptools and > numpy.distutils [3]. Some of the extensions have one Fortran interface > source file, but it depends on sev

[Numpy-discussion] f2py, numpy.distutils and multiple Fortran source files

2015-12-03 Thread David Verelst
Hi, For the wafo [1] package we are trying to include the extension compilation process in setup.py [2] by using setuptools and numpy.distutils [3]. Some of the extensions have one Fortran interface source file, but it depends on several other Fortran sources (modules). The manual compilation proc

Re: [Numpy-discussion] f2py and callbacks with variables

2015-08-13 Thread Pearu Peterson
Hi Casey, On Wed, Aug 12, 2015 at 11:46 PM, Casey Deen wrote: > Hi Pearu- > >Thanks so much! This works! Can you point me to a reference for the > format of the .pyf files? My ~day of searching found a few pages on the > scipy website, but nothing which went into this amount of detail. >

Re: [Numpy-discussion] f2py and callbacks with variables

2015-08-12 Thread Casey Deen
Hi Pearu- Thanks so much! This works! Can you point me to a reference for the format of the .pyf files? My ~day of searching found a few pages on the scipy website, but nothing which went into this amount of detail. I also asked Stackoverflow, and unless you object, I'd like to add your exp

Re: [Numpy-discussion] f2py and callbacks with variables

2015-08-12 Thread Pearu Peterson
Hi Casey, What you observe, is not a f2py bug. When f2py sees a code like subroutine foo call bar end subroutine foo then it will not make an attempt to analyze bar because of implicit assumption that all statements that has no references to foo arguments are irrelevant for wrapper function ge

[Numpy-discussion] f2py and callbacks with variables

2015-08-12 Thread Casey Deen
Hi all- I've run into what I think might be a bug in f2py and callbacks to python. Or, maybe I'm not using things correctly. I have created a very minimal example which illustrates my problem at: https://github.com/soylentdeen/fluffy-kumquat The issue seems to affect call backs with variabl

Re: [Numpy-discussion] F2PY and multi-dimension arrays - unexpected array size error

2015-07-01 Thread Backing Olof
Hello, the project is already successfully completed, but I thought for the completeness (and documentation) give myself an answer on what I did wrong and what the correct solution was. I. I didn’t realise that parameter ordering was crucial. Somehow I just had forgotten this knowledge, but not

Re: [Numpy-discussion] f2py problem with multiple fortran source files

2015-06-13 Thread 石头
Dear Pearu Peterson, Thank you for your reply! I did as you said, and I got the module mulib.so successfully, but I got another problem when I try to import this module in Python. Here are the messeage I got in Python: Enthought Canopy Python 2.7.6 | 64-bit | (default, Sep 15 2014, 17:36:10) [G

Re: [Numpy-discussion] f2py problem with multiple fortran source files

2015-06-13 Thread Pearu Peterson
Hi, On Fri, Jun 12, 2015 at 7:23 PM, 石头 wrote: > Hi,everybody, > I'm new to f2py, and I got some trouble when wrapped some fortran files > to Python. > I have download a Fortran library ( > https://github.com/brianlockwood/ForK), I want to compile these files > into a library and call the lib

[Numpy-discussion] f2py problem with multiple fortran source files

2015-06-12 Thread 石头
Hi,everybody, I'm new to f2py, and I got some trouble when wrapped some fortran files to Python. I have download a Fortran library (https://github.com/brianlockwood/ForK), I want to compile these files into a library and call the library by other Fortran file wrote by myself. Here are my ques

[Numpy-discussion] F2PY and multi-dimension arrays - unexpected array size error

2015-02-03 Thread Backing Olof
Hi I am helping out with a Python and Fortran project. Let me give you some background: * Fortran source: C Bergstrom FCC C User subroutine VUMAT subroutine VUMAT( C Read only - * nblock, ndir, nshr, nstatev, nprops, * stepTime, dt, * props, * density, st

Re: [Numpy-discussion] F2PY cannot see module-scope variables

2015-01-26 Thread Warren Weckesser
On 1/26/15, Yuxiang Wang wrote: > Dear all, > > Sorry about being new to both Fortran 90 and f2py. > > I have a module in fortran, written as follows, with a module-scope variable > dp: > > > ! testf2py.f90 > module testf2py > implicit none > privat

Re: [Numpy-discussion] F2PY cannot see module-scope variables

2015-01-26 Thread Yuxiang Wang
Sorry that I forgot to report the environment - Windows 64 bit, Python 3.4 64 bit. Numpy version is 1.9.1, and I commented the "raise NotImplementedError("Only MS compiler supported with gfortran on win64")" in the gnu.py, as instructed on this link: http://scientificcomputingco.blogspot.com.au/20

[Numpy-discussion] F2PY cannot see module-scope variables

2015-01-26 Thread Yuxiang Wang
Dear all, Sorry about being new to both Fortran 90 and f2py. I have a module in fortran, written as follows, with a module-scope variable dp: ! testf2py.f90 module testf2py implicit none private public dp, i1 integer, parameter :: dp=kind(

Re: [Numpy-discussion] f2py and debug mode

2014-10-06 Thread ferdinand.bayard
Hello ! And thx for answering ! Meanwhile, I founded a solution for my problem : I hacked some lines setting the compiler options in the f2py Python files, which enables the generation of pdb files for debugging. In msvc9compiler.py, line 432 self.ldflags_shared = ['/DLL', '/nologo', '/INCREMENTAL

Re: [Numpy-discussion] f2py and debug mode

2014-10-03 Thread Pearu Peterson
Hi, When you run f2py without -c option, the wrapper source files are generated without compiling them. With these source files and fortranobject.c, you can build the extension module with your specific compiler options using the compiler framework of your choice. I am not familiar with Visual Stu

[Numpy-discussion] f2py and debug mode

2014-09-30 Thread Bayard
Hello to all. I'm aiming to wrap a Fortran program into Python. I started to work with f2py, and am trying to setup a debug mode where I could reach breakpoints in Fortran module launched by Python. I've been looking in the existing post, but not seeing things like that. I'm used to work with v

[Numpy-discussion] f2py and string arrays (need help)

2014-05-28 Thread Siegfried Gonzi
Hi all Given the following pseudo code: == SUBROUTINE READ_B( FILENAME, ix,iy,iz,nx, OUT_ARRAY, out_cat) IMPLICIT NONE INTEGER*4, INTENT(IN) :: IX, iy, iz, nx REAL*4,INTENT(OUT) :: OUT_ARRAY(nx,IX, iy, iz) CHARACTER, dimension(nx,40),intent(out) ::OUT_CAT CHARACTER(LEN=

Re: [Numpy-discussion] f2py links extensions to incorrect python installation on OSX / Anaconda

2014-04-21 Thread Ralf Gommers
On Thu, Mar 27, 2014 at 10:11 PM, Alex Goodman wrote: > Hi Robert, > > That did the trick, thanks! > > Alex > > > On Thu, Mar 27, 2014 at 3:02 PM, Robert Kern wrote: > >> On Thu, Mar 27, 2014 at 8:50 PM, David Cournapeau >> wrote: >> > >> > On Thu, Mar 27, 2014 at 8:30 PM, Alex Goodman < >> alex.

Re: [Numpy-discussion] f2py links extensions to incorrect python installation on OSX / Anaconda

2014-03-27 Thread Alex Goodman
Hi Robert, That did the trick, thanks! Alex On Thu, Mar 27, 2014 at 3:02 PM, Robert Kern wrote: > On Thu, Mar 27, 2014 at 8:50 PM, David Cournapeau > wrote: > > > > On Thu, Mar 27, 2014 at 8:30 PM, Alex Goodman < > alex.good...@colostate.edu> > > wrote: > >> > >> Hi all, > >> > >> I have used

Re: [Numpy-discussion] f2py links extensions to incorrect python installation on OSX / Anaconda

2014-03-27 Thread Robert Kern
On Thu, Mar 27, 2014 at 8:50 PM, David Cournapeau wrote: > > On Thu, Mar 27, 2014 at 8:30 PM, Alex Goodman > wrote: >> >> Hi all, >> >> I have used f2py in the past on a Linux machine with virtually no issues. >> However on my Mac, I get the following error when importing an f2py >> generated ext

Re: [Numpy-discussion] f2py links extensions to incorrect python installation on OSX / Anaconda

2014-03-27 Thread David Cournapeau
On Thu, Mar 27, 2014 at 8:30 PM, Alex Goodman wrote: > Hi all, > > I have used f2py in the past on a Linux machine with virtually no issues. > However on my Mac, I get the following error when importing an f2py > generated extension: > > Fatal Python error: PyThreadState_Get: no current thread > A

[Numpy-discussion] f2py links extensions to incorrect python installation on OSX / Anaconda

2014-03-27 Thread Alex Goodman
Hi all, I have used f2py in the past on a Linux machine with virtually no issues. However on my Mac, I get the following error when importing an f2py generated extension: Fatal Python error: PyThreadState_Get: no current thread Abort trap: 6 After doing some research I found out that the extensi

[Numpy-discussion] f2py and Fortran STOP statement issue

2013-11-20 Thread Pearu Peterson
Hi, The issue with wrapping Fortran codes that contain STOP statements has been raised several times in past with no good working solution proposed. Recently the issue was raised again in f2py issues. Since the user was filling to test out few ideas with positive results, I decided to describe th

Re: [Numpy-discussion] f2py and setup.py how can I specify where the .so file goes?

2013-07-12 Thread Jose Gomez-Dans
Hi Scott, thanks for your help. On 12 July 2013 10:02, Scott Sinclair wrote: > > Something like the following should work... [...] > Your suggestion works like what I already had. The issue is that the .so created by the Extension is copied to copying /lib/python2.7/site-packages/ and not to /lib

Re: [Numpy-discussion] f2py and setup.py how can I specify where the .so file goes?

2013-07-12 Thread Scott Sinclair
On 10 July 2013 17:50, Jose Gomez-Dans wrote: > Hi, > I am building a package that exposes some Fortran libraries through f2py. > The packages directory looks like this: > setup.py > my_pack/ > | > |-->__init__.py > |--> some.pyf > |---> code.f90 > > I thoughat that

[Numpy-discussion] f2py and setup.py how can I specify where the .so file goes?

2013-07-10 Thread Jose Gomez-Dans
Hi, I am building a package that exposes some Fortran libraries through f2py. The packages directory looks like this: setup.py my_pack/ | |-->__init__.py |--> some.pyf |---> code.f90 I thoughat that once installed, I'd get the .so and __init__.py in the same directo

Re: [Numpy-discussion] f2py build with mkl lapack

2013-07-08 Thread Bradley M. Froehle
On Mon, Jul 8, 2013 at 10:15 AM, David Cournapeau wrote: > > > On Mon, Jul 8, 2013 at 5:05 PM, sunghyun Kim > wrote: >> >> Hi >> >> I'm trying to use fortran wrapper f2py with intel's mkl >> >> following is my command >> >> LIB='-L/opt/intel/Compiler/11.1/064/mkl/lib/em64t/ -lguide -lpthread >> -

[Numpy-discussion] f2py: Exposing parameters from "used" modules

2013-06-18 Thread Jeremy Solbrig
Hi all, I assume that this question is addressed somewhere, but I have spent an inordinate amount of time looking around for the answer including digging into the source code a bit. I have tried to put the basic problem in the first paragraph. The rest of the email shows a basic example of

Re: [Numpy-discussion] f2py and object libraries

2013-04-25 Thread Aron Ahmadia
Hi Jon, I have personally never used f2py to link to library code, but according to the documentation: http://cens.ioc.ee/projects/f2py2e/usersguide/index.html#command-f2py if you are building a module (that is, invoking f2py -c), then you can either include the path to the .a file directly at t

[Numpy-discussion] f2py and object libraries

2013-04-25 Thread Jonathan Slavin
Hi all, I have recently started using f2py to access some legacy fortran code and it's mostly worked better than I expected. It handles common blocks, block data, etc. with no problems. I did need to define the type of all the arguments in subroutine and function calls, but not in the body of th

Re: [Numpy-discussion] f2py with allocatable arrays

2012-07-05 Thread Ondřej Čertík
On Tue, Jul 3, 2012 at 9:51 PM, Paul Anton Letnes wrote: > > On 4. juli 2012, at 02:23, Sturla Molden wrote: > >> Den 03.07.2012 20:38, skrev Casey W. Stark: >>> >>> Sturla, this is valid Fortran, but I agree it might just be a bad >>> idea. The Fortran 90/95 Explained book mentions this in the >>

Re: [Numpy-discussion] f2py with allocatable arrays

2012-07-05 Thread Ondřej Čertík
On Tue, Jul 3, 2012 at 5:27 PM, Sturla Molden wrote: > Den 04.07.2012 01:59, skrev Sturla Molden: >> But neither was the case here. The allocatable was a dummy variable in >> a subroutine's interface, declared with intent(out). That is an error >> the compiler should trap, because it is doomed to

Re: [Numpy-discussion] f2py with allocatable arrays

2012-07-05 Thread Casey W. Stark
Hi all. Thanks for the help again. I ended up going with running it twice -- once for the final number of particles and second for the positions. Sturla, given that this functionality is so standard dependent, I decided to ditch it. It works with my gfortran, but who knows with other machines and

Re: [Numpy-discussion] f2py with allocatable arrays

2012-07-03 Thread Paul Anton Letnes
On 4. juli 2012, at 02:23, Sturla Molden wrote: > Den 03.07.2012 20:38, skrev Casey W. Stark: >> >> Sturla, this is valid Fortran, but I agree it might just be a bad >> idea. The Fortran 90/95 Explained book mentions this in the >> allocatable dummy arguments section and has an example using a

Re: [Numpy-discussion] f2py with allocatable arrays

2012-07-03 Thread Sturla Molden
Den 04.07.2012 01:59, skrev Sturla Molden: > But neither was the case here. The allocatable was a dummy variable in > a subroutine's interface, declared with intent(out). That is an error > the compiler should trap, because it is doomed to segfault. Ok, so the answer here seems to be: In Fortra

Re: [Numpy-discussion] f2py with allocatable arrays

2012-07-03 Thread Sturla Molden
Den 03.07.2012 20:38, skrev Casey W. Stark: > > Sturla, this is valid Fortran, but I agree it might just be a bad > idea. The Fortran 90/95 Explained book mentions this in the > allocatable dummy arguments section and has an example using an array > with allocatable, intent(out) in a subrountine

Re: [Numpy-discussion] f2py with allocatable arrays

2012-07-03 Thread Sturla Molden
Den 03.07.2012 19:24, skrev Pearu Peterson: > > One can have allocatable arrays in module data block, for instance, where > they a global In Fortran 2003 one can also have allocatable arrays as members in derived types. But neither was the case here. The allocatable was a dummy variable in a su

Re: [Numpy-discussion] f2py with allocatable arrays

2012-07-03 Thread Casey W. Stark
Hi all. Thanks for the speedy responses! I'll try to respond to all... The first idea is to split up the routine into two -- one to compute the final size of the arrays, and the second to fill them in. I might end up doing this, because it is simplest, but it means creating the initial conditions

Re: [Numpy-discussion] f2py with allocatable arrays

2012-07-03 Thread Pearu Peterson
On Tue, Jul 3, 2012 at 5:20 PM, Sturla Molden wrote: > > As for f2py: Allocatable arrays are local variables for internal use, > and they are not a part of the subroutine's calling interface. f2py only > needs to know about the interface, not the local variables. > One can have allocatable array

Re: [Numpy-discussion] f2py with allocatable arrays

2012-07-03 Thread Sturla Molden
Den 03.07.2012 11:54, skrev George Nurser: >> module zp >>implicit none >>contains >>subroutine ics(..., num_particles, particle_mass, positions, velocities) >> use data_types, only : dp >> implicit none >> ... inputs ... >> integer, intent(out) :: num_particles >>

Re: [Numpy-discussion] f2py with allocatable arrays

2012-07-03 Thread Jim Vickroy
On 7/2/2012 7:17 PM, Casey W. Stark wrote: Hi numpy. Does anyone know if f2py supports allocatable arrays, allocated inside fortran subroutines? The old f2py docs seem to indicate that the allocatable array must be created with numpy, and dropped in the module. Here's more background to expla

Re: [Numpy-discussion] f2py with allocatable arrays

2012-07-03 Thread Andreas Hilboll
> Hi numpy. > > Does anyone know if f2py supports allocatable arrays, allocated inside > fortran subroutines? The old f2py docs seem to indicate that the > allocatable array must be created with numpy, and dropped in the module. > Here's more background to explain... > > I have a fortran subroutine

Re: [Numpy-discussion] f2py with allocatable arrays

2012-07-03 Thread George Nurser
Can you interface your fortran program twice? First time return the number of particles, dimensions etc to python python then creates work array of right size Second interface pass work array as in/out array, dimension in fortran argument list, to fortran fortran copies allocatable arrays to arg

[Numpy-discussion] f2py with allocatable arrays

2012-07-02 Thread Casey W. Stark
Hi numpy. Does anyone know if f2py supports allocatable arrays, allocated inside fortran subroutines? The old f2py docs seem to indicate that the allocatable array must be created with numpy, and dropped in the module. Here's more background to explain... I have a fortran subroutine that returns

[Numpy-discussion] f2py hiding callback function

2012-05-30 Thread Marc Poinot
Hi all, I'm trying to hide the actual python callback function on the fortran side as well as on the python side. See the example: I want f1 to be the wrapper of my callback, f2 is a second level where the user has no arg to pass. But if I call f2, for example in f3, the callback is 'propagated'

Re: [Numpy-discussion] f2py with int8

2012-04-19 Thread Sturla Molden
On 17.04.2012 07:32, John Mitchell wrote: > Hi, > > I am using f2py to pass a numpy array of type numpy.int8 to fortran. It > seems like I am misunderstanding something because I just can't make it > work. > > Here is what I am doing. > > PYTHON > b=numpy.array(numpy.zeros(shape=(10,),dtype=numpy.

Re: [Numpy-discussion] f2py with int8

2012-04-18 Thread Paul Anton Letnes
Hi, 1, 2, 3 are integer literals. 1.0, 3.0e2, -42.0 are real (float) literals 'hello world' is a string literal. As far as I remember, f2py requires a literal variable for the kind. The solution I have landed on is to write a pure fortran module (using int8, or whatever), and then wrap this modu

Re: [Numpy-discussion] f2py with int8

2012-04-17 Thread John Mitchell
Thanks Paul. I suppose this is now going slightly out of bounds for f2py. What I am looking for is the fortran kind type for a byte. I thought that this was int8. I guess the question is how to identify the kind type. Although I have verified that integer(1) seems to work for me, I would real

Re: [Numpy-discussion] f2py with int8

2012-04-17 Thread Paul Anton Letnes
Ah, come to think of it, I think that f2py only supports literal kind values. Maybe that's your problem. Paul On 17. apr. 2012, at 07:58, Sameer Grover wrote: > On Tuesday 17 April 2012 11:02 AM, John Mitchell wrote: >> Hi, >> >> I am using f2py to pass a numpy array of type numpy.int8 to fort

Re: [Numpy-discussion] f2py with int8

2012-04-17 Thread John Mitchell
Thanks Sameer. I confirmed on my side as well. I will try to understand the why part now. Much appreciated. On Mon, Apr 16, 2012 at 11:58 PM, Sameer Grover wrote: > On Tuesday 17 April 2012 11:02 AM, John Mitchell wrote: > > Hi, > > I am using f2py to pass a numpy array of type numpy.int8 to

Re: [Numpy-discussion] f2py with int8

2012-04-16 Thread Sameer Grover
On Tuesday 17 April 2012 11:02 AM, John Mitchell wrote: Hi, I am using f2py to pass a numpy array of type numpy.int8 to fortran. It seems like I am misunderstanding something because I just can't make it work. Here is what I am doing. PYTHON b=numpy.array(numpy.zeros(shape=(10,),dtype=nump

Re: [Numpy-discussion] f2py with int8

2012-04-16 Thread Paul Anton Letnes
Hi, this probably does not help with your problem. However, I would recommend changing your fortran code to: subroutine print_bit_array(bits) use iso_fortran_env integer(kind=int8),intent(in),dimension(:)::bits print*,'bits = ',bits end subroutine print_bit_array In that way you could p

[Numpy-discussion] f2py with int8

2012-04-16 Thread John Mitchell
Hi, I am using f2py to pass a numpy array of type numpy.int8 to fortran. It seems like I am misunderstanding something because I just can't make it work. Here is what I am doing. PYTHON b=numpy.array(numpy.zeros(shape=(10,),dtype=numpy.int8),order='F') b[0]=1 b[2]=1 b[3]=1 b array([1, 0, 1, 1,

[Numpy-discussion] [f2py] f2py ignores 'fortranname' inside F90 modules?

2012-04-16 Thread Irwin Zaid
Hi all, I've been having an issue with f2py simply ignoring the fortranname option if the Fortran subroutine is inside an F90 module. That option is useful for renaming Fortran subroutines. I don't know if this behaviour is to be expected, or if I am doing something wrong. I would definitely a

Re: [Numpy-discussion] f2py and pygtk on windows

2012-03-24 Thread Charles R Harris
On Sat, Mar 24, 2012 at 8:09 AM, Thomas Kluyver wrote: > On 24 March 2012 13:28, David Froger wrote: > > I've had similar problem in the past (but on Gnu/Linux), which was solve > > to by setting the LC_ALL environnement variable to C. (never undersant > why). > > (with Bash: export LC_ALL=C) >

Re: [Numpy-discussion] f2py and pygtk on windows

2012-03-24 Thread Thomas Kluyver
On 24 March 2012 13:28, David Froger wrote: > I've had similar problem in the past (but on Gnu/Linux), which was solve > to by setting the LC_ALL environnement variable to C. (never undersant why). > (with Bash: export LC_ALL=C) This rings a bell. I have a feeling importing pygtk can change the P

Re: [Numpy-discussion] f2py and pygtk on windows

2012-03-24 Thread David Froger
Excerpts from Sameer Grover's message of ven. mars 09 20:50:06 +0100 2012: > >>>import gtk > >>>import foo # where foo is any f2py-wrapped program > > Subsequently, on exiting python interpreter, the interpreter crashes > with this error message - "This application has requested the Runtime > to t

Re: [Numpy-discussion] f2py and pygtk on windows

2012-03-14 Thread Sameer Grover
On Monday 12 March 2012 12:26 AM, Christoph Gohlke wrote: > > On 3/10/2012 9:31 PM, Sameer Grover wrote: >> On 10 March 2012 02:23, Christoph Gohlke wrote: >>> >>> On 3/9/2012 11:50 AM, Sameer Grover wrote: >>> import gtk >>> import foo # where foo is any f2py-wrapped program Subsequ

Re: [Numpy-discussion] f2py and pygtk on windows

2012-03-11 Thread Christoph Gohlke
On 3/10/2012 9:31 PM, Sameer Grover wrote: > On 10 March 2012 02:23, Christoph Gohlke wrote: >> >> >> On 3/9/2012 11:50 AM, Sameer Grover wrote: >> import gtk >> import foo # where foo is any f2py-wrapped program >>> >>> Subsequently, on exiting python interpreter, the interpreter crashe

Re: [Numpy-discussion] f2py and pygtk on windows

2012-03-10 Thread Sameer Grover
On 10 March 2012 02:23, Christoph Gohlke wrote: > > > On 3/9/2012 11:50 AM, Sameer Grover wrote: > import gtk > import foo # where foo is any f2py-wrapped program >> >> Subsequently, on exiting python interpreter, the interpreter crashes >> with this error message - "This application has r

Re: [Numpy-discussion] f2py and pygtk on windows

2012-03-09 Thread Christoph Gohlke
On 3/9/2012 11:50 AM, Sameer Grover wrote: import gtk import foo # where foo is any f2py-wrapped program > > Subsequently, on exiting python interpreter, the interpreter crashes > with this error message - "This application has requested the Runtime > to terminate it in an unusual way.

Re: [Numpy-discussion] f2py function name issues

2012-03-09 Thread Sameer Grover
Thank you very much for the clarification. It would be nice if this were mentioned in the documentation. Sameer On 10 March 2012 01:59, Pauli Virtanen wrote: > 09.03.2012 21:05, Sameer Grover kirjoitti: >> subroutine union () >>    write(*,*)'Hello from Fortran90!!!' >> end subroutine union >> >

Re: [Numpy-discussion] f2py function name issues

2012-03-09 Thread Pauli Virtanen
09.03.2012 21:05, Sameer Grover kirjoitti: > subroutine union () >write(*,*)'Hello from Fortran90!!!' > end subroutine union > > f2py is unable to wrap this function. Changing the name of the > subroutine from 'union' to something else works. I understand that > problems like these have been r

[Numpy-discussion] f2py function name issues

2012-03-09 Thread Sameer Grover
subroutine union () write(*,*)'Hello from Fortran90!!!' end subroutine union f2py is unable to wrap this function. Changing the name of the subroutine from 'union' to something else works. I understand that problems like these have been reported a long time ago (http://cens.ioc.ee/pipermail/f2p

[Numpy-discussion] f2py and pygtk on windows

2012-03-09 Thread Sameer Grover
>>>import gtk >>>import foo # where foo is any f2py-wrapped program Subsequently, on exiting python interpreter, the interpreter crashes with this error message - "This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more i

Re: [Numpy-discussion] f2py : NotImplementedError: Only MS compiler supported with gfortran on win64

2011-09-12 Thread Jim Vickroy
On 9/12/2011 11:17 AM, Jonathan T. Niehof wrote: Is anyone successfully using f2py and gfortran on a Windows machine without relying on cygwin? SpacePy uses mingw32 for both gcc and gfortran; I didn't have any trouble with f2py. I haven't tried a build with 64-bit Python or with EPD; I just buil

Re: [Numpy-discussion] f2py : NotImplementedError: Only MS compiler supported with gfortran on win64

2011-09-12 Thread Jonathan T. Niehof
> Is anyone successfully using f2py and gfortran on a Windows machine > without relying on cygwin? SpacePy uses mingw32 for both gcc and gfortran; I didn't have any trouble with f2py. I haven't tried a build with 64-bit Python or with EPD; I just build the installer against python.org's python and

Re: [Numpy-discussion] f2py : NotImplementedError: Only MS compiler supported with gfortran on win64

2011-09-09 Thread Jim Vickroy
On 9/9/2011 1:59 PM, Christoph Gohlke wrote: > > On 9/9/2011 12:22 PM, Jim Vickroy wrote: >> On 9/9/2011 1:14 PM, Christoph Gohlke wrote: >>> On 9/9/2011 11:43 AM, Jim Vickroy wrote: On 9/9/2011 11:46 AM, Christoph Gohlke wrote: > On 9/9/2011 7:22 AM, Jim Vickroy wrote: >> On 9/8/2011

Re: [Numpy-discussion] f2py : NotImplementedError: Only MS compiler supported with gfortran on win64

2011-09-09 Thread Christoph Gohlke
On 9/9/2011 12:22 PM, Jim Vickroy wrote: > On 9/9/2011 1:14 PM, Christoph Gohlke wrote: >> >> On 9/9/2011 11:43 AM, Jim Vickroy wrote: >>> On 9/9/2011 11:46 AM, Christoph Gohlke wrote: On 9/9/2011 7:22 AM, Jim Vickroy wrote: > On 9/8/2011 10:44 AM, "V. Armando Solé" wrote: >> On 08/0

Re: [Numpy-discussion] f2py : NotImplementedError: Only MS compiler supported with gfortran on win64

2011-09-09 Thread Jim Vickroy
On 9/9/2011 1:14 PM, Christoph Gohlke wrote: > > On 9/9/2011 11:43 AM, Jim Vickroy wrote: >> On 9/9/2011 11:46 AM, Christoph Gohlke wrote: >>> On 9/9/2011 7:22 AM, Jim Vickroy wrote: On 9/8/2011 10:44 AM, "V. Armando Solé" wrote: > On 08/09/2011 16:16, Jim Vickroy wrote: >> On 9/8/2011

Re: [Numpy-discussion] f2py : NotImplementedError: Only MS compiler supported with gfortran on win64

2011-09-09 Thread Christoph Gohlke
On 9/9/2011 11:43 AM, Jim Vickroy wrote: > On 9/9/2011 11:46 AM, Christoph Gohlke wrote: >> >> On 9/9/2011 7:22 AM, Jim Vickroy wrote: >>> On 9/8/2011 10:44 AM, "V. Armando Solé" wrote: On 08/09/2011 16:16, Jim Vickroy wrote: > On 9/8/2011 6:09 AM, "V. Armando Solé" wrote: >> Have yo

Re: [Numpy-discussion] f2py : NotImplementedError: Only MS compiler supported with gfortran on win64

2011-09-09 Thread Jim Vickroy
On 9/9/2011 11:46 AM, Christoph Gohlke wrote: > > On 9/9/2011 7:22 AM, Jim Vickroy wrote: >> On 9/8/2011 10:44 AM, "V. Armando Solé" wrote: >>> On 08/09/2011 16:16, Jim Vickroy wrote: On 9/8/2011 6:09 AM, "V. Armando Solé" wrote: > Have you tried to install Visual Studio 2008 Express editi

Re: [Numpy-discussion] f2py : NotImplementedError: Only MS compiler supported with gfortran on win64

2011-09-09 Thread Christoph Gohlke
On 9/9/2011 7:22 AM, Jim Vickroy wrote: > On 9/8/2011 10:44 AM, "V. Armando Solé" wrote: >> On 08/09/2011 16:16, Jim Vickroy wrote: >>> On 9/8/2011 6:09 AM, "V. Armando Solé" wrote: Have you tried to install Visual Studio 2008 Express edition (plus the windows SDK to be able to compile

Re: [Numpy-discussion] f2py : NotImplementedError: Only MS compiler supported with gfortran on win64

2011-09-09 Thread Jim Vickroy
On 9/8/2011 5:56 AM, Jim Vickroy wrote: > Hello All, I'm attempting to create a python wrapper, for a Fortran > subroutine, using f2py. > > My system details are: > > >>> sys.version '2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 > 32 bit (Intel)]' > >>> sys.getwindowsversion() (5

Re: [Numpy-discussion] f2py : NotImplementedError: Only MS compiler supported with gfortran on win64

2011-09-09 Thread Jim Vickroy
On 9/8/2011 10:44 AM, "V. Armando Solé" wrote: > On 08/09/2011 16:16, Jim Vickroy wrote: >> On 9/8/2011 6:09 AM, "V. Armando Solé" wrote: >>> Have you tried to install Visual Studio 2008 Express edition (plus the >>> windows SDK to be able to compile 64 bit code)? >>> >>> Armando >> Armando, "Visua

Re: [Numpy-discussion] f2py : NotImplementedError: Only MS compiler supported with gfortran on win64

2011-09-08 Thread V. Armando Solé
On 08/09/2011 16:16, Jim Vickroy wrote: > On 9/8/2011 6:09 AM, "V. Armando Solé" wrote: >> Have you tried to install Visual Studio 2008 Express edition (plus the >> windows SDK to be able to compile 64 bit code)? >> >> Armando > Armando, "Visual Studio 2008 Professional" is installed on the compute

Re: [Numpy-discussion] f2py : NotImplementedError: Only MS compiler supported with gfortran on win64

2011-09-08 Thread Jim Vickroy
On 9/8/2011 6:09 AM, "V. Armando Solé" wrote: > Have you tried to install Visual Studio 2008 Express edition (plus the > windows SDK to be able to compile 64 bit code)? > > Armando Armando, "Visual Studio 2008 Professional" is installed on the computer as well as "Intel Visual Fortran Composer XE

Re: [Numpy-discussion] f2py : NotImplementedError: Only MS compiler supported with gfortran on win64

2011-09-08 Thread V. Armando Solé
Have you tried to install Visual Studio 2008 Express edition (plus the windows SDK to be able to compile 64 bit code)? Armando On 08/09/2011 13:56, Jim Vickroy wrote: > Hello All, I'm attempting to create a python wrapper, for a Fortran > subroutine, using f2py. > > My system details are: > >

[Numpy-discussion] f2py : NotImplementedError: Only MS compiler supported with gfortran on win64

2011-09-08 Thread Jim Vickroy
Hello All, I'm attempting to create a python wrapper, for a Fortran subroutine, using f2py. My system details are: >>> sys.version '2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)]' >>> sys.getwindowsversion() (5, 1, 2600, 2, 'Service Pack 3') >>> scipy.__version__ '0.7.

Re: [Numpy-discussion] f2py - undefined symbol: _intel_fast_memset [SEC=UNCLASSIFIED]

2011-08-16 Thread Jin Lee
eem to work fine. Many thanks for your prompt reply. Regards, Jin > -Original Message- > From: numpy-discussion-boun...@scipy.org > [mailto:numpy-discussion-boun...@scipy.org] On Behalf Of > Pearu Peterson > Sent: Tuesday, 16 August 2011 21:45 > To: Discussion of N

Re: [Numpy-discussion] [f2py] How to specify compile options in setup.py

2011-08-16 Thread Pearu Peterson
, On Tue, Aug 16, 2011 at 7:50 PM, Jose Gomez-Dans wrote: > Hi, > > Up to now, I have managed to build Fortran extensions with f2py by ussing > the following command: > $ python setup.py config_fc --fcompiler=gnu95 > --f77flags='-fmy_flags' --f90flags='-fmy_flags' build > > I think that these op

[Numpy-discussion] [f2py] How to specify compile options in setup.py

2011-08-16 Thread Jose Gomez-Dans
Hi, Up to now, I have managed to build Fortran extensions with f2py by ussing the following command: $ python setup.py config_fc --fcompiler=gnu95 --f77flags='-fmy_flags' --f90flags='-fmy_flags' build I think that these options should be able to go in a setup.py file, and use the f2py_options fi

Re: [Numpy-discussion] f2py - undefined symbol: _intel_fast_memset [SEC=UNCLASSIFIED]

2011-08-16 Thread Pearu Peterson
On 08/16/2011 02:32 PM, Jin Lee wrote: > Hello, > > This is my very first attempt at using f2py but I have come across a problem. > If anyone can assist me I would appreciate it very much. > > I have a very simple test Fortran source, sub.f90 which is: > > subroutine sub1(x,y) > implicit non

Re: [Numpy-discussion] f2py - undefined symbol: _intel_fast_memset [SEC=UNCLASSIFIED]

2011-08-16 Thread Jin Lee
Hello, This is my very first attempt at using f2py but I have come across a problem. If anyone can assist me I would appreciate it very much. I have a very simple test Fortran source, sub.f90 which is: subroutine sub1(x,y) implicit none integer, intent(in) :: x integer, intent(out) ::

Re: [Numpy-discussion] f2py and openmp on mac os x with gfortran

2011-07-21 Thread Brandt Belson
Hi all, As Juan said, I didn't include the -lgomp flag for f2py. Once I use that, the f2py module works with openMP as expected. Thanks, Brandt > > Message: 1 > Date: Thu, 21 Jul 2011 11:34:13 +0200 > From: Juan > Subject: Re: [Numpy-discussion] f2py and ope

Re: [Numpy-discussion] f2py and openmp on mac os x with gfortran

2011-07-21 Thread Juan
Hi Brandt, I am on linux and see the same problem. It is solved (at least here) if you add at the end the library libgomp, i.e: f2py -c -m play play.f90 --fcompiler=gfortran --f90flags="-fopenmp" -lgomp Hope it helps, Juan > Hello, > I'm struggling to create openmp subroutines. I've simplifie

  1   2   3   4   >