tqchen/tinyflow

error building tinyflow

kgupta15 opened this issue · 3 comments

Here's the error I am getting :

g++ -std=c++11 -std=c++11 -Wall -O2 -msse2  -Wno-unknown-pragmas -funroll-loops -fPIC -Iinclude -Idmlc-core/include -I/home/kapil/Documents/my-nn-library/tinyflow/nnvm/include -I/home/kapil/torch/install/include -I/home/kapil/torch/install/include/TH -I/home/kapil/torch/install/include/THC/ -MM -MT build/src/session.o src/session.cc >build/src/session.d
g++ -std=c++11 -c -std=c++11 -Wall -O2 -msse2  -Wno-unknown-pragmas -funroll-loops -fPIC -Iinclude -Idmlc-core/include -I/home/kapil/Documents/my-nn-library/tinyflow/nnvm/include -I/home/kapil/torch/install/include -I/home/kapil/torch/install/include/TH -I/home/kapil/torch/install/include/THC/ -c src/session.cc -o build/src/session.o
In file included from src/./torch/torch_util.h:10:0,
                 from src/session.cc:11:
dmlc-core/include/dmlc/lua.h: In member function ‘void dmlc::LuaRef::SetByPopStack_(dmlc::LuaState*)’:
dmlc-core/include/dmlc/lua.h:482:40: error: ‘lua_ref’ was not declared in this scope
     ref_ = lua_ref(L, LUA_REGISTRYINDEX);
                                        ^
In file included from dmlc-core/include/dmlc/lua.h:34:0,
                 from src/./torch/torch_util.h:10,
                 from src/session.cc:11:
/home/kapil/torch/install/include/luaT.h: At global scope:
/home/kapil/torch/install/include/luaT.h:41:12: warning: ‘int luaL_typerror(lua_State*, int, const char*)’ defined but not used [-Wunused-function]
 static int luaL_typerror(lua_State *L, int narg, const char *tname)
            ^
Makefile:55: recipe for target 'build/src/session.o' failed
make: *** [build/src/session.o] Error 1

The error points to dmlc-core code in here. I tried to compile dmlc-core using cmake and it builds successfully. I dont know why the tinyflow makefile is giving the error.

@daemonslayer same problem, have you solved it?

you can fix it by change dmlc-core/include/dmlc/lua.h:482:

ref_ = lua_ref(L, LUA_REGISTRYINDEX);

into

ref_ = luaL_ref(L, LUA_REGISTRYINDEX);

It will be better to append origin environment variable at the end,

export PYTHONPATH=${PYTHONPATH}:/path/to/tinyflow/python:/path/to/tinyflow/nnvm/python

into

export PYTHONPATH=/path/to/tinyflow/python:/path/to/tinyflow/nnvm/python:${PYTHONPATH}

because if you install TVM before, tinyflow's nnvm lib will be conflict TVM.