Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install paths #5

Closed
vkuznet opened this issue Jul 3, 2014 · 21 comments
Closed

Unable to install paths #5

vkuznet opened this issue Jul 3, 2014 · 21 comments

Comments

@vkuznet
Copy link

vkuznet commented Jul 3, 2014

Hi, I was trying to install torch, but turns out it fails to install paths package. I'm using OSX 10.9.3 and I have lua (5.2.3), luagit (2.0.3), luarocks (2.0.13) installed via macports. Here is a full output of the error:

sudo luarocks --server=https://raw.githubusercontent.com/torch/rocks/master install paths
Installing https://raw.githubusercontent.com/torch/rocks/master/paths-scm-1.rockspec...
Using https://raw.githubusercontent.com/torch/rocks/master/paths-scm-1.rockspec... switching to 'build' mode
Cloning into 'paths'...
remote: Counting objects: 10, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 10 (delta 0), reused 5 (delta 0)
Receiving objects: 100% (10/10), 12.11 KiB | 0 bytes/s, done.
Checking connectivity... done.
Warning: unmatched variable LUALIB
cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DLUALIB= -DLUA_INCDIR="/opt/local/include" -DLUA_LIBDIR="/opt/local/lib" -DLUADIR="/opt/local/share/luarocks//lib/luarocks/rocks/paths/scm-1/lua" -DLIBDIR="/opt/local/share/luarocks//lib/luarocks/rocks/paths/scm-1/lib" -DCMAKE_INSTALL_PREFIX="/opt/local/share/luarocks//lib/luarocks/rocks/paths/scm-1" && make

-- The C compiler identification is AppleClang 5.1.0.5030040
-- The CXX compiler identification is AppleClang 5.1.0.5030040
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for include file fcntl.h
-- Looking for include file fcntl.h - found
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include file dirent.h
-- Looking for include file dirent.h - found
-- Looking for include file time.h
-- Looking for include file time.h - found
-- Looking for include file sys/time.h
-- Looking for include file sys/time.h - found
-- Looking for include file sys/ndir.h
-- Looking for include file sys/ndir.h - not found
-- Looking for include file sys/utsname.h
-- Looking for include file sys/utsname.h - found
-- Looking for include file sys/dir.h
-- Looking for include file sys/dir.h - found
-- Looking for include file ndir.h
-- Looking for include file ndir.h - not found
-- Looking for getcwd
-- Looking for getcwd - found
-- Looking for dlopen in dl
-- Looking for dlopen in dl - found
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/luarocks_paths-scm-1-9991/paths/build
Scanning dependencies of target paths
[100%] Building C object CMakeFiles/paths.dir/paths.c.o
/tmp/luarocks_paths-scm-1-9991/paths/paths.c:730:15: warning: 'tempnam' is deprecated: This function is provided for
      compatibility reasons only. Due to security concerns inherent in the design of tempnam(3), it is highly recommended
      that you use mkstemp(3) instead. [-Wdeprecated-declarations]
  char *tmp = tempnam(NULL, "luatmp");
              ^
/usr/include/stdio.h:389:7: note: 'tempnam' declared here
char    *tempnam(const char *, const char *) __DARWIN_ALIAS(tempnam);
         ^
/tmp/luarocks_paths-scm-1-9991/paths/paths.c:991:20: error: use of undeclared identifier 'LUA_PATHSEP'
  while (*path == *LUA_PATHSEP) path++;  /* skip separators */
                   ^
/tmp/luarocks_paths-scm-1-9991/paths/paths.c:993:21: error: use of undeclared identifier 'LUA_PATHSEP'
  l = strchr(path, *LUA_PATHSEP);  /* find next separator */
                    ^
/tmp/luarocks_paths-scm-1-9991/paths/paths.c:1003:19: error: use of undeclared identifier 'LUA_GLOBALSINDEX'
  lua_getfield(L, LUA_GLOBALSINDEX, "package");
                  ^
/tmp/luarocks_paths-scm-1-9991/paths/paths.c:1110:19: error: use of undeclared identifier 'LUA_GLOBALSINDEX'
  lua_setfield(L, LUA_GLOBALSINDEX, "paths");
                  ^
/tmp/luarocks_paths-scm-1-9991/paths/paths.c:1111:3: warning: implicit declaration of function 'luaL_register' is invalid
      in C99 [-Wimplicit-function-declaration]
  luaL_register(L, NULL, paths__);
  ^
2 warnings and 4 errors generated.
make[2]: *** [CMakeFiles/paths.dir/paths.c.o] Error 1
make[1]: *** [CMakeFiles/paths.dir/all] Error 2
make: *** [all] Error 2

Error: Build error: Failed building.

Can you tell from this error what's wrong on my system? Thanks, Valentin.

@jaidevd
Copy link

jaidevd commented Aug 8, 2014

Hi @vkuznet
The issue is because of a dependency of paths, luabind, which requires lua 5.1, doesn't work with lua 5.2. I had the same issue and got it fixed by running torch (and it's dependencies) from lua 5.1.

There is however a pending pull request here luabind/luabind#11 that makes luabind compatible with lua 5.2. I'll check it again whenever it gets merged.

@soumith
Copy link
Member

soumith commented Aug 8, 2014

paths isn't dependent on luabind. but I dont know if paths is compatible with lua52.

@JobJob
Copy link

JobJob commented Aug 26, 2014

I have the same issue trying to install torch with macports (and without homebrew). @vkuznet did you have any success? I was trying to prepare an install script for macports users (whilst installing torch myself) but got stuck at this hurdle.

@vkuznet
Copy link
Author

vkuznet commented Aug 26, 2014

Nope, I tried couple of times and fail, then I put it aside to do other tasks.
But I'm still interested to get via macports.

On 0, JobJob notifications@github.com wrote:

I have the same issue trying to install torch with macports (and without homebrew). @vkuznet did you have any success? I was trying to prepare an install script for macports users (whilst installing torch myself) but got stuck at this hurdle.


Reply to this email directly or view it on GitHub:
#5 (comment)

@danbri
Copy link

danbri commented Oct 13, 2014

Just run into this too.

@russellfei
Copy link

As a result, this issue remained nearly 4 month.....oops...
I just came across this error when paths was to be installed on my macbook, linux platform works all fine.

I've just got a plan, let me try it then ;-)


update:

Personal perspective:

/tmp/luarocks_paths-scm-1-1765/paths/paths.c: In function 'lua_tmpname':
/tmp/luarocks_paths-scm-1-1765/paths/paths.c:730:3: warning: 'tempnam' is deprecated (declared at /usr/include/stdio.h:391): This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of tempnam(3), it is highly recommended that you use mkstemp(3) instead. [-Wdeprecated-declarations]
   char *tmp = tempnam(NULL, "luatmp");
   ^
/tmp/luarocks_paths-scm-1-1765/paths/paths.c: In function 'pushnexttemplate':
/tmp/luarocks_paths-scm-1-1765/paths/paths.c:991:20: error: 'LUA_PATHSEP' undeclared (first use in this function)
   while (*path == *LUA_PATHSEP) path++;  /* skip separators */
                    ^
/tmp/luarocks_paths-scm-1-1765/paths/paths.c:991:20: note: each undeclared identifier is reported only once for each function it appears in
/tmp/luarocks_paths-scm-1-1765/paths/paths.c: In function 'pushfilename':
/tmp/luarocks_paths-scm-1-1765/paths/paths.c:1003:19: error: 'LUA_GLOBALSINDEX' undeclared (first use in this function)
   lua_getfield(L, LUA_GLOBALSINDEX, "package");
                   ^
/tmp/luarocks_paths-scm-1-1765/paths/paths.c: In function 'luaopen_libpaths':
/tmp/luarocks_paths-scm-1-1765/paths/paths.c:1110:19: error: 'LUA_GLOBALSINDEX' undeclared (first use in this function)
   lua_setfield(L, LUA_GLOBALSINDEX, "paths");
                   ^
make[2]: *** [CMakeFiles/paths.dir/paths.c.o] Error 1
make[1]: *** [CMakeFiles/paths.dir/all] Error 2
make: *** [all] Error 2

Error: Build error: Failed building.

According to this error message, maybe something should be rewritten to satisfy the new lua (lua-5.2) language or the macro definition (something like #define PI 3.1415 in C @_@) should be debugged.

Meanwhile, the linux platform is free of this kind of issues. Why?
Curiously, I checked settings on my server ( Scintific Linux 6.4, yeah :-P, I hacked into the install file, it's a lot of work to find corresponding libraries )

Installed Packages
Name        : lua
Arch        : x86_64
Version     : 5.1.4
Release     : 4.1.el6
Size        : 603 k
Repo        : installed
From repo   : base
Summary     : Powerful light-weight programming language
URL         : http://www.lua.org/
License     : MIT
Description : Lua is a powerful light-weight programming language designed for
            : extending applications. Lua is also frequently used as a
            : general-purpose, stand-alone language. Lua is free software.
            : Lua combines simple procedural syntax with powerful data description
            : constructs based on associative arrays and extensible semantics. Lua
            : is dynamically typed, interpreted from bytecodes, and has automatic
            : memory management with garbage collection, making it ideal for
            : configuration, scripting, and rapid prototyping.

$ luarocks

LuaRocks 2.1.0, a module deployment system for Lua

In addition, here comes the key, when I just removed lua but not lua51 in home-brew:

$luarocks --server=https://raw.githubusercontent.com/torch/rocks/master install paths
-bash: /usr/local/bin/luarocks: /usr/local/opt/lua/bin/lua5.2: bad interpreter: No such file or directory

Clearly, the problem lies in that the paths source file is incompatible with lua-5.2 (maybe something predefined is removed in new version, maybe ;-P), and the brew install luarocks is configured to lua-5.2 through the config-5.2 at luarocks directory.

Solutions: (<--Thankfully, this git stops talking about his hallucinations :-)

  1. paths source file should be revised to handle this issue. (first things first, might be the best solution)
  2. configure luarocks, according to this page

However, both of them exceeds my ability...but I think I have found the big and know the huge door, just need Hercules to open the door.

It's 12:44 AM, night 0.0!

@JobJob
Copy link

JobJob commented Oct 27, 2014

Haha! Where is our superman: http://youtu.be/o0AOG7ciuJo

@soumith
Copy link
Member

soumith commented Oct 27, 2014

ok, so the issue here seems to be that paths is not compatible with lua52. Let me see what this is all about.

I could not reproduce this problem, but we also use our own luajit+luarocks in which we have no issues.

When there's system lua installed, things get messy with torch global install.
In such cases, I recommend installing a self-contained folder of torch like with this repo:
https://github.com/soumith/torch-distro

@soumith
Copy link
Member

soumith commented Oct 27, 2014

ok fixed in
5ca8bbe

However, I STRONGLY recommend that you guys use our packaged luajit+luarocks when using torch. We did not test it on other environments.

@soumith soumith closed this as completed Oct 27, 2014
@vkuznet
Copy link
Author

vkuznet commented Oct 27, 2014

Hi,
I just tried your self-contained approach on my OSX (10.9.5) and it fails on my system with
the following output (last lines):
-- Installing:
/Users/vk/Work/DataAnalysis/GIT/torch-distro/install/lib/luarocks/rocks/paths/scm-1/lua/paths/init.lua
-- Installing:
/Users/vk/Work/DataAnalysis/GIT/torch-distro/install/lib/luarocks/rocks/paths/scm-1/lib/libpaths.so

Error: Failed installing dependency:
https://raw.githubusercontent.com/torch/rocks/master/torch-scm-1.rockspec -
Failed installing dependency:
https://raw.githubusercontent.com/torch/rocks/master/paths-scm-1.rockspec -
Failed producing checksum: no MD5 checker command configured

For your convenience I put full output including my commands I used to clone
the repo and invoke the install into this gist: https://gist.github.com/vkuznet/800a8019640960144964

I use MacPorts, therefore plenty of packages are coming from my ports area rather then
system ones. But I'll be happy to check if you'll let me know what/where should
I look.

Thanks,
Valentin

On 0, Soumith Chintala notifications@github.com wrote:

ok, so the issue here seems to be that paths is not compatible with lua52. Let me see what this is all about.

I could not reproduce this problem, but we also use our own luajit+luarocks in which we have no issues.

When there's system lua installed, things get messy with torch global install.
In such cases, I recommend installing a self-contained folder of torch like with this repo:
https://github.com/soumith/torch-distro


Reply to this email directly or view it on GitHub:
#5 (comment)

@soumith
Copy link
Member

soumith commented Oct 27, 2014

good point. looks like md5sum is central to luarocks. i will try to reproduce this use-case and push a fix to https://github.com/soumith/torch-distro
Thanks for the feedback.

@soumith
Copy link
Member

soumith commented Oct 27, 2014

(with homebrew, we get md5sum with coreutils, but with macports looks like it is more tricky).
I will check for OSX and make it use md5 -r

@russellfei
Copy link

@soumith Great!
Well, let me try it again!
Actually, I've just grabbed a little experience on other platforms, torch is a well-organized library and platform limits should not be its drawbacks. At least, I've configured it on RHEL based Linux. Besides, there's also someone extended to other platforms. ;-)

@JobJob
Copy link

JobJob commented Oct 29, 2014

Nice! The self contained https://github.com/soumith/torch-distro worked for me on OSX 10.9.5, I have md5 installed but not md5sum. Thanks Superman/Hercules! :D

@soumith
Copy link
Member

soumith commented Oct 29, 2014

@vkuznet I looked at your log again, there is an MD5.app that gets detected and is used. Other than that conflicting app of yours, it is working fine on macports for me.

@vkuznet
Copy link
Author

vkuznet commented Oct 29, 2014

Thanks for pointing me to the issue. Once I removed MD5.app I was able to
install it on my system. Time to play :)

On 0, Soumith Chintala notifications@github.com wrote:

@vkuznet I looked at your log again, there is an MD5.app that gets detected and is used. Other than that conflicting app of yours, it is working fine on macports for me.


Reply to this email directly or view it on GitHub:
#5 (comment)

@abhijay9
Copy link

abhijay9 commented Jul 20, 2016

Hi, I am facing the following issue-
Installing https://raw.githubusercontent.com/torch/rocks/master/dpnn-scm-1.rockspec...
Using https://raw.githubusercontent.com/torch/rocks/master/dpnn-scm-1.rockspec... switching to 'build' mode
Cloning into 'dpnn'...
fatal: unable to connect to github.com:
github.com[0: 192.30.253.112]: errno=Connection timed out

I am using Lua 5.2.3. Please tell me how this error can be solved.

This answer helped me solve the problem
http://stackoverflow.com/a/18889129/5082406

@DSLituiev
Copy link

the issue looks like still persist in the https://github.com/torch/distro.git two years later as of autumn 2016. Just following http://torch.ch/docs/getting-started.html with TORCH_LUA_VERSION=LUA52 ./install.sh returns the same error. Can the fix be merged into the official distribution?

@kintany
Copy link

kintany commented Jun 20, 2018

The problem is still here, 4 years later!

@MaximumProgrammer
Copy link

That's true.

@andresrex
Copy link

the issue looks like still persist in the https://github.com/torch/distro.git two years later as of autumn 2016. Just following http://torch.ch/docs/getting-started.html with TORCH_LUA_VERSION=LUA52 ./install.sh returns the same error. Can the fix be merged into the official distribution?

omg! I love u man

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests