Build on Mac OS X, no cuda, fails for me, cstdint and unordered_map not found

_parser.o -D_THP_CORE -std=c++11 -Wno-write-strings -fno-strict-aliasing -DWITH_DISTRIBUTED
In file included from torch/csrc/DynamicTypes.cpp:1:
In file included from /Users/hugh2/git-local/pytorch/torch/csrc/DynamicTypes.h:7:
In file included from /Users/hugh2/git-local/pytorch/torch/lib/tmp_install/include/THPP/THPP.h:4:
/Users/hugh2/git-local/pytorch/torch/lib/tmp_install/include/THPP/Storage.hpp:6:10: fatal error: 'cstdint'
      file not found
#include <cstdint>
         ^
torch/csrc/Module.cpp:6:10: fatal error: 'unordered_map' file not found
#include <unordered_map>
         ^
In file included from torch/csrc/Generator.cpp:6:
In file included from /Users/hugh2/git-local/pytorch/torch/csrc/THP.h:35:
/Users/hugh2/git-local/pytorch/torch/csrc/utils.h:6:10: fatal error: 'type_traits' file not found
#include <type_traits>
         ^
In file included from torch/csrc/autograd/init.cpp:3:
In file included from /Users/hugh2/git-local/pytorch/torch/csrc/THP.h:35:
/Users/hugh2/git-local/pytorch/torch/csrc/utils.h:6:10: fatal error: 'type_traits' file not found
#include <type_traits>
         ^
In file included from torch/csrc/utils/tuple_parser.cpp:1:

Look at the readme: https://github.com/pytorch/pytorch#install-pytorch

We specify: MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py install for OSX. Particularly, MACOSX_DEPLOYMENT_TARGET=10.9 is important and will fix your error.

1 Like