Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #45287
| 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 | <alok.jadhav@credit-suisse.com> |
| 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" <alok.jadhav@credit-suisse.com> |
| To | <python-list@python.org> |
| 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 <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1661.1368514670.3114.python-list@python.org> (permalink) |
| 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 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
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;i<data.size()-1;i++)
{
//double alpha=1-(2.0/(lag+1)*(time(i)-time(i-1)));
double dt=time(i+1)-time(i);
double alpha=pow(0.13533, dt / lag);
if(alpha>1)
{
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=["<math.h>"],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
<weave: compiling>
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
<module>
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=["<math.h>"],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 "<string>", line 1, in <module>
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
===============================================================================
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
weave and 64 bit issues "Jadhav, Alok" <alok.jadhav@credit-suisse.com> - 2013-05-14 14:54 +0800
csiph-web