Re: [Numpy-discussion] Updating Packages in 2.5 (win/numpy) and Related Matters

2010-02-18 Thread Wayne Watson
On 2/17/2010 10:00 PM, Scott Sinclair wrote: >> On 18 February 2010 05:30, Wayne Watson wrote: >> ... >> >> I'm on win7's Add/Remove numpy. No scipy. I just checked the version via >> import and it's 0.6.0. >> > You can download the latest NumPy and SciPy installers from: > > http:/

Re: [Numpy-discussion] ABI changes complete in trunk

2010-02-18 Thread David Cournapeau
Hi Travis, On Wed, Feb 17, 2010 at 4:13 AM, Travis Oliphant wrote: > > I've made the ABI changes I think are needed in the SVN trunk.     Please > feel free to speak up if you have concerns or problems (and if you want to > change white-space, just do it...). Great, thanks for the effort. Just a

Re: [Numpy-discussion] Calling routines from a Fortran library using python

2010-02-18 Thread David Cournapeau
Dag Sverre Seljebotn wrote: > Well, I think one can make a static executable with C or Cython and > embed the Python interpreter. Yes, it is possible, but I think it is fair to say that if you don't know how to write a C extension, statically build numpy into python would be daunting :) Davi

[Numpy-discussion] AUTO: Jon K Peck is out of the office (returning 02/21/2010)

2010-02-18 Thread Jon K Peck
I am out of the office until 02/21/2010. I will be traveling through Sunday, Feb 21 and will be delayed responding to your email. I will have periodic email access. Note: This is an automated response to your message "NumPy-Discussion Digest, Vol 41, Issue 87" sent on 2/18/10 11:00:03. This

Re: [Numpy-discussion] Numpy headers

2010-02-18 Thread Robert Kern
On Thu, Feb 18, 2010 at 12:29, Edward Shishkin wrote: > Hello everyone. > > Afer installing numpy (under linux) I have got a number of header files: > > /usr/lib/python2.5/site-packages/numpy/f2py/src/fortranobject.h > /usr/lib/python2.5/site-packages/numpy/numarray/numpy/cfunc.h > /usr/lib/python

[Numpy-discussion] Numpy headers

2010-02-18 Thread Edward Shishkin
Hello everyone. Afer installing numpy (under linux) I have got a number of header files: /usr/lib/python2.5/site-packages/numpy/f2py/src/fortranobject.h /usr/lib/python2.5/site-packages/numpy/numarray/numpy/cfunc.h /usr/lib/python2.5/site-packages/numpy/numarray/numpy/numcomplex.h /usr/lib/python

Re: [Numpy-discussion] Calling routines from a Fortran library using python

2010-02-18 Thread Matthieu Brucher
2010/2/18 Christopher Barker : > Dag Sverre Seljebotn wrote: >> If it is not compiled with -fPIC, you can't statically link it into any >> shared library, it has to be statically linked into the final executable >> (so the standard /usr/bin/python will never work). > > Shows you what I (don't) know

Re: [Numpy-discussion] Calling routines from a Fortran library using python

2010-02-18 Thread Christopher Barker
Dag Sverre Seljebotn wrote: > If it is not compiled with -fPIC, you can't statically link it into any > shared library, it has to be statically linked into the final executable > (so the standard /usr/bin/python will never work). Shows you what I (don't) know! The joys of closed-source software

Re: [Numpy-discussion] Calling routines from a Fortran library using python

2010-02-18 Thread Dag Sverre Seljebotn
Christopher Barker wrote: > Matthieu Brucher wrote: > >> If it is not the >> case, you will not be able to compile it as a shared library and thus >> not be able to use it from Python :| >> > > maybe not directly with ctypes, but you should be able to call it from > Cython (or SWIG, or cu

Re: [Numpy-discussion] Calling routines from a Fortran library using python

2010-02-18 Thread Christopher Barker
Matthieu Brucher wrote: > If it is not the > case, you will not be able to compile it as a shared library and thus > not be able to use it from Python :| maybe not directly with ctypes, but you should be able to call it from Cython (or SWIG, or custom C code), and statically link it. What about

Re: [Numpy-discussion] Accessing fields of the object stored in numpy array

2010-02-18 Thread Vishal Rana
Thanks Friedrich it helped. On Thu, Feb 18, 2010 at 2:45 AM, Friedrich Romstedt < friedrichromst...@gmail.com> wrote: > Hello Vishal, > > 2010/2/18 Vishal Rana : > > > a = np.array([dt.datetime(2010, 2, 17), dt.datetime(2010, 2, 16), > > dt.datetime(2010, 2, 15)]) > > b = np.array([dt.datetime(20

Re: [Numpy-discussion] Calling routines from a Fortran library using python

2010-02-18 Thread Dag Sverre Seljebotn
Nils Wagner wrote: > On Thu, 18 Feb 2010 15:32:12 +0100 > Dag Sverre Seljebotn > wrote: > >> David Cournapeau wrote: >> >>> On Thu, Feb 18, 2010 at 10:22 PM, Nils Wagner >>> wrote: >>> >>> On Thu, 18 Feb 2010 11:55:07 +0100 Matthieu Brucher wrote:

Re: [Numpy-discussion] Calling routines from a Fortran library using python

2010-02-18 Thread Nils Wagner
On Thu, 18 Feb 2010 15:32:12 +0100 Dag Sverre Seljebotn wrote: > David Cournapeau wrote: >> On Thu, Feb 18, 2010 at 10:22 PM, Nils Wagner >> wrote: >> >>> On Thu, 18 Feb 2010 11:55:07 +0100 >>> Matthieu Brucher wrote: >>> > Ok I have extracted the *.o files from the static >

Re: [Numpy-discussion] Calling routines from a Fortran library using python

2010-02-18 Thread Dag Sverre Seljebotn
David Cournapeau wrote: > On Thu, Feb 18, 2010 at 10:22 PM, Nils Wagner > wrote: > >> On Thu, 18 Feb 2010 11:55:07 +0100 >> Matthieu Brucher wrote: >> Ok I have extracted the *.o files from the static library. Applying the file command to the object files yields

Re: [Numpy-discussion] Calling routines from a Fortran library using python

2010-02-18 Thread David Cournapeau
On Thu, Feb 18, 2010 at 10:22 PM, Nils Wagner wrote: > On Thu, 18 Feb 2010 11:55:07 +0100 >  Matthieu Brucher wrote: >>> Ok I have extracted the *.o files from the static >>>library. >>> >>> Applying the file command to the object files yields >>> >>> ELF 64-bit LSB relocatable, AMD x86-64, versi

Re: [Numpy-discussion] Calling routines from a Fortran library using python

2010-02-18 Thread Nils Wagner
On Thu, 18 Feb 2010 11:55:07 +0100 Matthieu Brucher wrote: >> Ok I have extracted the *.o files from the static >>library. >> >> Applying the file command to the object files yields >> >> ELF 64-bit LSB relocatable, AMD x86-64, version 1 >>(SYSV), >> not stripped >> >> What's that supposed to

Re: [Numpy-discussion] Updating Packages in 2.5 (win/numpy) and Related Matters

2010-02-18 Thread Alan G Isaac
Wayne wrote: > I just checked the version via import and it's 0.6.0. Try updating. Also, the SciPy Reference Guide explains how to turn off deprecation warnings. http://docs.scipy.org/doc/scipy/scipy-ref.pdf Alan Isaac ___ NumPy-Discussion mailing list

Re: [Numpy-discussion] Calling routines from a Fortran library using python

2010-02-18 Thread Matthieu Brucher
If Nils has no access to the Fortran interface (and I don't think he has, unless there is some .mod file somewhere?), he shouldn't use f2py. Even if you know that the Fortran routine is named XXX, you don't know how the arguments must be given. Addressing the C interface directly is much safer. Ma

Re: [Numpy-discussion] Calling routines from a Fortran library using python

2010-02-18 Thread George Nurser
I'm suggesting writing a *new* Fortran interface, coupled with f2py. The original library just needs to be linked to the new .so generated by f2py. I am hoping (perhaps optimistically) that can be done in the Fortran compilation... --George. On 18 February 2010 10:56, Matthieu Brucher wrote: > I

Re: [Numpy-discussion] Calling routines from a Fortran library using python

2010-02-18 Thread Matthieu Brucher
If header files are provided, the work done by f2py is almost done. But you don't know the real Fortran interface, so you still have to use ctypes over f2py. Matthieu 2010/2/18 George Nurser : > Hi Nils, > I've not tried it, but you might be able to interface with f2py your > own fortran subrouti

Re: [Numpy-discussion] Calling routines from a Fortran library using python

2010-02-18 Thread Matthieu Brucher
> Ok I have extracted the *.o files from the static library. > > Applying the file command to the object files yields > > ELF 64-bit LSB relocatable, AMD x86-64, version 1 (SYSV), > not stripped > > What's that supposed to mean ? It means that each object file is an object file compiled with -fPIC

Re: [Numpy-discussion] Calling routines from a Fortran library using python

2010-02-18 Thread George Nurser
Hi Nils, I've not tried it, but you might be able to interface with f2py your own fortran subroutine that calls the library. Then issue the f2py command with extra arguments -l -L. See section 5 of http://cens.ioc.ee/projects/f2py2e/usersguide/index.html#command-f2py --George. On 18 February 20

Re: [Numpy-discussion] Calling routines from a Fortran library using python

2010-02-18 Thread Nils Wagner
On Thu, 18 Feb 2010 19:30:10 +0900 David Cournapeau wrote: > Nils Wagner wrote: > >> How do I convert the .a library to a .so library ? > > You first "uncompress" the .a into a temporary >directory, with ar x on > Linux. Then, you group the .o together with gfortran >-shared > $LIST_OF_OBJ

Re: [Numpy-discussion] create dll from numpy code

2010-02-18 Thread markus . proeller
numpy-discussion-boun...@scipy.org schrieb am 17.02.2010 01:43:03: > markus.proel...@ifm.com wrote: > > > > Hello, > > > > is there a possibility to create a dll from a numpy code? > > What do you want to create a dll for ? For distribution purpose, to hide > your code, etc... ? To replace a

Re: [Numpy-discussion] Accessing fields of the object stored in numpy array

2010-02-18 Thread Friedrich Romstedt
Hello Vishal, 2010/2/18 Vishal Rana : > a = np.array([dt.datetime(2010, 2, 17), dt.datetime(2010, 2, 16), > dt.datetime(2010, 2, 15)]) > b = np.array([dt.datetime(2010, 2, 14), dt.datetime(2010, 2, 13), > dt.datetime(2010, 2, 12)]) > c=a-b > c.days (a numpy array of days difference) like: > arra

Re: [Numpy-discussion] Calling routines from a Fortran library using python

2010-02-18 Thread Nils Wagner
On Thu, 18 Feb 2010 19:21:03 +0900 David Cournapeau wrote: > Nils Wagner wrote: >> On Thu, 18 Feb 2010 18:32:18 +0900 >> David Cournapeau wrote: >>> Nils Wagner wrote: Hi all, I have a static library (*.a) compiled by gfortran but no source files. How can I ca

Re: [Numpy-discussion] Calling routines from a Fortran library using python

2010-02-18 Thread David Cournapeau
Nils Wagner wrote: > How do I convert the .a library to a .so library ? You first "uncompress" the .a into a temporary directory, with ar x on Linux. Then, you group the .o together with gfortran -shared $LIST_OF_OBJECT + a few options. You can also look at how Atlas does it in its makefile.

Re: [Numpy-discussion] Calling routines from a Fortran library using python

2010-02-18 Thread Nils Wagner
On Thu, 18 Feb 2010 10:15:51 + (UTC) Neil Crighton wrote: > Nils Wagner iam.uni-stuttgart.de> writes: > >> Hi David, >> >> you are right. It's a proprietary library. >> I found a header file (*.h) including prototype >> declarations of externally callable procedures. >> >> How can I pro

Re: [Numpy-discussion] Calling routines from a Fortran library using python

2010-02-18 Thread Matthieu Brucher
> You may have to convert the .a library to a .so library. And this is where I hope that the library is compiled with fPIC (which is generally not the case for static libraries). If it is not the case, you will not be able to compile it as a shared library and thus not be able to use it from Pytho

Re: [Numpy-discussion] Calling routines from a Fortran library using python

2010-02-18 Thread David Cournapeau
Nils Wagner wrote: > On Thu, 18 Feb 2010 18:32:18 +0900 > David Cournapeau wrote: >> Nils Wagner wrote: >>> Hi all, >>> >>> I have a static library (*.a) compiled by gfortran but >>> no >>> source files. >>> How can I call routines from that library using python ? >> Is there any kind of inte

Re: [Numpy-discussion] Calling routines from a Fortran li brary using python

2010-02-18 Thread Neil Crighton
Nils Wagner iam.uni-stuttgart.de> writes: > Hi David, > > you are right. It's a proprietary library. > I found a header file (*.h) including prototype > declarations of externally callable procedures. > > How can I proceed ? Apparently you can use ctypes to access fortran libraries. See the f

Re: [Numpy-discussion] Calling routines from a Fortran library using python

2010-02-18 Thread Nils Wagner
On Thu, 18 Feb 2010 18:32:18 +0900 David Cournapeau wrote: > Nils Wagner wrote: >> Hi all, >> >> I have a static library (*.a) compiled by gfortran but >>no >> source files. >> How can I call routines from that library using python ? > > Is there any kind of interface (.h, etc...) ? If this

Re: [Numpy-discussion] Calling routines from a Fortran library using python

2010-02-18 Thread David Cournapeau
Nils Wagner wrote: > Hi all, > > I have a static library (*.a) compiled by gfortran but no > source files. > How can I call routines from that library using python ? Is there any kind of interface (.h, etc...) ? If this is a proprietary library, there has to be something so that it can be call

[Numpy-discussion] Calling routines from a Fortran library using python

2010-02-18 Thread Nils Wagner
Hi all, I have a static library (*.a) compiled by gfortran but no source files. How can I call routines from that library using python ? Any pointer would be appreciated. Thanks in advance. Nils ___