您可以尝试使用setup.py来构建cython 64位
我使用Anaconda作为python发行版,Microsoft SDK 7的Windopws和MSVC 12.0.
生成文件CL_EXE ="C:Program Files (x86)Microsoft Visual Studio 12.0VCbinamd64cl.exe"
LINK_EXE ="C:Program Files (x86)Microsoft Visual Studio 12.0VCbinamd64link.exe"
CL_FLAGS = /c /nologo /Ox /MD /W3 /GS- /DNDEBUG /O2 /fp:fast
CL_INC = -I. -I"C:Program FilesMicrosoft SDKsWindowsv7.1Include"
-I"C:Program Files (x86)Microsoft Visual Studio 12.0VCinclude" -IC:UsersnameAnaconda2envspy27Libsite-packagesnumpycoreinclude -IC:UsersnameAnaconda2envspy27include -IC:UsersnameAnaconda2envspy27PC
LINK_FLAGS = /DLL /nologo /INCREMENTAL:NO /MACHINE:X64
LINK_LIBPATH ="/LIBPATH:C:Program FilesNVIDIA GPU Computing ToolkitCUDAv7.5libx64"
/LIBPATH:C:UsersnameAnaconda2envspy27libs
/LIBPATH:C:UsersnameAnaconda2envspy27PCbuildamd64
/LIBPATH:C:UsersnameAnaconda2envspy27PCVS9.0amd64
"/LIBPATH:C:Program Files (x86)Microsoft Visual Studio 12.0VClibamd64"
"/LIBPATH:C:Program FilesMicrosoft SDKsWindowsv7.1Libx64"
LINK_LIB = cuda_multiply4D.lib cudart.lib MSVCRT.lib kernel32.lib
LINK_EXPORT = /EXPORT:initmy_cuda
LINK_OBJ = buildtemp.win-amd64-2.7Releasemy_cuda.obj
LINK_OUT ="/OUT:E:my_cuda.pyd"
LINK_OTHER_CONF = /IMPLIB:buildtemp.win-amd64-2.7Releasemy_cuda.lib /MANIFESTFILE:buildtemp.win-amd64-2.7Releasemy_cuda.pyd.manifest
all:
$(CL_EXE) $(CL_FLAGS) $(CL_INC) /Tcmy_cuda.c /Fobuildtemp.win-amd64-2.7Releasemy_cuda.obj
$(LINK_EXE) $(LINK_FLAGS) $(LINK_LIBPATH) $(LINK_LIB) $(LINK_EXPORT) $(LINK_OBJ) $(LINK_OUT) $(LINK_OTHER_CONF)
注:MSVCRT.lib kernel32.lib是可选的,
未定义
用于确定输出位置,文件名及它扩展名的"/OUT:E:my_cuda.pyd"