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/
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 -----הודעה מקורית----- מאת: numpy-discussion-bounces@scipy.org בשם 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
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*10240000*401.0/812.0,25600000.0,'r') Where cdata is about 70000 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=6000000.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/
On Fri, Oct 24, 2008 at 11:30, frank wang
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.
Can you describe in higher level terms what you are trying to do? I'm having trouble following the code. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
Hi, Bob,
The problem is that I want to resample my data with another sampling rate. the two rates is very close. I use the formula:
s(t)=sum(a_k*sinc(t-kTs)).
the new sampling rate is Ts', so I have
s(nTs')=sum(a_k*sinc(nTs'-kTs)). The sum index k is over the (-P, P), Centered at n. The n is start from zero. THe code is using two for loops and it is slow. The length of s(nTs) is very long, so it takes quite long time to do it.
Thanks
Frank> Date: Sun, 26 Oct 2008 22:45:42 -0500> From: robert.kern@gmail.com> To: numpy-discussion@scipy.org> Subject: Re: [Numpy-discussion] help to speed up the python code> > On Fri, Oct 24, 2008 at 11:30, frank wang
frank wang wrote:
Hi, Bob,
The problem is that I want to resample my data with another sampling rate. the two rates is very close. I use the formula:
s(t)=sum(a_k*sinc(t-kTs)).
the new sampling rate is Ts', so I have s(nTs')=sum(a_k*sinc(nTs'-kTs)). The sum index k is over the (-P, P), Centered at n. The n is start from zero. THe code is using two for loops and it is slow. The length of s(nTs) is very long, so it takes quite long time to do it.
If you want to do high quality resampling, you may want to look at the samplerate scikits. It uses sinc interpolation for resampling (the scikits is just a wrapper around SRC: http://www.mega-nerd.com/SRC/, if you want more details on the implementation) The documentation is really light unfortunately, but there is an example: http://www.ar.media.kyoto-u.ac.jp/members/david/softwares/samplerate/index.h... The implementation of SRC is in C, and you can choose between 3 modes for quality (plus other interpolations like linear, but those are ill suited for anything serious if you can afford the computational cost), cheers, David
frank wang wrote:
Hi, Bob,
The problem is that I want to resample my data with another sampling rate. the two rates is very close. I use the formula:
s(t)=sum(a_k*sinc(t-kTs)).
the new sampling rate is Ts', so I have s(nTs')=sum(a_k*sinc(nTs'-kTs)). The sum index k is over the (-P, P), Centered at n. The n is start from zero. THe code is using two for loops and it is slow. The length of s(nTs) is very long, so it takes quite long time to do it.
Additionally, assuming you still want to do it yourself in python, the above is a convolution, and both numpy and matlab have 'fast' (e.g. implemented in C) implementation of this; see numpy.convolve. You can have much faster speed than O(M * P) where M is the length of the original signal using FFT, but if either the sinc 'filter' or your signal is large, it is more difficult to do it without using large amount of memory (you have to split the input signal, and even the filter impulse response if it is large, and use overlapp-kind of techniques, see http://ccrma.stanford.edu/~jos/sasp/Example_Overlap_Add_Convolution.html for an example in matlab). cheers, David
On Thu, Oct 30, 2008 at 11:44 PM, frank wang
Hi, Bob,
The problem is that I want to resample my data with another sampling rate. the two rates is very close. I use the formula:
s(t)=sum(a_k*sinc(t-kTs)).
the new sampling rate is Ts', so I have s(nTs')=sum(a_k*sinc(nTs'-kTs)). The sum index k is over the (-P, P), Centered at n. The n is start from zero. THe code is using two for loops and it is slow. The length of s(nTs) is very long, so it takes quite long time to do it.
I think you can use some form of chirpz/Bluestein for this. Just think of the data as the Fourier transform of its spectrum. Chuck
My understanding of the root of the problem is that you end up with
doing many evaluations of sinc. If this is so, one suggestion is to go
with pre-computed filters. For example, if you are resampling from 9
points to 10, essentially you're trying to go from a function that is
defined on points 0, 1, 2..., 8 to a function defined on points 0,
0.9, 1.8, 2.7, ... 0.8. If you take point 2.7, it falls in between 2
and 3, and the value for your new function can be approximately
computed as the weighted average: f(2.7) = 0.7*f(3) + 0.3*f(2). This
is equivalent to convolving with a filter [0.3, 0.7]. The only problem
is that the filter will vary from point to point. So, perhaps, you can
pre-compute several filters for each type of new point (there will be
10 point types for this specific case). Your filters would also be
larger in length, so that your interpolation is more precise. Hope
this helps.
On 10/31/08, Charles R Harris
On Thu, Oct 30, 2008 at 11:44 PM, frank wang
wrote: Hi, Bob,
The problem is that I want to resample my data with another sampling rate. the two rates is very close. I use the formula:
s(t)=sum(a_k*sinc(t-kTs)).
the new sampling rate is Ts', so I have s(nTs')=sum(a_k*sinc(nTs'-kTs)). The sum index k is over the (-P, P), Centered at n. The n is start from zero. THe code is using two for loops and it is slow. The length of s(nTs) is very long, so it takes quite long time to do it.
I think you can use some form of chirpz/Bluestein for this. Just think of the data as the Fourier transform of its spectrum.
Chuck
-- Not to laugh, not to lament, not to curse, but to understand. -- Spinoza
participants (7)
-
Charles R Harris
-
Christoph Göbl
-
David Cournapeau
-
frank wang
-
Nadav Horesh
-
Robert Kern
-
Yakov Keselman