sru icon indicating copy to clipboard operation
sru copied to clipboard

build error

Open dosxp opened this issue 5 years ago • 3 comments

who can helps?

"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_x86/link.exe" sru_cpu_impl.o /nologo /DLL caffe2.lib _C.lib /LIBPATH:E:\python370\libs /LIBPATH:E:\python370\lib\site-packages\torch\lib /out:sru_cpu_impl.pyd

python37.lib(python37.dll) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86' ninja: build stopped: subcommand failed.

my build.ninja file:

ninja_required_version = 1.3 cxx = c++

cflags = -DTORCH_EXTENSION_NAME=sru_cpu_impl -IE:\python370\lib\site-packages\torch\lib\include -IE:\python370\lib\site-packages\torch\lib\include\TH -IE:\python370\lib\site-packages\torch\lib\include\THC -IE:\python370\Include -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 ldflags = /DLL caffe2.lib _C.lib /LIBPATH:E:\python370\libs /LIBPATH:E:\python370\lib\site-packages\torch\lib

rule compile command = cl /showIncludes $cflags -c $in /Fo$out deps = msvc

rule link command = "C$:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64_x86/link.exe" $in /nologo $ldflags /out:$out

build sru_cpu_impl.o: compile E$:\python370\Lib\site-packages\sru\sru_cpu_impl.cpp

build sru_cpu_impl.pyd: link sru_cpu_impl.o

default sru_cpu_impl.pyd

dosxp avatar Nov 04 '18 14:11 dosxp

It seems a lot people are having issues compiling the cpp code using ninja. This is only needed for inference on CPU. I'll release version that makes this optional..

taolei87 avatar Nov 04 '18 16:11 taolei87

It seems a lot people are having issues compiling the cpp code using ninja. This is only needed for inference on CPU. I'll release version that makes this optional..

thanks for your reply I manually complied sru_cpu_impl.pyd and I can run sru_functional.py without any error.

but when I import sru in other py script, still got error: Traceback (most recent call last): File "E:\python370\Scripts\sru.py", line 3, in from sru import SRU, SRUCell File "E:\python370\Scripts\sru.py", line 3, in from sru import SRU, SRUCell ImportError: cannot import name 'SRU' from 'sru' (E:\python370\Scripts\sru.py)

dosxp avatar Nov 05 '18 02:11 dosxp

Have a PR open to address the issue: https://github.com/taolei87/sru/pull/76

taolei87 avatar Nov 06 '18 02:11 taolei87