torch / torch7

http://torch.ch
Other
8.97k stars 2.38k forks source link

Local install failing #27

Closed n-batalha closed 9 years ago

n-batalha commented 10 years ago

I am replicating the install-luajit+torch script for my distro (Gentoo), but it seems to want to install in root regardless of using --local.

Not cmake literate so not sure if these lines mean it's an expected behaviour:

TorchConfig.cmake.in:

# This (ugly) setup assumes:
#  CMAKE_PREFIX_PATH = LUA_BINDIR
#  CMAKE_INSTALL_PREFIX = PREFIX

If not, sundown, cwrap and paths install fine, and here is my in/output:

export $(eval ``luarocks path``)
export CMAKE_LIBRARY_PATH=/usr/lib64/gcc/x86_64-pc-linux-gnu/4.7.3/

lua_modules=('sundown' 'cwrap' 'paths' 'torch')

for i in "${lua_modules[@]}"
do
   luarocks --local --server=https://raw.github.com/torch/rocks/master install $i || (echo "Error occurred"; break)
echo 
done
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/share/cmake/torch/TorchExports.cmake
CMake Error at cmake_install.cmake:48 (FILE):
  file INSTALL cannot copy file
  "/tmp/luarocks_torch-scm-1-9869/torch7/build/CMakeFiles/Export/share/cmake/torch/TorchExports.cmake"
  to "/usr/share/cmake/torch/TorchExports.cmake".
andresy commented 10 years ago

Hi,

Which version of luarocks do you have? Did you try with the luajit+luarocks provided in there: https://github.com/torch/luajit-rocks ?

Cheers, Ronan

n-batalha commented 10 years ago

Hello,

Yeah, should had mentioned! luarocks 2.0.12 (and luajit 2.0.2).

I might try that, didn't find it on the install-deps and according to the wiki: "only requires LuaJIT (>= 2.0) and Luarocks (>= 2.0.12)", but could be outdated.

(Might take some time to try, by making a clean gentoo ebuild)

n-batalha commented 10 years ago

Did as above, and is similar:

-- Install configuration: "Release"
CMake Error at cmake_install.cmake:48 (FILE):
  file cannot create directory: /usr/local/share/cmake/torch.  Maybe need
  administrative privileges.

make: *** [install] Error 1

Error: Build error: Failed installing.

Without --local also fails, but should be a separate issue (appears to use hardcoded/non-$LUA_PATH dirs, which on other distros might coincide).

soumith commented 10 years ago

hey, how did you install torch? It looks like it installs the repos relative to the torch dir. Did you try using the ezinstall script as is, except for changing the apt-get calls to gentoo-equivalents?

n-batalha commented 10 years ago

Well the install-deps script has been replicated in Gentoo form as is, just replacing by gentoo equivalents.

As for the install-script, I also replicated it (see first post). It just sets CMAKE_LIBRARY_PATH, PREFIX and installs luajit-rocks.git before pulling torch etc. I ommited a couple of different PREFIX I tried, makes no difference.

I was just avoiding luajit-rocks and a system install, but now also tried those.

andresy commented 10 years ago

@koraykv @clementfarabet : do you remember some problems with --local?

clementfarabet commented 10 years ago

I never use --local. I usually make a entirely local install, using PREFIX:

curl -s https://raw.github.com/torch/ezinstall/master/install-luajit+torch | PREFIX=~/local bash

There could be some problems with --local, I'd have to try that.

danielhers commented 10 years ago

@clementfarabet It still asks for a password for sudo this way.

koraykv commented 10 years ago

I have to try, we use --local all the time, but we have our own script :)

soumith commented 9 years ago

the https://github.com/torch/distro approach is completely local install. closing the task.