Skip to content

Error when compiling on a Mac (10.11.6) #1175

Closed
@abeschneider

Description

@abeschneider

Got error:

.../pytorch/torch/csrc/allocators.h:4:10: fatal error: 
      'type_traits' file not found
#include <type_traits>
         ^
In file included from torch/csrc/Size.cpp:4:
In file included from .../pytorch/torch/csrc/THP.h:37:
.../pytorch/torch/csrc/allocators.h:4:10: fatal error: 
      'type_traits' file not found
#include <type_traits>

Was able to fix this by adding -stdlib=libc++ to extra_compile_args in setup.py:

extra_compile_args = ['-std=c++11', '-Wno-write-strings', '-stdlib=libc++']

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions