torch / distro

Torch installation in a self-contained folder
BSD 3-Clause "New" or "Revised" License
556 stars 484 forks source link

LUA_PATHSEP missing? #172

Open reppolice opened 8 years ago

reppolice commented 8 years ago

It is rather unfathomable but I had to insert #define LUA_PATHSEP ";" to pkg/paths/paths.c in order to get going with TORCH_LUA_VERSION=LUA52 ./install.sh These are my first steps with the distro so not really sure what is happening, but hard to believe this went undetected. Having said that, I am not that sure that was the only thing that was broken, plus I have the memcpy problem on Ubuntu with Cuda8, and I will have to tread very carefully in order to get https://github.com/facebook/UETorch to compile, I cannot deviate from LeCun's build instructions too much!

howard0su commented 8 years ago

Check your env please. that macro is already defined in paths.c

if LUA_VERSIONNUM >= 502 /* LUA52 compatibility defs /

define LUA_PATHSEP ";"

define PATHS_LUA_CLEANUP_DEFS 1

endif

static const char pushnexttemplate (lua_State L, const char path) { const char l; while (_path == _LUAPATHSEP) path++; / skip separators _/ if (path == '\0') return NULL; /* no more templates / l = strchr(path, *LUAPATHSEP); / find next separator _/ if (l == NULL) l = path + strlen(path); luapushlstring(L, path, l - path); / template _/ return l; }

ifdef PATHS_LUA_CLEANUPDEFS / cleanup after yourself */

undef LUA_PATHSEP

endif

reppolice commented 8 years ago

I don't know what to check for, but I thought downloading the distro and running its scripts was supposed to protect me exactly from my environment? I am on good old Ubuntu 16.04 and have not done anything horrible to it

emicol commented 5 years ago

You must clean the previous torch install, and it will be fine. (cd ~/torch && ./clean.sh) TORCH_LUA_VERSION=LUA52 ./install.sh with cuda>9.1 , it also needs another flag : TORCH_NVCC_FLAGS="-D__CUDA_NO_HALF_OPERATORS__" TORCH_LUA_VERSION=LUA52 ./install.sh