Change:
I'm getting some strange errors when trying to build from source on macOS 10.12. I'm using CUDA 8.0 and I'm trying to use CUDnn v5. I think that I've got CUDnn installed correctly but I'm not sure. I've pasted a log below. fatal: Not a git repository (or any of the parent directories): .git running install running builddeps -- Try OpenMP C flag = [-fopenmp=libomp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP C flag = [ ] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP C flag = [-fopenmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP C flag = [/openmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP C flag = [-Qopenmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP C flag = [-openmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP C flag = [-xopenmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP C flag = [+Oopenmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP C flag = [-qsmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP C flag = [-mp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP CXX flag = [-fopenmp=libomp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP CXX flag = [ ] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP CXX flag = [-fopenmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP CXX flag = [/openmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP CXX flag = [-Qopenmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP CXX flag = [-openmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP CXX flag = [-xopenmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP CXX flag = [+Oopenmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP CXX flag = [-qsmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP CXX flag = [-mp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Could NOT find OpenMP (missing: OpenMPCFLAGS OpenMPCXXFLAGS) -- Could not find hardware support for NEON on this machine. -- No OMAP3 processor on this machine. -- No OMAP4 processor on this machine. -- SSE2 Found -- SSE3 Found -- AVX Found -- THSOVERSION: 1 -- Atomics: using GCC intrinsics -- Checking for [mklintellp64 - mklintelthread - mklcore - iomp5 - pthread - m] -- Library mklintellp64: -- Library mklintelthread: -- Library mklcore: -- Library iomp5: -- Library pthread: -- Library m: -- MKL library found -- Found a library with BLAS API (mkl). -- Found a library with LAPACK API. (mkl) -- Configuring done CMake Warning (dev): Policy CMP0042 is not set: MACOSXRPATH is enabled by default. Run "cmake --help-policy CMP0042" for policy details. Use the cmakepolicy command to set the policy and suppress this warning. MACOSXRPATH is not specified for the following targets: TH This warning is for project developers. Use -Wno-dev to suppress it. -- Generating done -- Build files have been written to: /Users/Gautam/Downloads/pytorch-master/torch/lib/build/TH [100%] Built target TH Install the project... -- Install configuration: "Release" -- Installing: /Users/Gautam/Downloads/pytorch- -- Installing: /Users/Gautam/Downloads/pytorch- -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/TH.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/THAllocator.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/THMath.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/THBlas.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/THDiskFile.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/THFile.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/THFilePrivate.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/THGeneral.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/THGenerateAllTypes.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/THGenerateHalfType.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/THGenerateFloatTypes.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/THGenerateIntTypes.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/THLapack.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/THLogAdd.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/THMemoryFile.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/THRandom.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/THStorage.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/THTensor.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/THTensorApply.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/THTensorDimApply.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/THTensorMacros.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/THVector.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/THAtomic.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/THHalf.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/vector/AVX.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/vector/AVX2.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/generic/THBlas.c -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/generic/THBlas.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/generic/THLapack.c -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/generic/THLapack.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/generic/THStorage.c -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/generic/THStorage.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/generic/THStorageCopy.c -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/generic/THStorageCopy.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/generic/THTensor.c -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/generic/THTensor.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/generic/THTensorConv.c -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/generic/THTensorConv.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/generic/THTensorCopy.c -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/generic/THTensorCopy.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/generic/THTensorLapack.c -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/generic/THTensorLapack.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/generic/THTensorMath.c -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/generic/THTensorMath.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/generic/THTensorRandom.c -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/generic/THTensorRandom.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/generic/THVectorDispatch.c -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH/generic/THVector.h -- Up-to-date: /Users/Gautam/Downloads/pytorch- Updating installname for Updating installname for Updating installname for -- THLIBRARIES: /Users/Gautam/Downloads/pytorch- -- THSSOVERSION: 1 -- Configuring done CMake Warning (dev): Policy CMP0042 is not set: MACOSXRPATH is enabled by default. Run "cmake --help-policy CMP0042" for policy details. Use the cmakepolicy command to set the policy and suppress this warning. MACOSXRPATH is not specified for the following targets: THS This warning is for project developers. Use -Wno-dev to suppress it. -- Generating done -- Build files have been written to: /Users/Gautam/Downloads/pytorch-master/torch/lib/build/THS [ 50%] Linking C shared library [100%] Built target THS Install the project... -- Install configuration: "Release" -- Up-to-date: /Users/Gautam/Downloads/pytorch- -- Installing: /Users/Gautam/Downloads/pytorch- -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/THS/THS.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/THS/THSGenerateAllTypes.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/THS/THSGenerateFloatTypes.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/THS/THSGenerateIntTypes.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/THS/THSTensor.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/THS/generic/THSTensor.c -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/THS/generic/THSTensor.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/THS/generic/THSTensorMath.c -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/THS/generic/THSTensorMath.h Updating installname for Updating installname for Updating installname for -- THLIBRARIES: /Users/Gautam/Downloads/pytorch- -- Try OpenMP C flag = [-fopenmp=libomp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP C flag = [ ] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP C flag = [-fopenmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP C flag = [/openmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP C flag = [-Qopenmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP C flag = [-openmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP C flag = [-xopenmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP C flag = [+Oopenmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP C flag = [-qsmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP C flag = [-mp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP CXX flag = [-fopenmp=libomp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP CXX flag = [ ] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP CXX flag = [-fopenmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP CXX flag = [/openmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP CXX flag = [-Qopenmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP CXX flag = [-openmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP CXX flag = [-xopenmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP CXX flag = [+Oopenmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP CXX flag = [-qsmp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Try OpenMP CXX flag = [-mp] -- Performing Test OpenMPFLAGDETECTED -- Performing Test OpenMPFLAGDETECTED - Failed -- Could NOT find OpenMP (missing: OpenMPCFLAGS OpenMPCXXFLAGS) CMake Warning (dev) at (LINKDIRECTORIES): This command specifies the relative path as a link directory. Policy CMP0015 is not set: linkdirectories() treats paths relative to the source dir. Run "cmake --help-policy CMP0015" for policy details. Use the cmakepolicy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it. -- THNNSOVERSION: 1 -- Configuring done CMake Warning (dev): Policy CMP0042 is not set: MACOSXRPATH is enabled by default. Run "cmake --help-policy CMP0042" for policy details. Use the cmakepolicy command to set the policy and suppress this warning. MACOSXRPATH is not specified for the following targets: THNN This warning is for project developers. Use -Wno-dev to suppress it. -- Generating done -- Build files have been written to: /Users/Gautam/Downloads/pytorch-master/torch/lib/build/THNN [ 50%] Linking C shared library [100%] Built target THNN Install the project... -- Install configuration: "Release" -- Installing: /Users/Gautam/Downloads/pytorch- -- Installing: /Users/Gautam/Downloads/pytorch- -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/THNN/THNN.h -- Up-to-date: /Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/THNN/generic/THNN.h Updating installname for Updating installname for Updating installname for -- Removing -DNDEBUG from compile flags -- THLIBRARIES: /Users/Gautam/Downloads/pytorch- -- 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;6.0;6.1;6.1+PTX -- got cuda version 8.0 -- Found CUDA with FP16 support, compiling with torch.CudaHalfTensor -- CUDANVCCFLAGS: -DTHINDEXBASE=0 -I/Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include -I/Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/TH -I/Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/THC -I/Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/THS -I/Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/THCS -I/Users/Gautam/Downloads/pytorch-master/torch/lib/tmpinstall/include/THPP;-gencode;arch=compute30,code=sm30;-gencode;arch=compute35,code=sm35;-gencode;arch=compute50,code=sm50;-gencode;arch=compute52,code=sm52;-gencode;arch=compute60,code=sm60;-gencode;arch=compute61,code=sm61;-gencode;arch=compute61,code=compute61;-DCUDAHASFP16=1 -- THCSOVERSION: 1 -- Configuring done CMake Warning (dev): Policy CMP0042 is not set: MACOSXRPATH is enabled by default. Run "cmake --help-policy CMP0042" for policy details. Use the cmakepolicy command to set the policy and suppress this warning. MACOSXRPATH is not specified for the following targets: THC This warning is for project developers. Use -Wno-dev to suppress it. -- Generating done -- Build files have been written to: /Users/Gautam/Downloads/pytorch-master/torch/lib/build/THC [ 4%] Building NVCC (Device) object [ 6%] Building NVCC (Device) object [ 6%] Building NVCC (Device) object [ 6%] Building NVCC (Device) object [ 6%] Building NVCC (Device) object [ 9%] Building NVCC (Device) object [ 9%] Building NVCC (Device) object [ 9%] Building NVCC (Device) object nvcc fatal : The version ('') of the host compiler ('Apple clang') is not supported nvcc fatal : The version ('') of the host compiler ('Apple clang') is not supported nvcc fatal : The version ('') of the host compiler ('Apple clang') is not supported nvcc fatal : The version ('') of the host compiler ('Apple clang') is not supported nvcc fatal : The version ('') of the host compiler ('Apple clang') is not supported nvcc fatal : The version ('') of the host compiler ('Apple clang') is not supported nvcc fatal : The version ('') of the host compiler ('Apple clang') is not supported CMake Error at (message): Error generating /Users/Gautam/Downloads/pytorch- CMake Error at (message): Error generating /Users/Gautam/Downloads/pytorch- CMake Error at (message): Error generating /Users/Gautam/Downloads/pytorch- CMake Error at (message): Error generating /Users/Gautam/Downloads/pytorch- CMake Error at (message): Error generating /Users/Gautam/Downloads/pytorch- CMake Error at (message): Error generating /Users/Gautam/Downloads/pytorch- CMake Error at (message): Error generating /Users/Gautam/Downloads/pytorch- make[2]: [] Error 1 make[2]: Waiting for unfinished jobs.... make[2]: [] Error 1 make[2]: [] Error 1 make[2]: [] Error 1 make[2]: [] Error 1 make[2]: [] Error 1 make[2]: [] Error 1 nvcc fatal : The version ('') of the host compiler ('Apple clang') is not supported CMake Error at (message): Error generating /Users/Gautam/Downloads/pytorch- make[2]: [] Error 1 make[1]: [] Error 2 make: * [all] Error 2 (pytorch) GautamsBPRetina:pytor
You need to reinstall the CUDA toolkit. The new nvcc version supports clang 8.
it looks like the latest clang breaks nvcc again. i have the same problem building: I'm running macOS 10.12.4 with Xcode 8.3.2. Here's more status info:
Yes, Apple has released a new clang version recently and NVIDIA doesn't support it yet. You can downgrade your command line tools to v. 7.3.1. or v. 8.0
thanks i tried this yesterday but couldn't quite get it to work. i'm pretty sure it was some combination of the cmake cache and not setting my PATH correctly, but i'm not sure. instead i took this route: (i know i shouldn't have to set the PATH, and both the CC/CXX and CMAKE_* variables but i was having trouble with only setting CC/CXX at one point, and never figured out why) it gives me: i'm going to try the command line tools downgrade again.
It seems that you compiled clang from source, but it's not supported by NVIDIA either (it's clang vs Apple clang ). You need to go to the Apple Developer site and download "Command Line Tools for XCode vX.Y.Z" where X.Y.Z is either 7.3.1 or 8.0.0
hah, lovely :) it turns out the reason that yesterday's command line tools downgrade didn't work was that Xcode was overriding the command line tools install. after moving Xcode to the trash i found the directory of the command line tools install. here is before and after moving Xcode to the trash: and now i can make sure it's used instead: (note: if you get cocky and don't set MACOSXDEPLOYMENTTARGET=10.9 then you get hit with ) an aside: something that would be really helpful in this case is a or similar that removes the CMake cache between builds. i noticed that when i was trying to switch the compiler around like this, CMake was still set to use the old compiler until i found and cleared the cache. at first it didn't work, because i had two conflicting versions of pip (anaconda and brew): so i uninstalled the old one: but then it couldn't find torch: easy solution, I was in the wrong directory: almost there! in jupyter notebook i get the error . based on i guessed that i need to uninstall and reinstall the kernelspec for jupyter: and now jupyter works! and i get 2x performance on my small model ;)
Thanks for writing this up! One tip: you can do instead of removing XCode and to revert it to the previous setting ( prints the current cmdline tools path). If you don't have any uncommited changes (this is important - they would get removed) in pytorch sources you can use to purge the repo to a state as if it was freshly cloned (all build artifacts gone).
Hi, I followed Kyle steps and i´m getting these errors: I did a and I checked clang and it was 7.3.1, i noticed Kyle was using 8.0.0, so I downloaded Xcode and command line utilities and verified 8.0.0 and was pointing to the command line utilities. Nevertheless I had this error: Help, please!
This is the same problem as in . Use env var
It compiled successfully, but it means it does not linked CUDA? Thanks!
(ai) pytorch git:(master) MACOSXDEPLOYMENTTARGET=10.9 python install running install running builddeps -- The C compiler identification is AppleClang 7.3.0. -- The CXX compiler identification is AppleClang 7.3.0. -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- broken CMake Error at /Users/daksh/anaconda3/envs/ai/share/cmake- (message): The C compiler "/Library/Developer/CommandLineTools/usr/bin/cc" is not able to compile a simple test program. It fails with the following output: Change Dir: /Users/daksh/code/build/pytorch/torch/lib/build/TH/CMakeFiles/CMakeTmp Run Build Command:"/Library/Developer/CommandLineTools/usr/bin/make" "cmTC7e3f7/fast" /Library/Developer/CommandLineTools/usr/bin/make -f Building C object /Library/Developer/CommandLineTools/usr/bin/cc -DTHINDEXBASE=0 -I/Users/daksh/code/build/pytorch/torch/lib/tmpinstall/include -I/Users/daksh/code/build/pytorch/torch/lib/tmpinstall/include/TH -I/Users/daksh/code/build/pytorch/torch/lib/tmpinstall/include/THC -I/Users/daksh/code/build/pytorch/torch/lib/tmpinstall/include/THS -I/Users/daksh/code/build/pytorch/torch/lib/tmpinstall/include/THCS -I/Users/daksh/code/build/pytorch/torch/lib/tmpinstall/include/THPP -I/Users/daksh/code/build/pytorch/torch/lib/tmpinstall/include/THNN -I/Users/daksh/code/build/pytorch/torch/lib/tmpinstall/include/THCUNN -fexceptions -isysroot -mmacosx-version-min=10.9 -o -c /Users/daksh/code/build/pytorch/torch/lib/build/TH/CMakeFiles/CMakeTmp/testCCompiler.c Linking C executable cmTC7e3f7 /Users/daksh/anaconda3/envs/ai/bin/cmake -E cmakelinkscript --verbose=1 /Library/Developer/CommandLineTools/usr/bin/cc -DTHINDEXBASE=0 -I/Users/daksh/code/build/pytorch/torch/lib/tmpinstall/include -I/Users/daksh/code/build/pytorch/torch/lib/tmpinstall/include/TH -I/Users/daksh/code/build/pytorch/torch/lib/tmpinstall/include/THC -I/Users/daksh/code/build/pytorch/torch/lib/tmpinstall/include/THS -I/Users/daksh/code/build/pytorch/torch/lib/tmpinstall/include/THCS -I/Users/daksh/code/build/pytorch/torch/lib/tmpinstall/include/THPP -I/Users/daksh/code/build/pytorch/torch/lib/tmpinstall/include/THNN -I/Users/daksh/code/build/pytorch/torch/lib/tmpinstall/include/THCUNN -fexceptions -isysroot -mmacosx-version-min=10.9 -Wl,-searchpathsfirst -Wl,-headerpadmaxinstallnames -o cmTC7e3f7 ld: unexpected token: !tapi-tbd-v2 file '' for architecture x8664 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: [cmTC7e3f7] Error 1 make: [cmTC7e3f7/fast] Error 2 CMake will not be able to correctly generate this project. Call Stack (most recent call first): -- Configuring incomplete, errors occurred! See also "". See also "".
I was having an issue with clang 8.3.3 on OS X High Sierra with CUDA 9.0, and getting the same error: CMake Error at (MESSAGE): threadlocal not supported. THD requires a compiler that supports threadlocal. Please upgrade your compiler. If you are on OSX, upgrade to XCode 8 or newer. I was able to fix this by setting CMAKECXXFLAGS -stdlib=libc++

Discussion:
TARGET_LINK_LIBRARIES(THPP LINK_PRIVATE ${TH_LIBRARIES} ${THS_LIBRARIES}) IF(CUDA_FOUND) TARGET_LINK_LIBRARIES(THPP LINK_PRIVATE ${THC_LIBRARIES} ${THCS_LIBRARIES}) <ins> TARGET_LINK_LIBRARIES(THPP ${CUDA_LIBRARIES}) </ins> ENDIF() INSTALL(TARGETS THPP

LDFLAGS="-L$INSTALL_DIR/lib " LD_POSTFIX=".so.1" LD_POSTFIX_UNVERSIONED=".so" <del> if [[ $(uname) == 'Darwin' ]]; then LDFLAGS="$LDFLAGS -Wl,-rpath,@loader_path" </del> <ins> if [[ $(uname) == 'Darwin' ]]; then LDFLAGS="$LDFLAGS -Qunused-arguments -Wl,-rpath,@loader_path" </ins> LD_POSTFIX=".1.dylib" LD_POSTFIX_UNVERSIONED=".dylib" else