Hi, I’m on a Mac with an Nvidia GeForce GT 650M, CUDA 8, Mac OS 10.14.2, and building within a Conda environment.
I followed the readme pretty closely, but possible I missed something. I used the following command to build:
MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py install

and the errors are:
[ 68%] Built target caffe2
Scanning dependencies of target caffe2_module_test_dynamic
Scanning dependencies of target THD
Scanning dependencies of target shm
Scanning dependencies of target caffe2_pybind11_state
Scanning dependencies of target caffe2_observers
[ 68%] Building NVCC (Device) object caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/THC/caffe2_gpu_generated_THCSleep.cu.o
[ 68%] Building NVCC (Device) object caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/THC/caffe2_gpu_generated_THCBlas.cu.o
[ 68%] Building NVCC (Device) object caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/THC/caffe2_gpu_generated_THCReduceApplyUtils.cu.o
[ 68%] Building CXX object caffe2/torch/lib/libshm/CMakeFiles/shm.dir/core.cpp.o
[ 68%] Building CXX object modules/module_test/CMakeFiles/caffe2_module_test_dynamic.dir/module_test_dynamic.cc.o
[ 68%] Building CXX object modules/observers/CMakeFiles/caffe2_observers.dir/net_observer_reporter_print.cc.o
In file included from <built-in>:1:
In file included from /usr/local/cuda/include/cuda_runtime.h:115:
In file included from In file included from <built-in>:1:
In file included from /usr/local/cuda/include/cuda_runtime.h:115:
In file included from In file included from <built-in>:1:
In file included from /usr/local/cuda/include/cuda_runtime.h:115:
In file included from /usr/local/cuda/include/crt/common_functions.h:77:
/Library/Developer/CommandLineTools/usr/include/c++/v1/string.h:61:15: fatal error: 'string.h' file not found
#include_next <string.h>
              ^~~~~~~~~~
/usr/local/cuda/include/crt/common_functions.h:77:
/Library/Developer/CommandLineTools/usr/include/c++/v1/string.h:61:15: fatal error: 'string.h' file not found
#include_next <string.h>
              ^~~~~~~~~~
/usr/local/cuda/include/crt/common_functions.h:77:
/Library/Developer/CommandLineTools/usr/include/c++/v1/string.h:61:15: fatal error: 'string.h' file not found
#include_next <string.h>
              ^~~~~~~~~~
1 error generated.
CMake Error at caffe2_gpu_generated_THCSleep.cu.o.Release.cmake:219 (message):
  Error generating
  /Users/user/Development/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/THC/./caffe2_gpu_generated_THCSleep.cu.o


1 error generated.
make[2]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/THC/caffe2_gpu_generated_THCSleep.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 68%] Building CXX object modules/observers/CMakeFiles/caffe2_observers.dir/observer_config.cc.o
CMake Error at caffe2_gpu_generated_THCBlas.cu.o.Release.cmake:219 (message):
  Error generating
  /Users/user/Development/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/THC/./caffe2_gpu_generated_THCBlas.cu.o


1 error generated.
make[2]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/THC/caffe2_gpu_generated_THCBlas.cu.o] Error 1
CMake Error at caffe2_gpu_generated_THCReduceApplyUtils.cu.o.Release.cmake:219 (message):
  Error generating
  /Users/user/Development/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/THC/./caffe2_gpu_generated_THCReduceApplyUtils.cu.o


make[2]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/THC/caffe2_gpu_generated_THCReduceApplyUtils.cu.o] Error 1
make[1]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 68%] Building CXX object modules/observers/CMakeFiles/caffe2_observers.dir/perf_observer.cc.o
[ 68%] Building CXX object caffe2/torch/lib/THD/CMakeFiles/THD.dir/base/ChannelUtils.cpp.o
[ 68%] Building CXX object caffe2/torch/lib/THD/CMakeFiles/THD.dir/base/Cuda.cpp.o
[ 68%] Building CXX object caffe2/CMakeFiles/caffe2_pybind11_state.dir/python/pybind_state.cc.o
[ 68%] Linking CXX shared library ../../../../lib/libshm.dylib
[ 68%] Built target shm
[ 68%] Building CXX object caffe2/torch/lib/THD/CMakeFiles/THD.dir/base/DataChannel.cpp.o
[ 68%] Building CXX object caffe2/CMakeFiles/caffe2_pybind11_state.dir/python/pybind_state_dlpack.cc.o
[ 68%] Building CXX object caffe2/CMakeFiles/caffe2_pybind11_state.dir/python/pybind_state_nomni.cc.o
[ 68%] Building CXX object caffe2/torch/lib/THD/CMakeFiles/THD.dir/base/DataChannelRequest.cpp.o
In file included from /Users/user/Development/pytorch/torch/lib/THD/base/DataChannel.cpp:6:
/Users/user/Development/pytorch/torch/lib/THD/../THD/base/data_channels/DataChannelMPI.hpp:15:12: warning: 
      class 'DataChannelMPI' was previously declared as a struct
      [-Wmismatched-tags]
    friend class DataChannelMPI; // allows `DataChannelMPI` to access private
           ^
/Users/user/Development/pytorch/torch/lib/THD/../THD/base/data_channels/DataChannelMPI.hpp:13:8: note: 
      previous use is here
struct DataChannelMPI : DataChannel {
       ^
[ 68%] Building CXX object caffe2/CMakeFiles/caffe2_pybind11_state.dir/python/pybind_state_registry.cc.o
1 warning generated.
[ 68%] Building CXX object caffe2/CMakeFiles/caffe2_pybind11_state.dir/python/pybind_state_int8.cc.o
[ 68%] Building CXX object caffe2/torch/lib/THD/CMakeFiles/THD.dir/base/RPCType.cpp.o
[ 68%] Building CXX object caffe2/torch/lib/THD/CMakeFiles/THD.dir/base/data_channels/DataChannelMPI.cpp.o
[ 68%] Building CXX object caffe2/torch/lib/THD/CMakeFiles/THD.dir/base/data_channels/DataChannelTCP.cpp.o
[ 68%] Linking CXX shared library ../../lib/libcaffe2_module_test_dynamic.dylib
[ 68%] Building CXX object caffe2/torch/lib/THD/CMakeFiles/THD.dir/base/init_methods/InitMethod.cpp.o
[ 68%] Built target caffe2_module_test_dynamic
[ 68%] Building CXX object caffe2/CMakeFiles/caffe2_pybind11_state.dir/python/pybind_state_ideep.cc.o
In file included from /Users/user/Development/pytorch/torch/lib/THD/base/data_channels/DataChannelMPI.cpp:1:
/Users/user/Development/pytorch/torch/lib/THD/../THD/base/data_channels/DataChannelMPI.hpp:15:12: warning: 
      class 'DataChannelMPI' was previously declared as a struct
      [-Wmismatched-tags]
    friend class DataChannelMPI; // allows `DataChannelMPI` to access private
           ^
/Users/user/Development/pytorch/torch/lib/THD/../THD/base/data_channels/DataChannelMPI.hpp:13:8: note: 
      previous use is here
struct DataChannelMPI : DataChannel {
       ^
[ 68%] Linking CXX shared library ../../lib/libcaffe2_observers.dylib
[ 68%] Built target caffe2_observers
[ 68%] Building CXX object caffe2/torch/lib/THD/CMakeFiles/THD.dir/base/init_methods/InitMethodEnv.cpp.o
[ 68%] Building CXX object caffe2/torch/lib/THD/CMakeFiles/THD.dir/base/init_methods/InitMethodFile.cpp.o
[ 68%] Building CXX object caffe2/torch/lib/THD/CMakeFiles/THD.dir/base/init_methods/InitMethodTCP.cpp.o
1 warning generated.
[ 68%] Building CXX object caffe2/torch/lib/THD/CMakeFiles/THD.dir/base/init_methods/InitMethodUtils.cpp.o
[ 68%] Building CXX object caffe2/torch/lib/THD/CMakeFiles/THD.dir/process_group/Collectives.cpp.o
[ 68%] Building CXX object caffe2/torch/lib/THD/CMakeFiles/THD.dir/process_group/General.cpp.o
[ 68%] Linking CXX static library ../../../../lib/libTHD.a
[ 68%] Built target THD
[ 68%] Linking CXX shared module python/caffe2_pybind11_state.cpython-36m-darwin.so
[ 68%] Built target caffe2_pybind11_state
make: *** [all] Error 2
Traceback (most recent call last):
  File "setup.py", line 710, in <module>
    build_deps()
  File "setup.py", line 282, in build_deps
    build_dir='build')
  File "/Users/user/Development/pytorch/tools/build_pytorch_libs.py", line 255, in build_caffe2
    check_call(['make', '-j', str(max_jobs), 'install'], cwd=build_dir, env=my_env)
  File "/Users/user/anaconda3/envs/aenv/lib/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['make', '-j', '8', 'install']' returned non-zero exit status 2.

I’d love to build from source so I can utilize CUDA. How can I figure out where I’m going wrong with the build?
Thank you!