setting BUILD_SHARED_LIBS=OFF breaks before 0% (similar as before when it stopped at [1970/3136] but the total build size is smaller)
setting USE_NINJA=OFF breaks at 78% (before was 75%) with the following:
[ 78%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/autograd/saved_variable.cpp.o
[ 78%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/autograd/variable.cpp.o
4 warnings generated.
[ 78%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/autodiff.cpp.o
[ 78%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/attributes.cpp.o
[ 78%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/argument_spec.cpp.o
[ 78%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/pass_manager.cpp.o
[ 78%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/pickler.cpp.o
[ 78%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/graph_executor.cpp.o
[ 78%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/import_source.cpp.o
[ 78%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/import.cpp.o
[ 78%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/pickle.cpp.o
[ 78%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/import_export_helpers.cpp.o
[ 78%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/instruction.cpp.o
[ 78%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/interpreter.cpp.o
[ 78%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/constants.cpp.o
[ 78%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/node_hashing.cpp.o
[ 79%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/ir.cpp.o
/Users/adrienbitton/Desktop/pytorch/torch/csrc/jit/interpreter.cpp:292:23: warning: moving a temporary object prevents copy elision [-Wpessimizing-move]
    can_emit_inline = std::move(CanEmitInline(graph).can_emit_inline_);
                      ^
/Users/adrienbitton/Desktop/pytorch/torch/csrc/jit/interpreter.cpp:292:23: note: remove std::move call here
    can_emit_inline = std::move(CanEmitInline(graph).can_emit_inline_);
                      ^~~~~~~~~~                                     ~
[ 79%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/irparser.cpp.o
[ 79%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/jit_log.cpp.o
1 warning generated.
[ 79%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/operator.cpp.o
[ 79%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/register_c10_ops.cpp.o
[ 79%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/subgraph_matcher.cpp.o
[ 79%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/symbolic_script.cpp.o
[ 79%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/profiling_record.cpp.o
[ 79%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/profiling_graph_executor_impl.cpp.o
[ 79%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/passes/alias_analysis.cpp.o
In file included from /Users/adrienbitton/Desktop/pytorch/torch/csrc/jit/passes/alias_analysis.cpp:1:
In file included from /Users/adrienbitton/Desktop/pytorch/torch/csrc/jit/passes/alias_analysis.h:3:
/Users/adrienbitton/Desktop/pytorch/c10/util/flat_hash_map.h:1367:24: error: no member named 'out_of_range' in namespace 'std'
            throw std::out_of_range("Argument passed to at() was not in the map.");
                  ~~~~~^
/Users/adrienbitton/Desktop/pytorch/c10/util/flat_hash_map.h:1374:24: error: no member named 'out_of_range' in namespace 'std'
            throw std::out_of_range("Argument passed to at() was not in the map.");
                  ~~~~~^
[ 79%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/passes/batch_mm.cpp.o
[ 79%] Building CXX object caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/passes/bailout_graph.cpp.o
2 errors generated.
make[2]: *** [caffe2/CMakeFiles/torch.dir/__/torch/csrc/jit/passes/alias_analysis.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [caffe2/CMakeFiles/torch.dir/all] Error 2
make: *** [all] Error 2
Traceback (most recent call last):
  File "setup.py", line 756, in <module>
    build_deps()
  File "setup.py", line 321, in build_deps
    cmake=cmake)
  File "/Users/adrienbitton/Desktop/pytorch/tools/build_pytorch_libs.py", line 63, in build_caffe2
    cmake.build(my_env)
  File "/Users/adrienbitton/Desktop/pytorch/tools/setup_helpers/cmake.py", line 331, in build
    self.run(build_args, my_env)
  File "/Users/adrienbitton/Desktop/pytorch/tools/setup_helpers/cmake.py", line 142, in run
    check_call(command, cwd=self.build_dir, env=env)
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 347, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--target', 'install', '--config', 'Release', '--', '-j', '4']' returned non-zero exit status 2.