Skip to content

Error when compiling on a Mac (10.11.6) #1175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
abeschneider opened this issue Apr 3, 2017 · 3 comments
Closed

Error when compiling on a Mac (10.11.6) #1175

abeschneider opened this issue Apr 3, 2017 · 3 comments

Comments

@abeschneider
Copy link

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++']
@soumith
Copy link
Member

soumith commented Apr 3, 2017

this is not the correct fix. as we mention in our readme, you have to set

export MACOSX_DEPLOYMENT_TARGET=10.9 # if OSX

@soumith soumith closed this as completed Apr 3, 2017
@abeschneider
Copy link
Author

abeschneider commented Apr 3, 2017

Ah, okay. That makes sense. It hadn't occurred to because usually when I do an update I don't need to set the environmental variable and when I follow the instructions for installation I wouldn't see that error. Also, I am avoiding setting it in my .bashrc since (at least for me) it seems to have to change with my OS, and thus it seems like a dangerous thing to do.

Would it make sense to add a check in setup.py if you are an on Mac and the variable is not set? I'm happy to submit a PR for this.

Thanks!

edit: Sorry, one more comment -- in the README.md, it mentions that the environmental variable needs to be set, but not why. It might help other people to either mention that or add it to a FAQ. The issue is that when you search for the errors, the only result you get is the one I posted, rather than the correct one.

@soumith
Copy link
Member

soumith commented Apr 3, 2017

this only applies on OSX and anaconda installs, so adding it to setup.py doesn't make sense here.
you could alias a bash command if you'd like:
alias pytorchsetup='MACOSX_DEPLOYMENT_TARGET=10.9 python setup.py install

jjsjann123 added a commit to jjsjann123/pytorch that referenced this issue Nov 5, 2021
Fixes pytorch#1129

Thread predicates are missing in generating unswitch conditions. This PR collects thread predicates from unswitched expressions, merge them and append the merged one into the generated unswitch Bool val.

The main new logic is the merging of thread predicates at: ThreadPredicateMap::mergeForUnswitch. Other changes are mostly minor cosmetic ones.

Co-authored-by: Naoya Maruyama <[email protected]>
Co-authored-by: jiej <[email protected]>
jaglinux pushed a commit to jaglinux/pytorch that referenced this issue Feb 22, 2023
…h#1175)

Support for MIOpen immediate mode is not enabled in release branches

required for the test_Conv2d_naive_groups test to pass https://ontrack-internal.amd.com/browse/SWDEV-355273

cherry-pick from ROCm@ad6db00
akashveramd pushed a commit to akashveramd/pytorch that referenced this issue Apr 9, 2025
Bumps [rocm-docs-core](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.34.2 to 0.35.0.
- [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases)
- [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md)
- [Commits](ROCm/rocm-docs-core@v0.34.2...v0.35.0)

---
updated-dependencies:
- dependency-name: rocm-docs-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants