Error when compiling pytorch: 'cstdint' file not found
I was attempting to compile pytorch using NO_CUDA=1 python setup.py install on Mac OS X, but I got these errors:

In file included from /Users/ezyang/Dev/pytorch-tmp/torch/lib/tmp_install/include/THPP/Tensor.hpp:3:
/Users/ezyang/Dev/pytorch-tmp/torch/lib/tmp_install/include/THPP/Storage.hpp:6:10: fatal error: 
      'cstdint' file not found
#include &lt;cstdint&gt;
         ^
1 error generated.
In file included from torch/csrc/autograd/functions/init.cpp:2:
In file included from torch/csrc/autograd/functions/batch_normalization.h:4:
In file included from /Users/ezyang/Dev/pytorch-tmp/torch/lib/tmp_install/include/THPP/THPP.h:4:
/Users/ezyang/Dev/pytorch-tmp/torch/lib/tmp_install/include/THPP/Storage.hpp:6:10: fatal error: 
      'cstdint' file not found
#include &lt;cstdint&gt;
         ^
1 error generated.
1 error generated.
1 error generated.
1 error generated.
In file included from torch/csrc/autograd/python_hook.cpp:5:
In file included from /Users/ezyang/Dev/pytorch-tmp/torch/csrc/THP.h:32:
/Users/ezyang/Dev/pytorch-tmp/torch/csrc/utils.h:6:10: fatal error: 
      'type_traits' file not found
#include &lt;type_traits&gt;
         ^
13 errors generated.
1 error generated.
1 error generated.
error: command 'gcc' failed with exit status 1


You need to setup environment variables to have Python use the correct C compiler on OS X. You should do this instead:

NO_CUDA=1 MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++  python setup.py install

