[Numpy-discussion] installation problem on Red Hat
dear members, I'm very sorry to bother you with a (hopefully) simple problem... I need pyhton and the numerical package to run another program. I installed Python, it works fine. But I can't install the numpy package. To install the oder Numeric package was no problem, but I need the newer numpy... after python setup.py install I get an error message after sime while: ... compiling C sources C compiler: gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC compile options: '-DNO_ATLAS_INFO=1 -Inumpy/core/include -Ibuild/src.linux-x86_64-2.5/numpy/core/include/numpy -Inumpy/core/src -Inumpy/core/include -I/usr/local/include/python2.5 -c' /usr/local/bin/g77 -g -Wall -g -Wall -shared build/temp.linux-x86_64-2.5/numpy/linalg/lapack_litemodule.o build/temp.linux-x86_64-2.5/numpy/linalg/python_xerbla.o -L/usr/lib -llapack -lblas -lg2c -o build/lib.linux-x86_64-2.5/numpy/linalg/lapack_lite.so /usr/bin/ld: skipping incompatible /usr/lib/liblapack.so when searching for -llapack /usr/bin/ld: skipping incompatible /usr/lib/liblapack.a when searching for -llapack /usr/bin/ld: skipping incompatible /usr/lib/libblas.so when searching for -lblas /usr/bin/ld: skipping incompatible /usr/lib/libblas.a when searching for -lblas /usr/bin/ld: skipping incompatible /usr/lib/libg2c.so when searching for -lg2c /usr/bin/ld: skipping incompatible /usr/lib/libg2c.a when searching for -lg2c /usr/bin/ld: skipping incompatible /usr/lib/libfrtbegin.a when searching for -lfrtbegin /usr/bin/ld: skipping incompatible /usr/lib/libg2c.so when searching for -lg2c /usr/bin/ld: skipping incompatible /usr/lib/libg2c.a when searching for -lg2c /usr/bin/ld: cannot find -lgcc_s collect2: ld returned 1 exit status /usr/bin/ld: skipping incompatible /usr/lib/liblapack.so when searching for -llapack /usr/bin/ld: skipping incompatible /usr/lib/liblapack.a when searching for -llapack /usr/bin/ld: skipping incompatible /usr/lib/libblas.so when searching for -lblas /usr/bin/ld: skipping incompatible /usr/lib/libblas.a when searching for -lblas /usr/bin/ld: skipping incompatible /usr/lib/libg2c.so when searching for -lg2c /usr/bin/ld: skipping incompatible /usr/lib/libg2c.a when searching for -lg2c /usr/bin/ld: skipping incompatible /usr/lib/libfrtbegin.a when searching for -lfrtbegin /usr/bin/ld: skipping incompatible /usr/lib/libg2c.so when searching for -lg2c /usr/bin/ld: skipping incompatible /usr/lib/libg2c.a when searching for -lg2c /usr/bin/ld: cannot find -lgcc_s collect2: ld returned 1 exit status error: Command /usr/local/bin/g77 -g -Wall -g -Wall -shared build/temp.linux-x86_64-2.5/numpy/linalg/lapack_litemodule.o build/temp.linux-x86_64-2.5/numpy/linalg/python_xerbla.o -L/usr/lib -llapack -lblas -lg2c -o build/lib.linux-x86_64-2.5/numpy/linalg/lapack_lite.so failed with exit status 1 ... I don't know, what I can do... On a Suse 10.2 it ran easily, but on the other computer, Red Hat 3.4.3_9, X86_64, gcc 3.4.3 there is always this error message. I read in another forum, that a person solved a similar problem using unsetenv ldflags But - sorry I'm a Newbie in Linux and Python - there the installation was on another platform I think. Anyway, maybe it's a linking problem? thank you very much for any thoughts you may waste on my problems... best regards, Christoph _ Hol dir 30 kostenlose Emoticons für deinen Windows Live Messenger http://www.livemessenger-emoticons.com/funfamily/de-at/ ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] installation problem on Red Hat
It could be a version mismatch between two gcc (and the corresponding libraries) versions: you surly have gcc at /usr/bin, but the fortran compiler you use (g77) is as /usr/local/bin. Nadav -הודעה מקורית- מאת: [EMAIL PROTECTED] בשם Christoph G?bl נשלח: ו 24-אוקטובר-08 11:49 אל: numpy-discussion@scipy.org נושא: [Numpy-discussion] installation problem on Red Hat dear members, I'm very sorry to bother you with a (hopefully) simple problem... I need pyhton and the numerical package to run another program. I installed Python, it works fine. But I can't install the numpy package. To install the oder Numeric package was no problem, but I need the newer numpy... after python setup.py install I get an error message after sime while: ... compiling C sources C compiler: gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC compile options: '-DNO_ATLAS_INFO=1 -Inumpy/core/include -Ibuild/src.linux-x86_64-2.5/numpy/core/include/numpy -Inumpy/core/src -Inumpy/core/include -I/usr/local/include/python2.5 -c' /usr/local/bin/g77 -g -Wall -g -Wall -shared build/temp.linux-x86_64-2.5/numpy/linalg/lapack_litemodule.o build/temp.linux-x86_64-2.5/numpy/linalg/python_xerbla.o -L/usr/lib -llapack -lblas -lg2c -o build/lib.linux-x86_64-2.5/numpy/linalg/lapack_lite.so /usr/bin/ld: skipping incompatible /usr/lib/liblapack.so when searching for -llapack /usr/bin/ld: skipping incompatible /usr/lib/liblapack.a when searching for -llapack /usr/bin/ld: skipping incompatible /usr/lib/libblas.so when searching for -lblas /usr/bin/ld: skipping incompatible /usr/lib/libblas.a when searching for -lblas /usr/bin/ld: skipping incompatible /usr/lib/libg2c.so when searching for -lg2c /usr/bin/ld: skipping incompatible /usr/lib/libg2c.a when searching for -lg2c /usr/bin/ld: skipping incompatible /usr/lib/libfrtbegin.a when searching for -lfrtbegin /usr/bin/ld: skipping incompatible /usr/lib/libg2c.so when searching for -lg2c /usr/bin/ld: skipping incompatible /usr/lib/libg2c.a when searching for -lg2c /usr/bin/ld: cannot find -lgcc_s collect2: ld returned 1 exit status /usr/bin/ld: skipping incompatible /usr/lib/liblapack.so when searching for -llapack /usr/bin/ld: skipping incompatible /usr/lib/liblapack.a when searching for -llapack /usr/bin/ld: skipping incompatible /usr/lib/libblas.so when searching for -lblas /usr/bin/ld: skipping incompatible /usr/lib/libblas.a when searching for -lblas /usr/bin/ld: skipping incompatible /usr/lib/libg2c.so when searching for -lg2c /usr/bin/ld: skipping incompatible /usr/lib/libg2c.a when searching for -lg2c /usr/bin/ld: skipping incompatible /usr/lib/libfrtbegin.a when searching for -lfrtbegin /usr/bin/ld: skipping incompatible /usr/lib/libg2c.so when searching for -lg2c /usr/bin/ld: skipping incompatible /usr/lib/libg2c.a when searching for -lg2c /usr/bin/ld: cannot find -lgcc_s collect2: ld returned 1 exit status error: Command /usr/local/bin/g77 -g -Wall -g -Wall -shared build/temp.linux-x86_64-2.5/numpy/linalg/lapack_litemodule.o build/temp.linux-x86_64-2.5/numpy/linalg/python_xerbla.o -L/usr/lib -llapack -lblas -lg2c -o build/lib.linux-x86_64-2.5/numpy/linalg/lapack_lite.so failed with exit status 1 ... I don't know, what I can do... On a Suse 10.2 it ran easily, but on the other computer, Red Hat 3.4.3_9, X86_64, gcc 3.4.3 there is always this error message. I read in another forum, that a person solved a similar problem using unsetenv ldflags But - sorry I'm a Newbie in Linux and Python - there the installation was on another platform I think. Anyway, maybe it's a linking problem? thank you very much for any thoughts you may waste on my problems... best regards, Christoph _ Hol dir 30 kostenlose Emoticons f?r deinen Windows Live Messenger http://www.livemessenger-emoticons.com/funfamily/de-at/ ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion winmail.dat___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] help to speed up the python code
Hi, I have to send this request second time since my first message contains the attached data file which is too big and was blocked by the system. So this time I will not attach the data file. I have converted a matlab function to python using numpy. both matlab and python run slow. I know that numpy has a lot of features, so I hope some experts can help me to speed up the code. Here is how I run the code: upsample.upsample(cdata,4*1024*401.0/812.0,2560.0,'r') Where cdata is about 7 complex data. Thanks Frank from numpy import zeros,ceil,pi,arange,concatenate,sincfrom pylab import plot,clf,show,figure, psd, grid,xlabel, figureimport pdbdef upsample(input,Fs_old,Fsamp,filt_type): Perform resampling the input data from rate Fs to Fsamp Note:y=zeros((N)) shape is (N,). y=zeros((N,1)) shape is (N,1). Example of how to read a two columns floating data file created by Matlab. d=fromfile(filename,dtype='float',count=-1,sep=' ') x=len(d) data=d.reshape([x/2,2]) Ts=1.0/Fs_old Tsamp=1.0/Fsamp Fw=600.0 L=len(input) N=ceil(Fsamp/Fs_old*L) y=zeros((N),dtype='float64') C=pi*Fw t0=arange(0,Ts,Tsamp) #print t0 P = 16 input=concatenate((zeros((P)),input,zeros((P))),1) #print input out = 0 for mm in arange(P+1): tt=t0-mm*Ts out=out+input[P+mm]*sinc(Fw*tt) #print tt #print out\n #print out y[0:len(t0)]=out #print y B=len(t0) for m in arange(P+2,L+P+1): delta=Tsamp-(Ts-t0[-1]) t1=arange(delta,Ts,Tsamp) out=0 for mm in arange(-P,P+1): tt=(m-1-P)*Ts+t1-(mm+m-(P+2)+1)*Ts out=out+input[m+mm-1]*sinc(Fw*tt) y[B:B+len(t1)]=out t0=t1 B=B+len(t1) clf() figure(4) psd(y,256,Fs=25.6) #show() _ You live life beyond your PC. So now Windows goes beyond your PC. http://clk.atdmt.com/MRT/go/115298556/direct/01/___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] creating a Numeric array from a numpy array LEAKS memory
Dear numpy users, I need to pass a Numeric array to some oldie code from a numpy array. I decided to go like this: for i in range(BIGNUMER): my_numpy_array=grabArray(i) na=Numeric.array( my_numpy_array, Numeric.Float) oldie_code(na) The constructor line: na=Numeric.array( my_numpy_array, Numeric.Float) does leak memory. Is there a way to pass the Numeric array to oldie_code without the leaks? Regards, -- Jose M. Borreguero Postdoctoral Associate Oak Ridge National Laboratory P.O. Box 2008, M.S. 6164 Oak Ridge, TN 37831 phone: 865-241-3071 fax: 865-576-5491 Email: [EMAIL PROTECTED] ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] creating a Numeric array from a numpy array LEAKS memory
Jose Borreguero wrote: Dear numpy users, I need to pass a Numeric array to some oldie code from a numpy array. I decided to go like this: for i in range(BIGNUMER): my_numpy_array=grabArray(i) na=Numeric.array( my_numpy_array, Numeric.Float) oldie_code(na) The constructor line: na=Numeric.array( my_numpy_array, Numeric.Float) does leak memory. Is there a way to pass the Numeric array to oldie_code without the leaks? This should work without memory leaks, but there may be a bug in NumPy or Numeric. Which version of Numeric and NumPy do you have? -Travis ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] creating a Numeric array from a numpy array LEAKS memory
numpy 1.1.0 (from /usr/lib/python2.4/site-packages/numpy/version.py) Numeric 24.2 (from /usr/lib/python2.4/site-packages/Numeric/numeric_version.py) I also tried with an intermediate list, but got the same result: *mylist=list(my_numpy_array) na=Numeric.array( mylist, Numeric.Float)* I don't have memory leaks if I use something like: *mylist=[0.0]*BIGNUMBER* *na=Numeric.array( mylist, Numeric.Float)* -Jose On Fri, Oct 24, 2008 at 1:54 PM, Travis E. Oliphant [EMAIL PROTECTED]wrote: Jose Borreguero wrote: Dear numpy users, I need to pass a Numeric array to some oldie code from a numpy array. I decided to go like this: for i in range(BIGNUMER): my_numpy_array=grabArray(i) na=Numeric.array( my_numpy_array, Numeric.Float) oldie_code(na) The constructor line: na=Numeric.array( my_numpy_array, Numeric.Float) does leak memory. Is there a way to pass the Numeric array to oldie_code without the leaks? This should work without memory leaks, but there may be a bug in NumPy or Numeric. Which version of Numeric and NumPy do you have? -Travis ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion -- Jose M. Borreguero Postdoctoral Associate Oak Ridge National Laboratory P.O. Box 2008, M.S. 6164 Oak Ridge, TN 37831 phone: 865-241-3071 fax: 865-576-5491 Email: [EMAIL PROTECTED] ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] creating a Numeric array from a numpy array LEAKS memory
My bad. Using the intermediate list does *not* leak. Still, the original problems stays. Can anyone run the following code in their machine and see if they have leaks? Maybe it only happens to me :(* import numpy,Numeric big=1000 na=numpy.array([0.0,]) for i in range(big): Na=Numeric.array(na,Numeric.Float)* -Jose On Fri, Oct 24, 2008 at 2:16 PM, Jose Borreguero [EMAIL PROTECTED]wrote: numpy 1.1.0 (from /usr/lib/python2.4/site-packages/numpy/version.py) Numeric 24.2 (from /usr/lib/python2.4/site-packages/Numeric/numeric_version.py) I also tried with an intermediate list, but got the same result: *mylist=list(my_numpy_array) na=Numeric.array( mylist, Numeric.Float)* I don't have memory leaks if I use something like: *mylist=[0.0]*BIGNUMBER* *na=Numeric.array( mylist, Numeric.Float)* -Jose On Fri, Oct 24, 2008 at 1:54 PM, Travis E. Oliphant [EMAIL PROTECTED] wrote: Jose Borreguero wrote: Dear numpy users, I need to pass a Numeric array to some oldie code from a numpy array. I decided to go like this: for i in range(BIGNUMER): my_numpy_array=grabArray(i) na=Numeric.array( my_numpy_array, Numeric.Float) oldie_code(na) The constructor line: na=Numeric.array( my_numpy_array, Numeric.Float) does leak memory. Is there a way to pass the Numeric array to oldie_code without the leaks? This should work without memory leaks, but there may be a bug in NumPy or Numeric. Which version of Numeric and NumPy do you have? -Travis ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion -- Jose M. Borreguero Postdoctoral Associate Oak Ridge National Laboratory P.O. Box 2008, M.S. 6164 Oak Ridge, TN 37831 phone: 865-241-3071 fax: 865-576-5491 Email: [EMAIL PROTECTED] -- Jose M. Borreguero Postdoctoral Associate Oak Ridge National Laboratory P.O. Box 2008, M.S. 6164 Oak Ridge, TN 37831 phone: 865-241-3071 fax: 865-576-5491 Email: [EMAIL PROTECTED] ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] creating a Numeric array from a numpy array LEAKS memory
Fri, 24 Oct 2008 14:39:59 -0400, Jose Borreguero wrote: My bad. Using the intermediate list does *not* leak. Still, the original problems stays. Can anyone run the following code in their machine and see if they have leaks? Maybe it only happens to me :(* import numpy,Numeric big=1000 na=numpy.array([0.0,]) for i in range(big): Na=Numeric.array(na,Numeric.Float)* Yep, leaks also here: (Numeric 24.2, numpy 1.2.0) import sys, numpy, Numeric na = numpy.array([0.0]) for i in xrange(100): foo = Numeric.array(na, Numeric.Float) print sys.getrefcount(na) The getrefcount prints 102, so it seems like there's a refcount error somewhere. But na = numpy.array([0.0]) for i in xrange(100): foo = numpy.array(na, numpy.float_) print sys.getrefcount(na) refcounts correctly. -- Pauli Virtanen ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] creating a Numeric array from a numpy array LEAKS memory
On Fri, Oct 24, 2008 at 7:52 PM, Pauli Virtanen [EMAIL PROTECTED] wrote: Yep, leaks also here: (Numeric 24.2, numpy 1.2.0) import sys, numpy, Numeric na = numpy.array([0.0]) for i in xrange(100): foo = Numeric.array(na, Numeric.Float) print sys.getrefcount(na) The getrefcount prints 102, so it seems like there's a refcount error somewhere. Same leak here using Numeric 24.2 and numpy 1.0.1 on Linux. But na = numpy.array([0.0]) for i in xrange(100): foo = numpy.array(na, numpy.float_) print sys.getrefcount(na) refcounts correctly. Also fine. And for the record using the intermediate list also works for me: import sys, numpy, Numeric na = numpy.array([0.0]) na_list = list(na) for i in xrange(100): foo = Numeric.array(na_list, Numeric.Float) print sys.getrefcount(na) Peter ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] help vectorizing something
Hi I have 2 vectors A and B. For each value in A I want to find the location in B of the same value. Both A and B have unique elements. Of course I could something like For each index of A: v =A[index] location = numpy.where(B == v) But I have very large lists and it will take too long. Thanks to any one of you vectorization gurus that has any ideas. Mathew ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] help vectorizing something
On Fri, Oct 24, 2008 at 3:48 PM, Mathew Yeates [EMAIL PROTECTED] wrote: Hi I have 2 vectors A and B. For each value in A I want to find the location in B of the same value. Both A and B have unique elements. Of course I could something like For each index of A: v =A[index] location = numpy.where(B == v) But I have very large lists and it will take too long. In [1]: A = array([1,2,3]) In [2]: B = array([5,1,3,0,2,4]) In [3]: i = B.argsort() In [4]: Bsorted = B[i] In [5]: indices = i[searchsorted(Bsorted,A)] In [6]: indices Out[6]: array([1, 4, 2]) Chuck ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] help vectorizing something
h. I don't understand the result. If a=array([ 1, 2, 3, 7, 10]) and b=array([ 1, 2, 3, 8, 10]) I want to get the result [0,1,2,4] but[searchsorted(a,b) produces [0,1,2,4,4] ?? and searchsorted(b,a) produces [0,1,2,3,4] ?? Mathew On Fri, Oct 24, 2008 at 3:12 PM, Charles R Harris [EMAIL PROTECTED] wrote: On Fri, Oct 24, 2008 at 3:48 PM, Mathew Yeates [EMAIL PROTECTED]wrote: Hi I have 2 vectors A and B. For each value in A I want to find the location in B of the same value. Both A and B have unique elements. Of course I could something like For each index of A: v =A[index] location = numpy.where(B == v) But I have very large lists and it will take too long. In [1]: A = array([1,2,3]) In [2]: B = array([5,1,3,0,2,4]) In [3]: i = B.argsort() In [4]: Bsorted = B[i] In [5]: indices = i[searchsorted(Bsorted,A)] In [6]: indices Out[6]: array([1, 4, 2]) Chuck ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] help vectorizing something
On Fri, Oct 24, 2008 at 4:23 PM, Mathew Yeates [EMAIL PROTECTED] wrote: h. I don't understand the result. If a=array([ 1, 2, 3, 7, 10]) and b=array([ 1, 2, 3, 8, 10]) I want to get the result [0,1,2,4] but[searchsorted(a,b) produces [0,1,2,4,4] ?? and searchsorted(b,a) produces [0,1,2,3,4] Because b isn't a subset of a. You can get around this by counting the number, i.e., cnt = searchsorted(a,b, side='right') - seachsorted(a, b, side='left') so that In [1]: a = array([ 1, 2, 3, 7, 10]) In [2]: b = array([ 1, 2, 3, 8, 10]) In [3]: il = searchsorted(a, b, side='left') In [4]: ir = searchsorted(a, b, side='right') In [5]: compress(ir - il, il) Out[5]: array([0, 1, 2, 4]) Chuck ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion