Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'url:pipermail': 0.05; '"""': 0.07; 'importerror:': 0.07; 'skip:" 60': 0.07; 'skip:\\ 20': 0.07; 'skip:p 60': 0.07; 'suddenly': 0.07; 'string': 0.09; 'exec': 0.09; 'executable': 0.09; 'failed:': 0.09; 'skip:\\ 10': 0.09; 'skip:o 50': 0.09; 'def': 0.12; 'skip:= 70': 0.12; 'times,': 0.14; '"error': 0.16; '(int': 0.16; 'build_ext': 0.16; 'hyperlink': 0.16; 'key?': 0.16; 'numpy': 0.16; 'output?': 0.16; 'skip:4 70': 0.16; 'skip:w 70': 0.16; 'subject:bit': 0.16; 'bit': 0.19; 'everyone,': 0.19; "skip:' 30": 0.19; 'memory': 0.22; 'import': 0.22; 'print': 0.22; 'load': 0.23; 'error': 0.23; 'config': 0.24; 'dll': 0.24; 'skip:c 70': 0.24; 'skip:e 30': 0.24; 'script': 0.25; 'extension': 0.26; 'skip:" 30': 0.26; 'skip:" 40': 0.26; 'specifically': 0.29; 'correct': 0.29; 'skip:- 40': 0.29; 'skip:& 60': 0.30; 'skip:( 20': 0.30; '"",': 0.31; 'skip:& 70': 0.31; "skip:' 40": 0.31; 'skip:d 70': 0.31; 'file': 0.32; 'skip:c 30': 0.32; 'skip:- 30': 0.32; 'running': 0.33; '(most': 0.33; 'sources': 0.33; 'skip:d 20': 0.34; 'problem': 0.35; 'skip:- 50': 0.35; 'something': 0.35; 'but': 0.35; 'building': 0.35; 'there': 0.35; 'url:rec-html40': 0.35; 'c++': 0.36; 'leads': 0.36; 'machine.': 0.36; 'options:': 0.36; 'skip:" 50': 0.36; 'charset :us-ascii': 0.36; 'similar': 0.36; 'url:org': 0.36; 'error.': 0.37; 'url:microsoft': 0.37; 'skip:- 20': 0.37; 'sometimes': 0.38; 'skip:& 10': 0.38; 'url:office': 0.38; 'to:addr:python-list': 0.38; 'files': 0.38; 'skip:- 10': 0.38; 'url:schemas': 0.38; 'url:omml': 0.39; 'url:2004': 0.39; 'recent': 0.39; 'skip:& 20': 0.39; 'moving': 0.39; 'url:12': 0.39; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'skip:x 10': 0.40; 'url:mail': 0.40; 'disclaimer:': 0.60; 'removing': 0.60; 'skip:y 20': 0.60; 'simple': 0.61; 'different': 0.65; '30,': 0.65; 'invalid': 0.68; 'skip:r 40': 0.68; 'skip:r 30': 0.69; 'skip:a 40': 0.72; 'inline': 0.74; 'received:199': 0.74; 'compiling': 0.84; 'average': 0.93; 'catalog': 0.93; 'skip:y 40': 0.93 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CE506F.E10E8A92" Subject: weave and 64 bit issues Date: Tue, 14 May 2013 14:54:25 +0800 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: weave and 64 bit issues Thread-Index: Ac5Qb95E0IbgUKjsTK2WITmNdhFACg== From: "Jadhav, Alok" To: X-OriginalArrivalTime: 14 May 2013 06:54:29.0245 (UTC) FILETIME=[E15662D0:01CE506F] X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 649 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1368514670 news.xs4all.nl 15981 [2001:888:2000:d::a6]:55824 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:45287 ------_=_NextPart_001_01CE506F.E10E8A92 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi everyone, I am facing a strange problem using weave on 64 bit machine. Specifically with weave's inline function. It has something to do with weave's catalog. Similar issues I found in the past (very old) http://mail.scipy.org/pipermail/scipy-dev/2006-June/005908.html http://mail.scipy.org/pipermail/scipy-dev/2005-June/003042.html I have a simple script to calculate moving average using weave's inline function. File mvg.py import numpy as np import scipy.weave as weave import distutils.sysconfig import distutils.dir_util import os distutils.sysconfig._config_vars["LDSHARED"]="-LC:\strawberry64\c\x86_64 -w64-mingw32\lib" def ExpMovAvg(data,time,lag): if (data.size!=time.size): print "error in EMA, data and time have different size" return None result=np.repeat(0.0,data.size) code=""" #line 66 "basics.py" result(0)=data(0); for (int i=0;i1) { alpha=10; } result(i+1)=(1-alpha)*data(i)+alpha*result(i); } """ weave.inline(code,["data","time","lag","result"],type_converters=weave.c onverters.blitz,headers=[""],compiler="gcc",verbose=2) return result file test.py import string import numpy as np import mvg print(mvg.ExpMovAvg(np.array(range(10)),np.array(range(10)),2)) Output: Working output: Y:\STMM\alpha\klse\PROD>c:\python27\python.exe s:\common\tools\python\python-2.7-64bit\test.py [ 0. 0. 0.63212774 1.49679774 2.44701359 3.42869938 4.42196209 5.41948363 6.41857187 7.41823646] Now if I keep running the script multiple times, sometimes I see correct output... but suddenly sometimes I get below error. Y:\STMM\alpha\klse\PROD>c:\python27\python.exe s:\common\tools\python\python-2.7-64bit\test.py repairing catalog by removing key Looking for python27.dll running build_ext running build_src build_src building extension "sc_44f3fe3c65d5c3feecb45d9269ac207f5" sources build_src: building npy-pkg config files Looking for python27.dll customize Mingw32CCompiler customize Mingw32CCompiler using build_ext Looking for python27.dll customize Mingw32CCompiler customize Mingw32CCompiler using build_ext building 'sc_44f3fe3c65d5c3feecb45d9269ac207f5' extension compiling C++ sources C compiler: g++ -g -DDEBUG -DMS_WIN64 -O0 -Wall compile options: '-Ic:\python27\lib\site-packages\scipy\weave -Ic:\python27\lib\site-packages\scipy\weave\scxx -Ic:\python27\lib\site-packages\scipy\weave\blitz -Ic:\python27\lib\site-packages\numpy\core\include -Ic:\python27\include -Ic:\python27\PC -c' g++ -g -DDEBUG -DMS_WIN64 -O0 -Wall -Ic:\python27\lib\site-packages\scipy\weave -Ic:\python27\lib\site-packages\scipy\weave\scxx -Ic:\python27\lib\site-packages\scipy\weave\blitz -Ic:\python27\lib\site-packages\numpy\core\include -Ic:\pytho n27\include -Ic:\python27\PC -c c:\users\ajadhav2\appdata\local\temp\ajadhav2\python27_compiled\sc_44f3f e3c65d5c3feecb45d9269ac207f5.cpp -o c:\users\ajadhav2\ap pdata\local\temp\ajadhav2\python27_intermediate\compiler_2d3e1e2e4de6a91 419d2376b162e5342\Release\users\ajadhav2\appdata\local\temp\ajadhav2\pyt hon27_compiled\s c_44f3fe3c65d5c3feecb45d9269ac207f5.o Found executable C:\strawberry\c\bin\g++.exe g++ -g -DDEBUG -DMS_WIN64 -O0 -Wall -Ic:\python27\lib\site-packages\scipy\weave-Ic:\python27\lib\site-packag es\scipy\weave\scxx -Ic:\python27\lib\site-packages \scipy\weave\blitz -Ic:\python27\lib\site-packages\numpy\core\include -Ic:\python27\include -Ic:\python27\PC -c c:\python27\lib\site-packages\scipy\weave\scxx\w eave_imp.cpp -o c:\users\ajadhav2\appdata\local\temp\ajadhav2\python27_intermediate\comp iler_2d3e1e2e4de6a91419d2376b162e5342\Release\python27\lib\site-packages \scipy\weave\scxx\weave_imp.o g++ -g -shared c:\users\ajadhav2\appdata\local\temp\ajadhav2\python27_intermediate\comp iler_2d3e1e2e4de6a91419d2376b162e5342\Release\users\ajadhav2\appdata\loc a l\temp\ajadhav2\python27_compiled\sc_44f3fe3c65d5c3feecb45d9269ac207f5.o c:\users\ajadhav2\appdata\local\temp\ajadhav2\python27_intermediate\comp iler_2d3e1e2e4d e6a91419d2376b162e5342\Release\python27\lib\site-packages\scipy\weave\sc xx\weave_imp.o -Lc:\python27\libs -Lc:\python27\PCbuild\amd64 -lpython27 -lmsvcr90 -o c: \users\ajadhav2\appdata\local\temp\ajadhav2\python27_compiled\sc_44f3fe3 c65d5c3feecb45d9269ac207f5.pyd running scons Traceback (most recent call last): File "s:\common\tools\python\python-2.7-64bit\test.py", line 5, in print(mvg.ExpMovAvg(np.array(range(10)),np.array(range(10)),2)) File "s:\common\tools\python\python-2.7-64bit\mvg.py", line 30, in ExpMovAvg weave.inline(code,["data","time","lag","result"],type_converters=weave.c onve rters.blitz,headers=[""],compiler="gcc",verbose=2) File "c:\python27\lib\site-packages\scipy\weave\inline_tools.py", line 355, in inline **kw) File "c:\python27\lib\site-packages\scipy\weave\inline_tools.py", line 488, in compile_function exec 'import ' + module_name File "", line 1, in ImportError: DLL load failed: Invalid access to memory location. Y:\STMM\alpha\klse\PROD> For everytime there is an error I have one observation, the message has notification "repairing catalog by removing key" which leads to DLL load failed error. Any ideas? - Alok =============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html =============================================================================== ------_=_NextPart_001_01CE506F.E10E8A92 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable

Hi everyone,

 

I am facing a strange problem using weave on 64 bit machine. Spe= cifically with weave’s inline function. It has something to do with w= eave’s catalog.

 

Similar issue= s I found in the past (very old)

=  

ht= tp://mail.scipy.org/pipermail/scipy-dev/2006-June/005908.html

http://mail.scipy.org/pipermail/scipy-dev/2005-June/003042.html=

 

 

I have a sim= ple script to calculate moving average using weave’s inline function.=

 

 

 =

File mvg.py

<= span style=3D'font-family:"Arial","sans-serif"'> 

impo= rt numpy as np

import scipy.weave as weave

= import distutils.sysconfig

import distutils.dir_util

import os

 

distutils.sys= config._config_vars["LDSHARED"]=3D"-LC:\strawberry64\c\x86_6= 4-w64-mingw32\lib"

 

 <= /o:p>

def ExpMovAvg(data,time,lag):

   = if (data.size!=3Dtime.size):

     = ;   print "error in EMA, data and time have different size&q= uot;

        return None=

    result=3Dnp.repeat(0.0,data.size)<= /o:p>

    code=3D"""

&nb= sp;   #line 66 "basics.py"

  =   result(0)=3Ddata(0);

    for (int i= =3D0;i<data.size()-1;i++)

    {

        //double alpha=3D1-(2.0/(= lag+1)*(time(i)-time(i-1)));

     =    double dt=3Dtime(i+1)-time(i);

  &= nbsp;     double alpha=3Dpow(0.13533, dt / lag);

        if(alpha>1)

        {

=

 = ;           alpha=3D10;

        }

        result(i+1)=3D(1-alpha)*data(i)= +alpha*result(i);

    }

&nbs= p;   """

    weave.= inline(code,["data","time","lag","result= "],type_converters=3Dweave.converters.blitz,headers=3D["<math.= h>"],compiler=3D"gcc",verbose=3D2)

<= p class=3DMsoNormal> =    return result

 

&nbs= p;

file test.py

 =

i= mport string

import numpy as np

import mvg<= o:p>

 

print(mvg.ExpMovAvg(np.array(range(1= 0)),np.array(range(10)),2))

 

&nb= sp;

 

Output:

 

 

Working output:

=  

Y:\STMM\alpha\klse\PROD>c:\python27\python.exe s:= \common\tools\python\python-2.7-64bit\test.py

[ 0. &nb= sp;        0.    &nb= sp;     0.63212774  1.49679774  2.44701359&nb= sp; 3.42869938  4.42196209  5.41948363  6.41857187  7.4= 1823646]

 

<= span style=3D'font-family:"Arial","sans-serif"'>Now if I keep running the s= cript multiple times, sometimes I see correct output… but suddenly so= metimes I get below error.

 

Y:\STMM\a= lpha\klse\PROD>c:\python27\python.exe s:\common\tools\python\python-2.7-= 64bit\test.py

repairing catalog by removing key<= /span>

<weave: compiling>

Looking for python27.dll=

running build_ext

running build_src<= /span>

build_src

building extension "sc_44f3fe3c65d5c3fe= ecb45d9269ac207f5" sources

<= span style=3D'font-family:"Arial","sans-serif"'>build_src: building npy-pkg= config files

Looking for python27.dll

cust= omize Mingw32CCompiler

customize Mingw32CCompiler using bui= ld_ext

Looking for python27.dll

customize M= ingw32CCompiler

customize Mingw32CCompiler using build_ext<= o:p>

building 'sc_44f3fe3c65d5c3feecb45d9269ac207f5' extension

compiling C++ sources

C compiler: g++ -g -DD= EBUG -DMS_WIN64 -O0 -Wall

 

compile op= tions: '-Ic:\python27\lib\site-packages\scipy\weave -Ic:\python27\lib\site-= packages\scipy\weave\scxx -Ic:\python27\lib\site-packages\scipy\weave\blitz=

-Ic:\python27\lib\site-packages\numpy\core\include -Ic:\p= ython27\include -Ic:\python27\PC -c'

 g++ -g -DDEBUG = -DMS_WIN64 -O0 -Wall -Ic:\python27\lib\site-packages\scipy\weave=

-Ic:\python27\lib\site-packages\scipy\weave\scxx -Ic:\python27\lib\si= te-packages\scipy\weave\blitz -Ic:\python27\lib\site-packages\numpy\core\in= clude -Ic:\pytho

n27\include -Ic:\python27\PC -c c:\users\a= jadhav2\appdata\local\temp\ajadhav2\python27_compiled\sc_44f3fe3c65d5c3feec= b45d9269ac207f5.cpp -o c:\users\ajadhav2\ap

pdata\local\t= emp\ajadhav2\python27_intermediate\compiler_2d3e1e2e4de6a91419d2376b162e534= 2\Release\users\ajadhav2\appdata\local\temp\ajadhav2\python27_compiled\s

c_44f3fe3c65d5c3feecb45d9269ac207f5.o

Found e= xecutable C:\strawberry\c\bin\g++.exe

g++ -g -DDEBUG -DMS_W= IN64 -O0 -Wall -Ic:\python27\lib\site-packages\scipy\weave-Ic:\python27\lib= \site-packages\scipy\weave\scxx -Ic:\python27\lib\site-packages<= /span>

\scipy\weave\blitz -Ic:\python27\lib\site-packages\numpy\core\include = -Ic:\python27\include -Ic:\python27\PC -c c:\python27\lib\site-packages\sci= py\weave\scxx\w

eave_imp.cpp -o c:\users\ajadhav2\appdata\l= ocal\temp\ajadhav2\python27_intermediate\compiler_2d3e1e2e4de6a91419d2376b1= 62e5342\Release\python27\lib\site-packages

\scipy\weave\scx= x\weave_imp.o

g++ -g -shared c:\users\ajadhav2\appdata\loca= l\temp\ajadhav2\python27_intermediate\compiler_2d3e1e2e4de6a91419d2376b162e= 5342\Release\users\ajadhav2\appdata\loca

l\temp\ajadhav2\py= thon27_compiled\sc_44f3fe3c65d5c3feecb45d9269ac207f5.o c:\users\ajadhav2\ap= pdata\local\temp\ajadhav2\python27_intermediate\compiler_2d3e1e2e4d

e6a91419d2376b162e5342\Release\python27\lib\site-packages\scipy\we= ave\scxx\weave_imp.o -Lc:\python27\libs -Lc:\python27\PCbuild\amd64 -lpytho= n27 -lmsvcr90 -o c:

\users\ajadhav2\appdata\local\temp\aj= adhav2\python27_compiled\sc_44f3fe3c65d5c3feecb45d9269ac207f5.pyd

running scons

Traceback (most recent call last):

  File "s:\common\tools\python\python-2.7-64bit\tes= t.py", line 5, in <module>

    pr= int(mvg.ExpMovAvg(np.array(range(10)),np.array(range(10)),2))

  File "s:\common\tools\python\python-2.7-64bit\mvg.py", = line 30, in ExpMovAvg

    weave.inline(code,= ["data","time","lag","result"],type= _converters=3Dweave.conve

rters.blitz,headers=3D["<= math.h>"],compiler=3D"gcc",verbose=3D2)=

&= nbsp; File "c:\python27\lib\site-packages\scipy\weave\inline_tools.py&= quot;, line 355, in

inline

  &= nbsp; **kw)

  File "c:\python27\lib\site-packages= \scipy\weave\inline_tools.py", line 488, in

compile_f= unction

    exec 'import ' + module_name

  File "<string>", line 1, in <module&= gt;

ImportError: DLL load failed: Invalid access to memory = location.

 

= Y:\STMM\alpha\klse\PROD>= ;

 

 

 =

For everytime there is an error I have one observation, the mes= sage has notification

 

“repair= ing catalog by removing key”  which leads to DLL load failed err= or.

 

 

Any ideas= ?

 

-

Alok

 

 

 


=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Please access the attached= hyperlink for an important electronic communications disclaimer:
http:/= /www.credit-suisse.com/legal/en/disclaimer_email_ib.html
=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=


------_=_NextPart_001_01CE506F.E10E8A92--