torch / torch7

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

Errors Installing Torch in Mac OS 10.13.16 #1171

Open JSGandora opened 5 years ago

JSGandora commented 5 years ago

I am encountering some errors while installing Torch based on the installation guide on the torch website (http://torch.ch/docs/getting-started.html#_).

The following is part of my output to, could anyone help me understand what I need to do to fix this?

./install.sh

...
Warning: unmatched variable LUALIB
cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DLUA=/Users/jasonshi/torch/install/bin/luajit -DLUALIB= -DLUA_BINDIR="/Users/jasonshi/torch/install/bin" -DLUA_INCDIR="/Users/jasonshi/torch/install/include" -DLUA_LIBDIR="/Users/jasonshi/torch/install/lib" -DLUADIR="/Users/jasonshi/torch/install/lib/luarocks/rocks/qtlua/scm-1/lua" -DLIBDIR="/Users/jasonshi/torch/install/lib/luarocks/rocks/qtlua/scm-1/lib" -DCONFDIR="/Users/jasonshi/torch/install/lib/luarocks/rocks/qtlua/scm-1/conf" && make

CMake Deprecation Warning at CMakeLists.txt:16 (CMAKE_POLICY):
  The OLD behavior for policy CMP0026 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.

CMake Error at /usr/local/Cellar/cmake/3.12.3/share/cmake/Modules/FindQt4.cmake:1313 (message):
  Found unsuitable Qt version "" from NOTFOUND, this code requires Qt 4.x
Call Stack (most recent call first):
  CMakeLists.txt:38 (FIND_PACKAGE)

-- Configuring incomplete, errors occurred!
See also "/Users/jasonshi/torch/exe/qtlua/build/CMakeFiles/CMakeOutput.log".

Error: Build error: Failed building.

Missing dependencies for qttorch:
qtlua >= 1.0

Using https://raw.githubusercontent.com/torch/rocks/master/qtlua-scm-1.rockspec... switching to 'build' mode
Cloning into 'qtlua'...
remote: Enumerating objects: 169, done.
remote: Counting objects: 100% (169/169), done.
remote: Compressing objects: 100% (163/163), done.
remote: Total 169 (delta 11), reused 120 (delta 2), pack-reused 0
Receiving objects: 100% (169/169), 364.37 KiB | 3.25 MiB/s, done.
Resolving deltas: 100% (11/11), done.
cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DLUA=/Users/jasonshi/torch/install/bin/luajit -DLUA_BINDIR="/Users/jasonshi/torch/install/bin" -DLUA_INCDIR="/Users/jasonshi/torch/install/include" -DLUA_LIBDIR="/Users/jasonshi/torch/install/lib" -DLUADIR="/Users/jasonshi/torch/install/lib/luarocks/rocks/qtlua/scm-1/lua" -DLIBDIR="/Users/jasonshi/torch/install/lib/luarocks/rocks/qtlua/scm-1/lib" -DCONFDIR="/Users/jasonshi/torch/install/lib/luarocks/rocks/qtlua/scm-1/conf" && make

-- The C compiler identification is AppleClang 10.0.0.10001145
-- The CXX compiler identification is AppleClang 10.0.0.10001145
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Deprecation Warning at CMakeLists.txt:16 (CMAKE_POLICY):
  The OLD behavior for policy CMP0026 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.

CMake Error at /usr/local/Cellar/cmake/3.12.3/share/cmake/Modules/FindQt4.cmake:1313 (message):
  Found unsuitable Qt version "" from NOTFOUND, this code requires Qt 4.x
Call Stack (most recent call first):
  CMakeLists.txt:38 (FIND_PACKAGE)

-- Configuring incomplete, errors occurred!
See also "/tmp/luarocks_qtlua-scm-1-3304/qtlua/build/CMakeFiles/CMakeOutput.log".

Error: Failed installing dependency: https://raw.githubusercontent.com/torch/rocks/master/qtlua-scm-1.rockspec - Build error: Failed building.
Warning: unmatched variable LUALIB
cmake -E make_directory build && cd build && cmake .. -DLUALIB= -DLUA_INCDIR=/Users/jasonshi/torch/install/include -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/Users/jasonshi/torch/install/bin/.." -DCMAKE_INSTALL_PREFIX="/Users/jasonshi/torch/install/lib/luarocks/rocks/threads/scm-1" && make
...
patniemeyer commented 5 years ago

I was able to get past this by telling brew to use qt4 at the default brew switch qt brew switch qt 4.8.7_2 and putting /usr/local/opt/qt/bin in my path first. Without that I think cmake was still finding qt 5 in my path before qt 4.