首页 > 解决方案 > 在 Windows 64x 机器上从源代码构建 numba

问题描述

我正在尝试从其源代码构建构建 NUMBA 包以从中生成一个轮子。我知道 Windows 有一个轮子,但我想在我的本地 Windows 64X 机器上做一些测试。我已经安装了 NUMPY、LLVMLITE 依赖项,并且我使用的是 MinGW c++ 编译器而不是 Visual Studio。我收到以下错误,我在这里缺少什么?

py : C:\Workspace\Python_Runtime\Python\lib\site-packages\setuptools\distutils_patch.py:25: 
UserWarning: Distutils was imported before Setuptools. This usage is discouraged and may exhibit undesirable behaviors or errors. Please use Setuptools' objects directly or at least import Setuptools first.In Zeile:1 Zeichen:1
+ py setup.py bdist_wheel 2>&1 > error.txt
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (C:\Workspace\Py...tuptools first.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError

warnings.warn(TBB not found Using OpenMP from: True running bdist_wheel running build got version from file C:\Workspace\Python_Runtime\numba-0.54.1\numba/_version.py {'version': '0.54.1', 'full': '39aef3deb073a67b0bf121e099ecf5b33d799f40'}
running build_py
running build_ext
building 'numba._dispatcher' extension
C compiler: gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes

compile options: '-D__MSVCRT_VERSION__=0x1927 - 
IC:\\Workspace\\Python_Runtime\\Python\\lib\\site-packages\\numpy\\core\\include - 
IC:\Workspace\Python_Runtime\Python\include -IC:\Workspace\Python_Runtime\Python\include -c'
gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x1927 - 
IC:\\Workspace\\Python_Runtime\\Python\\lib\\site-packages\\numpy\\core\\include - 
IC:\Workspace\Python_Runtime\Python\include -IC:\Workspace\Python_Runtime\Python\include -c 
numba/_dispatcher.cpp -o build\temp.win-amd64-3.9\Release\numba\_dispatcher.o
gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x1927 - 
IC:\\Workspace\\Python_Runtime\\Python\\lib\\site-packages\\numpy\\core\\include - 
IC:\Workspace\Python_Runtime\Python\include -IC:\Workspace\Python_Runtime\Python\include -c numba/_hashtable.c -o build\temp.win-amd64-3.9\Release\numba\_hashtable.o
gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x1927 - 
IC:\\Workspace\\Python_Runtime\\Python\\lib\\site-packages\\numpy\\core\\include - 
IC:\Workspace\Python_Runtime\Python\include -IC:\Workspace\Python_Runtime\Python\include -c numba/core/typeconv/typeconv.cpp -o build\temp.win-amd64 3.9\Release\numba\core\typeconv\typeconv.o
gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x1927 - 
IC:\\Workspace\\Python_Runtime\\Python\\lib\\site-packages\\numpy\\core\\include - 
IC:\Workspace\Python_Runtime\Python\include -IC:\Workspace\Python_Runtime\Python\include -c numba/_typeof.c -o build\temp.win-amd64-3.9\Release\numba\_typeof.o
cc1plus.exe: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus.exe: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
numba/_hashtable.c:102:1: warning: '_Numba_hashtable_hash_int' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
_Numba_hashtable_hash_int(const void *key)
^
numba/_hashtable.c:108:1: warning: '_Numba_hashtable_hash_ptr' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
 _Numba_hashtable_hash_ptr(const void *key)
 ^
  numba/_hashtable.c:114:1: warning: '_Numba_hashtable_compare_direct' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
 _Numba_hashtable_compare_direct(const void *key, const _Numba_hashtable_entry_t *entry)
 ^
 numba/_hashtable.c:133:1: warning: '_Numba_hashtable_new_full' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
 _Numba_hashtable_new_full(size_t data_size, size_t init_size,
 ^
  numba/_hashtable.c:178:1: warning: '_Numba_hashtable_new' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
 _Numba_hashtable_new(size_t data_size,
 ^
  numba/_hashtable.c:188:1: warning: '_Numba_hashtable_size' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
 _Numba_hashtable_size(_Numba_hashtable_t *ht)
 ^
 numba/_hashtable.c:259:1: warning: '_Numba_hashtable_get_entry' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
 _Numba_hashtable_get_entry(_Numba_hashtable_t *ht, const void *key)
 ^
 numba/_hashtable.c:312:1: warning: '_Numba_hashtable_set' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
  _Numba_hashtable_set(_Numba_hashtable_t *ht, const void *key,
  ^
 numba/_hashtable.c:354:1: warning: '_Numba_hashtable_get' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
 _Numba_hashtable_get(_Numba_hashtable_t *ht, const void *key, void *data, size_t data_size)
 ^
 numba/_hashtable.c:368:1: warning: '_Numba_hashtable_pop' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
_Numba_hashtable_pop(_Numba_hashtable_t *ht, const void *key, void *data, size_t data_size)
^
numba/_hashtable.c:377:1: warning: '_Numba_hashtable_delete' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
 _Numba_hashtable_delete(_Numba_hashtable_t *ht, const void *key)
 ^
 numba/_hashtable.c:391:1: warning: '_Numba_hashtable_foreach' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
 _Numba_hashtable_foreach(_Numba_hashtable_t *ht,
 ^
 numba/_hashtable.c:451:1: warning: '_Numba_hashtable_clear' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
 _Numba_hashtable_clear(_Numba_hashtable_t *ht)
 ^
 numba/_hashtable.c:470:1: warning: '_Numba_hashtable_destroy' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
 _Numba_hashtable_destroy(_Numba_hashtable_t *ht)
 ^
 numba/_hashtable.c:491:1: warning: '_Numba_hashtable_copy' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
 _Numba_hashtable_copy(_Numba_hashtable_t *src)
 ^
  In file included from C:/Program Files/R/Rtools/mingw_64/x86_64-w64 mingw32/include/c++/cassert:43:0,
             from numba/_dispatcher.cpp:5:
  numba/_dispatcher.cpp: In function 'PyObject* call_cfunc(Dispatcher*, PyObject*, PyObject*, PyObject*, PyObject*)':
  numba/_dispatcher.cpp:383:41: warning: suggest parentheses around comparison in operand of '|' [-Wparentheses]
  assert(PyCFunction_GET_FLAGS(cfunc) == METH_VARARGS | METH_KEYWORDS);
                                     ^
  g++ -g -shared build\temp.win-amd64-3.9\Release\numba\_dispatcher.o build\temp.win-amd64 3.9\Release\numba\_hashtable.o build\temp.win-amd64-3.9\Release\numba\_typeof.o build\temp.win amd64-3.9\Release\numba\core\typeconv\typeconv.o - 
  LC:\\Workspace\\Python_Runtime\\Python\\lib\\site-packages\\numpy\\core\\lib - 
  LC:\Workspace\Python_Runtime\Python\libs -LC:\Workspace\Python_Runtime\Python\PCbuild\amd64 -lnpymath -lpython39 -o build\lib.win-amd64-3.9\numba\_dispatcher.cp39-win_amd64.pyd build\temp.win-amd64-3.9\Release\numba\_typeof.o: In function `typecode_using_fingerprint': C:\Workspace\Python_Runtime\numba-0.54.1/numba/_typeof.c:617: undefined reference to `__imp__Numba_hashtable_get'
 C:\Workspace\Python_Runtime\numba-0.54.1/numba/_typeof.c:639: undefined reference to `__imp__Numba_hashtable_set' build\temp.win-amd64-3.9\Release\numba\_typeof.o: In function `typeof_init':
  C:\Workspace\Python_Runtime\numba-0.54.1/numba/_typeof.c:1115: undefined reference to `__imp__Numba_hashtable_new'
  collect2.exe: error: ld returned 1 exit status
  error: Command "g++ -g -shared build\temp.win-amd64-3.9\Release\numba\_dispatcher.o build\temp.win-amd64-3.9\Release\numba\_hashtable.o build\temp.win-amd64 3.9\Release\numba\_typeof.o build\temp.win-amd64-3.9\Release\numba\core\typeconv\typeconv.o 
  -LC:\\Workspace\\Python_Runtime\\Python\\lib\\site-packages\\numpy\\core\\lib - 
   LC:\Workspace\Python_Runtime\Python\libs -LC:\Workspace\Python_Runtime\Python\PCbuild\amd64 -lnpymath -lpython39 -o build\lib.win-amd64-3.9\numba\_dispatcher.cp39-win_amd64.pyd" failed with 
 exit status 1

标签: python-3.xcompilationnumbabuilding

解决方案


推荐阅读