浙江省高等学校教师教育理论培训

微信搜索“毛凌志岗前心得”小程序

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
  12653 随笔 :: 2 文章 :: 617 评论 :: 608万 阅读
Index of /wp-content/uploads/oldies/download/pytst

Running pytst 1.15 on a 64-bit platform

by Thomas Brox Røst on January 25, 2009
in Python, pytst

Update: The latest version, 1.17, compiles on 64-bit platforms out of the box, so the patch below is no longer necessary.

Nicolas Lehuen’s pytst is a C++ ternary search tree implementation with a Python interface. It’s an excellent tool—and it is also really, really fast.

Unfortunately version 1.15 doesn’t compile on 64-bit platforms, giving the following error messages:

01.pythonTST.h:178: error: cannot convert 'int*' to 'Py_ssize_t*' for argument '3'
02.to 'int PyString_AsStringAndSize(PyObject*, char**, Py_ssize_t*)'
03.tst_wrap.cxx: In function 'PyObject* _wrap__TST_walk__SWIG_1(PyObject*, int, PyO
04.bject**)':
05.tst_wrap.cxx:3175: error: cannot convert 'int*' to 'Py_ssize_t*' for argument '3
06.' to 'int PyString_AsStringAndSize(PyObject*, char**, Py_ssize_t*)'
07.tst_wrap.cxx: In function 'PyObject* _wrap__TST_close_match(PyObject*, PyObject*
08.)':
09.tst_wrap.cxx:3250: error: cannot convert 'int*' to 'Py_ssize_t*' for argument '3
10.' to 'int PyString_AsStringAndSize(PyObject*, char**, Py_ssize_t*)'
11.tst_wrap.cxx: In function 'PyObject* _wrap__TST_prefix_match(PyObject*, PyObject
12.*)':
13.[...and so on...]

Until Nicolas releases an updated version, here is the quick fix:

1.cp pythonTST.h pythonTST.h.orig
2.cp tst_wrap.cxx tst_wrap.cxx.orig
3.sed -r 's/int size/Py_ssize_t size/' < tst_wrap.cxx.orig > tst_wrap.cxx
4.sed -r 's/int length/Py_ssize_t length/' < pythonTST.h.orig > tmpfile
5.sed -r 's/sizeof\(int\)/sizeof(long)/' < tmpfile > pythonTST.h

Run these commands from the pytst source directory and you should be all set. I’m not sure if this a fully satisfactory solution, but at least this will get the test suite running again.




posted on   lexus  阅读(198)  评论(0编辑  收藏  举报
编辑推荐:
· 智能桌面机器人:用.NET IoT库控制舵机并多方法播放表情
· Linux glibc自带哈希表的用例及性能测试
· 深入理解 Mybatis 分库分表执行原理
· 如何打造一个高并发系统?
· .NET Core GC压缩(compact_phase)底层原理浅谈
阅读排行:
· 手把手教你在本地部署DeepSeek R1,搭建web-ui ,建议收藏!
· 新年开篇:在本地部署DeepSeek大模型实现联网增强的AI应用
· Janus Pro:DeepSeek 开源革新,多模态 AI 的未来
· 互联网不景气了那就玩玩嵌入式吧,用纯.NET开发并制作一个智能桌面机器人(三):用.NET IoT库
· 【非技术】说说2024年我都干了些啥
历史上的今天:
2010-10-04 sqlalchemy type &elixir type
2010-10-04 20101004网站部署更新
2010-10-04 vi
2010-10-04 querypath.org
2010-10-04 crawler py
点击右上角即可分享
微信分享提示