Torch won't install with gcc-6 / g++-6 on Mac

208 views
Skip to first unread message

Alfredo Canziani

unread,
Jun 18, 2016, 8:12:10 PM6/18/16
to torch7

After having updated my Mac (going from gcc-5 / g++-5 to gcc-6 / g++-6) Torch installation script fails.

atcold@AlfMAC ~/torch [master*]$ ./install.sh 
Prefix set to /Users/atcold/torch/install
Installing Lua version: LUAJIT21
CMake Error in CMakeLists.txt:
  The CMAKE_C_COMPILER:

    /usr/local/bin/gcc-5

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.

CMake Error in CMakeLists.txt:
  The CMAKE_CXX_COMPILER:

    /usr/local/bin/g++-5

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.

Exporting CC and CXX does not help.

atcold@AlfMAC ~/torch [master*]$ export CC=gcc-6
atcold@AlfMAC ~/torch [master*]$ export CXX=g++-6

Alfredo Canziani

unread,
Jun 22, 2016, 10:31:01 AM6/22/16
to torch7

Does anyone have any idea what’s wrong?
I suppose it’s reading some pre-cached compiler locations, and it’s ignoring the CC and CXX environmental variables.
So, I believe I will open an issue, unless someone points out it’s only my problem.

alban desmaison

unread,
Jun 22, 2016, 10:34:37 AM6/22/16
to torch7
Have you tried deleting the cmake cache? if you used to compile with `gcc-5`, it will just use the cached value and not look at `CC` for a new value

Alfredo Canziani

unread,
Jun 22, 2016, 4:35:48 PM6/22/16
to torch7

Initially I was trying to clean everything with git clean -xdf.
I’ve realised later on that submodules are independent repositories and paths was caching some stuff there.
Later I had troubles also with the CUDA installation and compatibility with the latest clang and clang++ compiler.

Solution

brew update
brew upgrade --all
brew cask install cuda #This fixed my second problem
cd ~/torch
git fetch
git reset --hard origin/master
git clean -xdf
git submodule update
git submodule foreach git clean -xdf #This fixed my first problem
./install.sh

In my specific case, I installed everything with gcc-6 and g++-6 and used clang and clang++ for cutorch and cunn.
I hope this may help some other Mac users.

jsfnnyc

unread,
Jun 23, 2016, 8:18:09 PM6/23/16
to torch7
Thanks! The cuda (re-)install is what I needed as well.

Jackie

Alfredo Canziani

unread,
Jun 24, 2016, 11:21:14 AM6/24/16
to torch7 on behalf of jsfnnyc
Glad to be helpful, sometimes :)

Alfredo Canziani

--
You received this message because you are subscribed to a topic in the Google Groups "torch7" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/torch7/4MgvD-MfEDE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to torch7+un...@googlegroups.com.
To post to this group, send email to tor...@googlegroups.com.
Visit this group at https://groups.google.com/group/torch7.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages