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

MacOS Sierra (10.12) Build Fail via luarocks #522

Open
eek opened this Issue Sep 30, 2016 · 21 comments

Comments

Projects
None yet
@eek

eek commented Sep 30, 2016

I have seen a lot of comments with Build fail on previous version of MacOS / XCode, unfortunately, the easiest answer that most proposed with the xcode-select --install doesn't work.

The problem is cutorch installation fails with:

Error: Build error: Failed building.

because of:

nvcc fatal : The version ('80000') of the host compiler ('Apple clang') is not supported

Any ideas on fixes? :D

Using: CUDA 8.0, XCode 8.0, Apple LLVM version 8.0.0 (clang-800.0.38)

@dongyuwei

This comment has been minimized.

Show comment
Hide comment
@dongyuwei

dongyuwei Oct 7, 2016

My OS X is 10.11.6, got the same error:

nvcc fatal   : The version ('80000') of the host compiler ('Applen vcclca nfga't)a li s   n:o tT hseu pvpeorrstieodn
 ('80000') of the host compiler ('Apple clang') is not supported
nvcc fatal   : The version ('80000') of the host compiler ('Apple clang') is not supported
CMake Error at THC_generated_THCBlas.cu.o.cmake:207 (message):
  Error generating
  /tmp/luarocks_cutorch-scm-1-3139/cutorch/build/lib/THC/CMakeFilCeMsa/kTeH CE.rdriorr/ /a.t/ TTHHCC__ggeenneerraatteedd__TTHHCCBTleanss.ocruC.oop
y
.cu.o
.cmake:207 (message):
  Error generating
  /tmp/luarocks_cutorch-scm-1-3139/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorCopy.cu.o

My OS X is 10.11.6, got the same error:

nvcc fatal   : The version ('80000') of the host compiler ('Applen vcclca nfga't)a li s   n:o tT hseu pvpeorrstieodn
 ('80000') of the host compiler ('Apple clang') is not supported
nvcc fatal   : The version ('80000') of the host compiler ('Apple clang') is not supported
CMake Error at THC_generated_THCBlas.cu.o.cmake:207 (message):
  Error generating
  /tmp/luarocks_cutorch-scm-1-3139/cutorch/build/lib/THC/CMakeFilCeMsa/kTeH CE.rdriorr/ /a.t/ TTHHCC__ggeenneerraatteedd__TTHHCCBTleanss.ocruC.oop
y
.cu.o
.cmake:207 (message):
  Error generating
  /tmp/luarocks_cutorch-scm-1-3139/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorCopy.cu.o
@subzerofun

This comment has been minimized.

Show comment
Hide comment
@subzerofun

subzerofun Oct 9, 2016

Same for me. Tried the switch to the 7.2 Command Line Tools - but unfortunately the nvcc still uses the new one - '80000'...

Should i manually delete the new clang? Did you find any solutions?

Had a working torch install, but upgrading to Sierra must have deleted something because it didn´t work with the new neural style project of jcjohnson: https://github.com/jcjohnson/fast-neural-style


Update: Seems i have found the solution!

As someone on stackoverflow pointed out (http://stackoverflow.com/questions/36250949/revert-apple-clang-version-for-nvcc)

you need to install the old Command Line Tools from XCode 7.2:
Login in to your Apple Dev account, then download this

Next execute this command in the terminal:
sudo xcode-select --switch /Library/Developer/CommandLineTools

Then check the version with
clang --version

Should be (of course) 7.2


Now the missing part:

The problem was in the install folder
/Users/YOU/torch

there were still temp files from the first make attempt with the new clang.

So i did reload my bash profile
source ~/.bash_profile

cd ~/torch

Then
make clean

./clean.sh

And then again
./install.sh


Now nvcc was using the old clang and everything compiled fine!

Tell me if that fixed it for you too!

subzerofun commented Oct 9, 2016

Same for me. Tried the switch to the 7.2 Command Line Tools - but unfortunately the nvcc still uses the new one - '80000'...

Should i manually delete the new clang? Did you find any solutions?

Had a working torch install, but upgrading to Sierra must have deleted something because it didn´t work with the new neural style project of jcjohnson: https://github.com/jcjohnson/fast-neural-style


Update: Seems i have found the solution!

As someone on stackoverflow pointed out (http://stackoverflow.com/questions/36250949/revert-apple-clang-version-for-nvcc)

you need to install the old Command Line Tools from XCode 7.2:
Login in to your Apple Dev account, then download this

Next execute this command in the terminal:
sudo xcode-select --switch /Library/Developer/CommandLineTools

Then check the version with
clang --version

Should be (of course) 7.2


Now the missing part:

The problem was in the install folder
/Users/YOU/torch

there were still temp files from the first make attempt with the new clang.

So i did reload my bash profile
source ~/.bash_profile

cd ~/torch

Then
make clean

./clean.sh

And then again
./install.sh


Now nvcc was using the old clang and everything compiled fine!

Tell me if that fixed it for you too!

@jake17007

This comment has been minimized.

Show comment
Hide comment
@jake17007

jake17007 Nov 12, 2016

I got the same error as the OP:
nvcc fatal : The version ('80000') of the host compiler ('Apple clang') is not supported

Your solution, @subzerofun , worked perfectly for me.

Thank you!

macOS Sierra
Version 10.12.1
MacBook Pro (Retina, 15-inch, Mid 2014)
Graphics: Intel Iris Pro 1536 and NVIDIA GeForce GT 750M

jake17007 commented Nov 12, 2016

I got the same error as the OP:
nvcc fatal : The version ('80000') of the host compiler ('Apple clang') is not supported

Your solution, @subzerofun , worked perfectly for me.

Thank you!

macOS Sierra
Version 10.12.1
MacBook Pro (Retina, 15-inch, Mid 2014)
Graphics: Intel Iris Pro 1536 and NVIDIA GeForce GT 750M

@vinhqdang

This comment has been minimized.

Show comment
Hide comment
@vinhqdang

vinhqdang Nov 16, 2016

How if I want to switch back to clang 8?

Thanks a lot

How if I want to switch back to clang 8?

Thanks a lot

@ivar

This comment has been minimized.

Show comment
Hide comment
@ivar

ivar Nov 27, 2016

@vinhqdang the most common way to switch back to clang 8 is sudo xcode-select --switch /Applications/Xcode.app .. more info with xcode-select -h

ivar commented Nov 27, 2016

@vinhqdang the most common way to switch back to clang 8 is sudo xcode-select --switch /Applications/Xcode.app .. more info with xcode-select -h

@hfarazi

This comment has been minimized.

Show comment
Hide comment
@hfarazi

hfarazi Feb 4, 2017

I had the same problem but instead of downgrading my clang, I upgraded my Cuda to 8 and now it compiles fine.
OS: 10.12.3

clang --version
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

hfarazi commented Feb 4, 2017

I had the same problem but instead of downgrading my clang, I upgraded my Cuda to 8 and now it compiles fine.
OS: 10.12.3

clang --version
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

@Wrongful

This comment has been minimized.

Show comment
Hide comment
@Wrongful

Wrongful Mar 22, 2017

I did as @subzerofun said, yet I'm still encountering my problem. I'm assuming it has to do with how when I checked clang --version, I got version 7.0.2, not 7.2.
The problem I'm getting happens right once [ 52%] Linking C shared library libTH.dylib shows up on the terminal. It looks like:
"Undefined symbols for architecture x86_64:
"_convolve_5x5_sse", referenced from:
_convolve_5x5 in convolve.c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/TH/libTH.0.dylib] Error 1
make[1]: *** [lib/TH/CMakeFiles/TH.dir/all] Error 2
make: *** [all] Error 2

Error: Build error: Failed building."
I was sent here by this site, so I'm not sure if it's them I should be asking, or this site.
I'm no expert on this, so a simple response would be nice.

Wrongful commented Mar 22, 2017

I did as @subzerofun said, yet I'm still encountering my problem. I'm assuming it has to do with how when I checked clang --version, I got version 7.0.2, not 7.2.
The problem I'm getting happens right once [ 52%] Linking C shared library libTH.dylib shows up on the terminal. It looks like:
"Undefined symbols for architecture x86_64:
"_convolve_5x5_sse", referenced from:
_convolve_5x5 in convolve.c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/TH/libTH.0.dylib] Error 1
make[1]: *** [lib/TH/CMakeFiles/TH.dir/all] Error 2
make: *** [all] Error 2

Error: Build error: Failed building."
I was sent here by this site, so I'm not sure if it's them I should be asking, or this site.
I'm no expert on this, so a simple response would be nice.

@subzerofun

This comment has been minimized.

Show comment
Hide comment
@subzerofun

subzerofun Mar 22, 2017

@Wrongful Since i've posted that little "fix" torch has already been updated and should work with CUDA 8 and the newest clang version. So please ignore my message from above!

I would suggest that you upgrade to CUDA 8:
https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda_8.0.61_mac-dmg

Warning: If your current CUDA version is 7.x and you have forked/installed github repos that rely on CUDA 7.x please check (project page/documentation) if they also work with CUDA 8.

Also upgrade XCode to the newest version. If you are already are up-to-date (as of now Xcode 8.2.1 – ignoring the beta version), download the Command Line Tools for your macOS/XCode version:
https://developer.apple.com/download/more/

For macOS 10.12, XCode 8.2:
http://adcdownload.apple.com/Developer_Tools/Command_Line_Tools_macOS_10.12_for_Xcode_8.2/Command_Line_Tools_macOS_10.12_for_Xcode_8.2.dmg

If you don't have an Apple dev account you need to create one to download files from the links above.

Install the command line tools and check in the Terminal if they are installed correctly:
clang --version

Output should be:

.... $ clang --version
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

If you get a different output, switch manually to the new version:
sudo xcode-select --switch /Applications/Xcode.app

When everything is OK with the command line tools and you have finished the CUDA 8 installation, switch back to your torch folder (in Terminal of course) and clean everything, then try again:

cd [yourTorchFolderWithoutBrackets]
make clean
./clean.sh
./install.sh

Hope that helps!

@Wrongful Since i've posted that little "fix" torch has already been updated and should work with CUDA 8 and the newest clang version. So please ignore my message from above!

I would suggest that you upgrade to CUDA 8:
https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda_8.0.61_mac-dmg

Warning: If your current CUDA version is 7.x and you have forked/installed github repos that rely on CUDA 7.x please check (project page/documentation) if they also work with CUDA 8.

Also upgrade XCode to the newest version. If you are already are up-to-date (as of now Xcode 8.2.1 – ignoring the beta version), download the Command Line Tools for your macOS/XCode version:
https://developer.apple.com/download/more/

For macOS 10.12, XCode 8.2:
http://adcdownload.apple.com/Developer_Tools/Command_Line_Tools_macOS_10.12_for_Xcode_8.2/Command_Line_Tools_macOS_10.12_for_Xcode_8.2.dmg

If you don't have an Apple dev account you need to create one to download files from the links above.

Install the command line tools and check in the Terminal if they are installed correctly:
clang --version

Output should be:

.... $ clang --version
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

If you get a different output, switch manually to the new version:
sudo xcode-select --switch /Applications/Xcode.app

When everything is OK with the command line tools and you have finished the CUDA 8 installation, switch back to your torch folder (in Terminal of course) and clean everything, then try again:

cd [yourTorchFolderWithoutBrackets]
make clean
./clean.sh
./install.sh

Hope that helps!

@aaronn

This comment has been minimized.

Show comment
Hide comment
@aaronn

aaronn Apr 2, 2017

This no longer works with Xcode 8.3's command line tools. Had to downgrade to 8.2 linked above.

nvcc fatal : The version ('81000') of the host compiler ('Apple clang') is not supported

aaronn commented Apr 2, 2017

This no longer works with Xcode 8.3's command line tools. Had to downgrade to 8.2 linked above.

nvcc fatal : The version ('81000') of the host compiler ('Apple clang') is not supported

@xpeng

This comment has been minimized.

Show comment
Hide comment
@xpeng

xpeng Apr 6, 2017

@aaronn use this command: sudo xcode-select --switch /Library/Developer/CommandLineTools

xpeng commented Apr 6, 2017

@aaronn use this command: sudo xcode-select --switch /Library/Developer/CommandLineTools

@tylerlindell

This comment has been minimized.

Show comment
Hide comment
@tylerlindell

tylerlindell Apr 13, 2017

@aaronn were you able to get this running? I'm getting the same issue

$ clang --version
Apple LLVM version 8.1.0 (clang-802.0.38)
Target: x86_64-apple-darwin16.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

partial output from end of building torch-distro

echo "Building on $jopts cores"
cmake -E make_directory build && cd build && cmake .. -DLUALIB= -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/Users/tylerlindell/torch-distro/install/bin/.." -DCMAKE_INSTALL_PREFIX="/Users/tylerlindell/torch-distro/install/lib/luarocks/rocks/cutorch/scm-1" && make -j$jopts install

Building on 4 cores
-- Found Torch7 in /Users/tylerlindell/torch-distro/install
-- Removing -DNDEBUG from compile flags
-- TH_LIBRARIES: TH
-- MAGMA not found. Compiling without MAGMA support
-- Automatic GPU detection failed. Building for common architectures.
-- Autodetected CUDA architecture(s): 3.0;3.5;5.0;5.2;5.2+PTX
-- got cuda version 7.5
-- Found CUDA with FP16 support, compiling with torch.CudaHalfTensor
-- CUDA_NVCC_FLAGS: -gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_52,code=compute_52;-DCUDA_HAS_FP16=1
-- THC_SO_VERSION: 0
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/tylerlindell/torch-distro/extra/cutorch/build
[  1%] Building NVCC (Device) object lib/THC/CMakeFiles/THC.dir/THC_generated_THCBlas.cu.o
[  3%] Building NVCC (Device) object lib/THC/CMakeFiles/THC.dir/THC_generated_THCReduceApplyUtils.cu.o
[  3%] Building NVCC (Device) object lib/THC/CMakeFiles/THC.dir/THC_generated_THCHalf.cu.o
[  4%] Building NVCC (Device) object lib/THC/CMakeFiles/THC.dir/THC_generated_THCSleep.cu.o
nvcc fatal   : The version ('80100') of the host compiler ('Apple clang') is not supported
CMake Error at THC_generated_THCBlas.cu.o.cmake:207 (message):
  Error generating
  /Users/tylerlindell/torch-distro/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCBlas.cu.o


nvcc fatal   : The version ('80100') of the host compiler ('Apple clang') is not supported
make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCBlas.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMake Error at THC_generated_THCReduceApplyUtils.cu.o.cmake:207 (message):
  Error generating
  /Users/tylerlindell/torch-distro/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCReduceApplyUtils.cu.o


make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCReduceApplyUtils.cu.o] Error 1
nvcc fatal   : The version ('80100') of the host compiler ('Apple clang') is not supported
CMake Error at THC_generated_THCSleep.cu.o.cmake:207 (message):
  Error generating
  /Users/tylerlindell/torch-distro/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCSleep.cu.o


make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCSleep.cu.o] Error 1
nvcc fatal   : The version ('80100') of the host compiler ('Apple clang') is not supported
CMake Error at THC_generated_THCHalf.cu.o.cmake:207 (message):
  Error generating
  /Users/tylerlindell/torch-distro/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCHalf.cu.o


make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCHalf.cu.o] Error 1
make[1]: *** [lib/THC/CMakeFiles/THC.dir/all] Error 2
make: *** [all] Error 2

Error: Build error: Failed building.

tylerlindell commented Apr 13, 2017

@aaronn were you able to get this running? I'm getting the same issue

$ clang --version
Apple LLVM version 8.1.0 (clang-802.0.38)
Target: x86_64-apple-darwin16.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

partial output from end of building torch-distro

echo "Building on $jopts cores"
cmake -E make_directory build && cd build && cmake .. -DLUALIB= -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/Users/tylerlindell/torch-distro/install/bin/.." -DCMAKE_INSTALL_PREFIX="/Users/tylerlindell/torch-distro/install/lib/luarocks/rocks/cutorch/scm-1" && make -j$jopts install

Building on 4 cores
-- Found Torch7 in /Users/tylerlindell/torch-distro/install
-- Removing -DNDEBUG from compile flags
-- TH_LIBRARIES: TH
-- MAGMA not found. Compiling without MAGMA support
-- Automatic GPU detection failed. Building for common architectures.
-- Autodetected CUDA architecture(s): 3.0;3.5;5.0;5.2;5.2+PTX
-- got cuda version 7.5
-- Found CUDA with FP16 support, compiling with torch.CudaHalfTensor
-- CUDA_NVCC_FLAGS: -gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_52,code=compute_52;-DCUDA_HAS_FP16=1
-- THC_SO_VERSION: 0
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/tylerlindell/torch-distro/extra/cutorch/build
[  1%] Building NVCC (Device) object lib/THC/CMakeFiles/THC.dir/THC_generated_THCBlas.cu.o
[  3%] Building NVCC (Device) object lib/THC/CMakeFiles/THC.dir/THC_generated_THCReduceApplyUtils.cu.o
[  3%] Building NVCC (Device) object lib/THC/CMakeFiles/THC.dir/THC_generated_THCHalf.cu.o
[  4%] Building NVCC (Device) object lib/THC/CMakeFiles/THC.dir/THC_generated_THCSleep.cu.o
nvcc fatal   : The version ('80100') of the host compiler ('Apple clang') is not supported
CMake Error at THC_generated_THCBlas.cu.o.cmake:207 (message):
  Error generating
  /Users/tylerlindell/torch-distro/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCBlas.cu.o


nvcc fatal   : The version ('80100') of the host compiler ('Apple clang') is not supported
make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCBlas.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMake Error at THC_generated_THCReduceApplyUtils.cu.o.cmake:207 (message):
  Error generating
  /Users/tylerlindell/torch-distro/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCReduceApplyUtils.cu.o


make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCReduceApplyUtils.cu.o] Error 1
nvcc fatal   : The version ('80100') of the host compiler ('Apple clang') is not supported
CMake Error at THC_generated_THCSleep.cu.o.cmake:207 (message):
  Error generating
  /Users/tylerlindell/torch-distro/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCSleep.cu.o


make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCSleep.cu.o] Error 1
nvcc fatal   : The version ('80100') of the host compiler ('Apple clang') is not supported
CMake Error at THC_generated_THCHalf.cu.o.cmake:207 (message):
  Error generating
  /Users/tylerlindell/torch-distro/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCHalf.cu.o


make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCHalf.cu.o] Error 1
make[1]: *** [lib/THC/CMakeFiles/THC.dir/all] Error 2
make: *** [all] Error 2

Error: Build error: Failed building.
@aaronn

This comment has been minimized.

Show comment
Hide comment
@aaronn

aaronn Apr 13, 2017

@tylerlindell I downgraded to the command line tools in 8.2

aaronn commented Apr 13, 2017

@tylerlindell I downgraded to the command line tools in 8.2

@tylerlindell

This comment has been minimized.

Show comment
Hide comment
@tylerlindell

tylerlindell Apr 14, 2017

okay, I have downgraded to CLT 8.2 and but im still getting the error when trying to install torch. running clang --version gives me this:

Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Here is the end of my build output

[  4%] Building NVCC (Device) object lib/THC/CMakeFiles/THC.dir/THC_generated_THCHalf.cu.o
nvcc fatal   : The version ('80000') of the host compiler ('Apple clang') is not supported
nvcc fatal   : The version ('80000') of the host compiler ('Apple clang') is not supported
CMake Error at THC_generated_THCSleep.cu.o.cmake:207 (message):
  Error generating
  /Users/tylerlindell/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCSleep.cu.o


CMake Error at THC_generated_THCBlas.cu.o.cmake:207 (message):
  Error generating
  /Users/tylerlindell/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCBlas.cu.o


make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCSleep.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
nvcc fatal   : The version ('80000') of the host compiler ('Apple clang') is not supported
make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCBlas.cu.o] Error 1
CMake Error at THC_generated_THCReduceApplyUtils.cu.o.cmake:207 (message):
  Error generating
  /Users/tylerlindell/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCReduceApplyUtils.cu.o


nvcc fatal   : The version ('80000') of the host compiler ('Apple clang') is not supported
make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCReduceApplyUtils.cu.o] Error 1
CMake Error at THC_generated_THCHalf.cu.o.cmake:207 (message):
  Error generating
  /Users/tylerlindell/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCHalf.cu.o


make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCHalf.cu.o] Error 1
make[1]: *** [lib/THC/CMakeFiles/THC.dir/all] Error 2
make: *** [all] Error 2

Error: Build error: Failed building.

okay, I have downgraded to CLT 8.2 and but im still getting the error when trying to install torch. running clang --version gives me this:

Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Here is the end of my build output

[  4%] Building NVCC (Device) object lib/THC/CMakeFiles/THC.dir/THC_generated_THCHalf.cu.o
nvcc fatal   : The version ('80000') of the host compiler ('Apple clang') is not supported
nvcc fatal   : The version ('80000') of the host compiler ('Apple clang') is not supported
CMake Error at THC_generated_THCSleep.cu.o.cmake:207 (message):
  Error generating
  /Users/tylerlindell/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCSleep.cu.o


CMake Error at THC_generated_THCBlas.cu.o.cmake:207 (message):
  Error generating
  /Users/tylerlindell/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCBlas.cu.o


make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCSleep.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
nvcc fatal   : The version ('80000') of the host compiler ('Apple clang') is not supported
make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCBlas.cu.o] Error 1
CMake Error at THC_generated_THCReduceApplyUtils.cu.o.cmake:207 (message):
  Error generating
  /Users/tylerlindell/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCReduceApplyUtils.cu.o


nvcc fatal   : The version ('80000') of the host compiler ('Apple clang') is not supported
make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCReduceApplyUtils.cu.o] Error 1
CMake Error at THC_generated_THCHalf.cu.o.cmake:207 (message):
  Error generating
  /Users/tylerlindell/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCHalf.cu.o


make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCHalf.cu.o] Error 1
make[1]: *** [lib/THC/CMakeFiles/THC.dir/all] Error 2
make: *** [all] Error 2

Error: Build error: Failed building.
@tylerlindell

This comment has been minimized.

Show comment
Hide comment
@tylerlindell

tylerlindell Apr 14, 2017

okay, I took a peek at the file that was generating the error and it said

if(CUDA_result)
  message(FATAL_ERROR "Error generating ${generated_file}")
endif()

Since it had something to do with cuda, I just uninstalled cuda from my mac and the install completed successfully.

Thank you for your info @aaronn, it was helpful to me to figure this out.

okay, I took a peek at the file that was generating the error and it said

if(CUDA_result)
  message(FATAL_ERROR "Error generating ${generated_file}")
endif()

Since it had something to do with cuda, I just uninstalled cuda from my mac and the install completed successfully.

Thank you for your info @aaronn, it was helpful to me to figure this out.

@subzerofun

This comment has been minimized.

Show comment
Hide comment
@subzerofun

subzerofun Apr 14, 2017

@tylerlindell Don't you need CUDA support for torch? Now you can only run torch in CPU mode - which in most cases is way too slow for most popular ML projects involving ConvNets, GANs etc.

If you have an Nvidia card i would suggest that you try to fix your CUDA install to benefit from the processing power of your GPU!

@tylerlindell Don't you need CUDA support for torch? Now you can only run torch in CPU mode - which in most cases is way too slow for most popular ML projects involving ConvNets, GANs etc.

If you have an Nvidia card i would suggest that you try to fix your CUDA install to benefit from the processing power of your GPU!

@tylerlindell

This comment has been minimized.

Show comment
Hide comment
@tylerlindell

tylerlindell Apr 14, 2017

tylerlindell commented Apr 14, 2017

@rabih-harb

This comment has been minimized.

Show comment
Hide comment
@rabih-harb

rabih-harb Apr 21, 2017

i removed cuda and it worked..
[100%] Built target text_file_reader_utils_test

i removed cuda and it worked..
[100%] Built target text_file_reader_utils_test

@tylerlindell

This comment has been minimized.

Show comment
Hide comment
@tylerlindell

tylerlindell Apr 21, 2017

tylerlindell commented Apr 21, 2017

@rabih-harb

This comment has been minimized.

Show comment
Hide comment
@rabih-harb

rabih-harb Apr 21, 2017

this was the error :
[ 55%] Linking CXX shared library libCaffe2_CPU.dylib
[ 55%] Built target Caffe2_CPU
[ 55%] Building NVCC (Device) object caffe2/CMakeFiles/Caffe2_GPU.dir/utils/Caffe2_GPU_generated_math_gpu.cu.o
nvcc fatal : The version ('80100') of the host compiler ('Apple clang') is not supported

so i removed cuda -
sudo perl uninstall_cuda_8.0.pl --manifest=.cuda_toolkit_uninstall_manifest_do_not_delete.txt

the version was 8.0
then of course it worked and i was able to continue
$ cd /caffe2/build
$ sudo make install
and downloading the sample now
$sudo python -m caffe2.python.models.download -i squeezenet

this was the error :
[ 55%] Linking CXX shared library libCaffe2_CPU.dylib
[ 55%] Built target Caffe2_CPU
[ 55%] Building NVCC (Device) object caffe2/CMakeFiles/Caffe2_GPU.dir/utils/Caffe2_GPU_generated_math_gpu.cu.o
nvcc fatal : The version ('80100') of the host compiler ('Apple clang') is not supported

so i removed cuda -
sudo perl uninstall_cuda_8.0.pl --manifest=.cuda_toolkit_uninstall_manifest_do_not_delete.txt

the version was 8.0
then of course it worked and i was able to continue
$ cd /caffe2/build
$ sudo make install
and downloading the sample now
$sudo python -m caffe2.python.models.download -i squeezenet

@atti-dall-atto

This comment has been minimized.

Show comment
Hide comment
@atti-dall-atto

atti-dall-atto May 22, 2017

@Wrongful @subzerofun I had your problem with the _convolve_5x5_sse

I have Sierra 10.12.4 and Xcode 8.3.2 on a machine with Core 2 Duo CPU ( SSSE4.1 only - no SSSE4.2, no AVX)

output of clang --version is

Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
-- The C compiler identification is AppleClang 8.1.0.8020042
-- The CXX compiler identification is AppleClang 8.1.0.8020042

I am installing Torch for the first time before installing Cuda

The fix is mentioned in issue #32 by @yongduek - there is a bad edge case that means this CPU fails to include the file that defines the symbol. Just add the line he mentions and you will probably compile - I did.

There are also multiple other issues which are relevant to people installing this software on a clean copy of macOS

1/ if ~/.bashrc or ~/.profile don't exist (they won't on a clean macOS), then the script does not warn or prompt to create - it silently fails and subsequent steps in the docs will fail. Just

touch ~/.bashrc

and it will prompt you at the end of the script

2/ There are multiple configuration errors regarding a missing Qt , e.g.

CMake Error at /usr/local/Cellar/cmake/3.8.1/share/cmake/Modules/FindQt4.cmake:1318 (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-5287/qtlua/build/CMakeFiles/CMakeOutput.log".

This can be verified by separately trying

luarocks install qtlua

post-install - this fails

Trying to install the deprecated Qt4 with brew on Sierra gives

brew install qt

Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (caskroom/cask).
No changes to formulae.

Warning: qt is a keg-only and another version is linked to opt.
Use `brew install --force` if you want to install this version

but trying luarocks install qtlua again fails with

CMake Error at /usr/local/Cellar/cmake/3.8.1/share/cmake/Modules/FindQt4.cmake:1318 (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-630/qtlua/build/CMakeFiles/CMakeOutput.log".

Error: Build error: Failed building.

Fix is

echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.bash_profile

to make qmake available, which reveals that

brew install qt

(and the Torch install script) has installed Qt 5.8.0 by default on Sierra- which now produces

CMake Error at /usr/local/Cellar/cmake/3.8.1/share/cmake/Modules/FindQt4.cmake:1318 (message):
  Found unsuitable Qt version "5.8.0" from /usr/local/opt/qt/bin/qmake, this
  code requires Qt 4.x

doing

brew uninstall qt5
brew tap cartr/qt4
brew tap-pin cartr/qt4
brew install qt@4

as suggested here [https://github.com/cartr/homebrew-qt4] for Sierra to get Qt 4.8.7_1
now allows the Qt Torch components to install

qmake is linked to /usr/local/bin/ from usr/local/opt/qt@4/bin/

~/.bash_profile will need re-editing in case this is ever brew-unlinked.

After installing Cuda 8.0.61 and luarocks install cutorch I now get the same nvcc errors as the OP

-- TH_LIBRARIES: TH
-- MAGMA not found. Compiling without MAGMA support
-- Autodetected CUDA architecture(s): 3.5 
-- got cuda version 8.0
-- Found CUDA with FP16 support, compiling with torch.CudaHalfTensor
-- CUDA_NVCC_FLAGS: -gencode;arch=compute_35,code=sm_35;-DCUDA_HAS_FP16=1
nvcc fatal   : The version ('80100') of the host compiler ('Apple clang') is not supported
CMake Error at THC_generated_THCReduceApplyUtils.cu.o.Release.cmake:222 (message):
  Error generating
  /tmp/luarocks_cutorch-scm-1-1485/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCReduceApplyUtils.cu.o

Any idea how far I have to go back with the Command Line Tools to get a version that is compatible with the latest nvcc ?

atti-dall-atto commented May 22, 2017

@Wrongful @subzerofun I had your problem with the _convolve_5x5_sse

I have Sierra 10.12.4 and Xcode 8.3.2 on a machine with Core 2 Duo CPU ( SSSE4.1 only - no SSSE4.2, no AVX)

output of clang --version is

Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
-- The C compiler identification is AppleClang 8.1.0.8020042
-- The CXX compiler identification is AppleClang 8.1.0.8020042

I am installing Torch for the first time before installing Cuda

The fix is mentioned in issue #32 by @yongduek - there is a bad edge case that means this CPU fails to include the file that defines the symbol. Just add the line he mentions and you will probably compile - I did.

There are also multiple other issues which are relevant to people installing this software on a clean copy of macOS

1/ if ~/.bashrc or ~/.profile don't exist (they won't on a clean macOS), then the script does not warn or prompt to create - it silently fails and subsequent steps in the docs will fail. Just

touch ~/.bashrc

and it will prompt you at the end of the script

2/ There are multiple configuration errors regarding a missing Qt , e.g.

CMake Error at /usr/local/Cellar/cmake/3.8.1/share/cmake/Modules/FindQt4.cmake:1318 (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-5287/qtlua/build/CMakeFiles/CMakeOutput.log".

This can be verified by separately trying

luarocks install qtlua

post-install - this fails

Trying to install the deprecated Qt4 with brew on Sierra gives

brew install qt

Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (caskroom/cask).
No changes to formulae.

Warning: qt is a keg-only and another version is linked to opt.
Use `brew install --force` if you want to install this version

but trying luarocks install qtlua again fails with

CMake Error at /usr/local/Cellar/cmake/3.8.1/share/cmake/Modules/FindQt4.cmake:1318 (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-630/qtlua/build/CMakeFiles/CMakeOutput.log".

Error: Build error: Failed building.

Fix is

echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.bash_profile

to make qmake available, which reveals that

brew install qt

(and the Torch install script) has installed Qt 5.8.0 by default on Sierra- which now produces

CMake Error at /usr/local/Cellar/cmake/3.8.1/share/cmake/Modules/FindQt4.cmake:1318 (message):
  Found unsuitable Qt version "5.8.0" from /usr/local/opt/qt/bin/qmake, this
  code requires Qt 4.x

doing

brew uninstall qt5
brew tap cartr/qt4
brew tap-pin cartr/qt4
brew install qt@4

as suggested here [https://github.com/cartr/homebrew-qt4] for Sierra to get Qt 4.8.7_1
now allows the Qt Torch components to install

qmake is linked to /usr/local/bin/ from usr/local/opt/qt@4/bin/

~/.bash_profile will need re-editing in case this is ever brew-unlinked.

After installing Cuda 8.0.61 and luarocks install cutorch I now get the same nvcc errors as the OP

-- TH_LIBRARIES: TH
-- MAGMA not found. Compiling without MAGMA support
-- Autodetected CUDA architecture(s): 3.5 
-- got cuda version 8.0
-- Found CUDA with FP16 support, compiling with torch.CudaHalfTensor
-- CUDA_NVCC_FLAGS: -gencode;arch=compute_35,code=sm_35;-DCUDA_HAS_FP16=1
nvcc fatal   : The version ('80100') of the host compiler ('Apple clang') is not supported
CMake Error at THC_generated_THCReduceApplyUtils.cu.o.Release.cmake:222 (message):
  Error generating
  /tmp/luarocks_cutorch-scm-1-1485/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCReduceApplyUtils.cu.o

Any idea how far I have to go back with the Command Line Tools to get a version that is compatible with the latest nvcc ?

@yongduek

This comment has been minimized.

Show comment
Hide comment
@yongduek

yongduek May 24, 2017

@atti-dall-atto
According to the following there seems to be a chance you can use nvcc with Apple clang.
http://docs.nvidia.com/cuda/cuda-installation-guide-mac-os-x/#axzz4i09MjFCC

1.1. System Requirements
To use CUDA on your system, you need to have:
a CUDA-capable GPU
Mac OS X 10.11 or later
the Clang compiler and toolchain installed using Xcode
the NVIDIA CUDA Toolkit (available from the CUDA Download page)
Table 1. Mac Operating System Support in CUDA 8.0.61
Toolchain	Mac OSX Version (native x86_64)
Xcode	Apple LLVM	10.11	10.12
7.2	7.0.3       	YES	NO
8.2	8.0.0       	NO	YES

Hope you solve the problem and share the knowledge.

I have had the same problem several months ago, and turned off cuda support. Actually, heavy learning is done in a new linux machine with 4 nvidia titan X, through remote login from my mac.

yongduek commented May 24, 2017

@atti-dall-atto
According to the following there seems to be a chance you can use nvcc with Apple clang.
http://docs.nvidia.com/cuda/cuda-installation-guide-mac-os-x/#axzz4i09MjFCC

1.1. System Requirements
To use CUDA on your system, you need to have:
a CUDA-capable GPU
Mac OS X 10.11 or later
the Clang compiler and toolchain installed using Xcode
the NVIDIA CUDA Toolkit (available from the CUDA Download page)
Table 1. Mac Operating System Support in CUDA 8.0.61
Toolchain	Mac OSX Version (native x86_64)
Xcode	Apple LLVM	10.11	10.12
7.2	7.0.3       	YES	NO
8.2	8.0.0       	NO	YES

Hope you solve the problem and share the knowledge.

I have had the same problem several months ago, and turned off cuda support. Actually, heavy learning is done in a new linux machine with 4 nvidia titan X, through remote login from my mac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment