Install pyhash on Mac

2012-07-02

由于工作开发环境的依赖,不得已弄了Mac上安装pyhash。

  1. install boost http://www.boost.org/ currently 1.49.0 follow manual http://www.boost.org/doc/libs/1_49_0/more/getting_started/unix-variants.html/ notice

    ./bootstrap.sh --prefix=path/to/installation/prefix
    ./b2 install --prefix=path/to/installation/prefix
    

    record the prefix

  2. http://code.google.com/p/pyfasthash/downloads/list 下载解压源代码包后,尝试python setup.py install,如果有以下报错,则继续执行第三步:

    In file included from src/Hash.cpp:1:
    src/Hash.h:12:28: error: boost/python.hpp: No such file or directory
    src/Hash.h:13:41: error: boost/python/raw_function.hpp: No such file or directory
    In file included from src/Hash.cpp:1:
    
  3. 修改setup.py 在include_dirslibrary_dirs的声明之后添加:

    include_dirs += [
        'path/to/installation/prefix/include',
        ]
    library_dirs += [
         'path/to/installation/prefix/lib',
        ]
    

    之后再执行。

comments powered by Disqus