繁体   English   中英

在OS X上构建pypoker-eval时出错

[英]Error when building pypoker-eval on OS X

我想在Mac上安装pypoker-eval。 起初,我收到此错误:

Hector:pypoker-eval root# python setup.py install
running install
running build
running build_ext
building '_pokereval_2_7' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DPYTHON_VERSION="2_7" -DVERSION_NAME(w)=w ## 2_7 -Iinclude -I/usr/include/poker-eval -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pypokereval.c -o build/temp.macosx-10.10-intel-2.7/pypokereval.o
pypokereval.c:51:10: fatal error: 'poker_defs.h' file not found
#include "poker_defs.h"
         ^
1 error generated.
error: command 'cc' failed with exit status 1

因此,我安装了poker-eval并将C_INCLUDE_PATH设置为/ usr / local / include / poker-eval,该目录现在包含我安装的poker-eval代码。

现在安装给我这个错误:

Hector:pypoker-eval root# python setup.py install
running install
running build
running build_ext
building '_pokereval_2_7' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DPYTHON_VERSION="2_7" -DVERSION_NAME(w)=w ## 2_7 -Iinclude -I/usr/include/poker-eval -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pypokereval.c -o build/temp.macosx-10.10-intel-2.7/pypokereval.o
pypokereval.c:462:35: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int'
      [-Wshorten-64-to-32]
  valid_cards_size = cards_size = PyList_Size(object);
                                ~ ^~~~~~~~~~~~~~~~~~~
pypokereval.c:484:14: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
      card = PyInt_AsLong(pycard);
           ~ ^~~~~~~~~~~~~~~~~~~~
pypokereval.c:996:18: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int'
      [-Wshorten-64-to-32]
  pockets_size = PyList_Size(pypockets);
               ~ ^~~~~~~~~~~~~~~~~~~~~~
pypokereval.c:1010:43: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        numToDeal[i + 1] = PyList_Size(pypocket) - count;
                         ~ ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
pypokereval.c:1022:43: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
      numToDeal[0] = PyList_Size(pyboard) - count;
                   ~ ~~~~~~~~~~~~~~~~~~~~~^~~~~~~
5 warnings generated.
cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.10-intel-2.7/pypokereval.o -lpoker-eval -o build/lib.macosx-10.10-intel-2.7/_pokereval_2_7.so
ld: library not found for -lpoker-eval
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'cc' failed with exit status 1

想出下一步该怎么做。 有什么建议么?

好的,我已经回答了我自己的问题:LIBRARY_PATH需要设置为/ usr / local / lib。

完成后,我在下面获得了python setup.py install的输出。 该警告似乎还可以,因为python test.py没有产生任何错误。

Hector:pypoker-eval root# python setup.py install
running install
running build
running build_ext
building '_pokereval_2_7' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DPYTHON_VERSION="2_7" -DVERSION_NAME(w)=w ## 2_7 -Iinclude -I/usr/include/poker-eval -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pypokereval.c -o build/temp.macosx-10.10-intel-2.7/pypokereval.o
pypokereval.c:462:35: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int'
      [-Wshorten-64-to-32]
  valid_cards_size = cards_size = PyList_Size(object);
                                ~ ^~~~~~~~~~~~~~~~~~~
pypokereval.c:484:14: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
      card = PyInt_AsLong(pycard);
           ~ ^~~~~~~~~~~~~~~~~~~~
pypokereval.c:996:18: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int'
      [-Wshorten-64-to-32]
  pockets_size = PyList_Size(pypockets);
               ~ ^~~~~~~~~~~~~~~~~~~~~~
pypokereval.c:1010:43: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        numToDeal[i + 1] = PyList_Size(pypocket) - count;
                         ~ ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
pypokereval.c:1022:43: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
      numToDeal[0] = PyList_Size(pyboard) - count;
                   ~ ~~~~~~~~~~~~~~~~~~~~~^~~~~~~
5 warnings generated.
cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.10-intel-2.7/pypokereval.o -lpoker-eval -o build/lib.macosx-10.10-intel-2.7/_pokereval_2_7.so
ld: warning: ignoring file /usr/local/lib/libpoker-eval.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libpoker-eval.dylib
running install_lib
copying build/lib.macosx-10.10-intel-2.7/_pokereval_2_7.so -> /Library/Python/2.7/site-packages
running install_egg_info
Writing /Library/Python/2.7/site-packages/pokereval-1.38-py2.7.egg-info

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM