2014-12-08 70 views
0

我想在我的Mac上安裝pypoker-eval。起初我收到此錯誤:在OS X上構建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 

因此,我安裝撲克-EVAL並設置C_INCLUDE_PATH到/ usr /本地/包括/撲克-EVAL現在包含我安裝了撲克-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 

的想法對下一步該怎麼做。有什麼建議麼?

回答

0

好吧,我已經回答了我自己的問題: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 
相關問題