Skip to content

Instantly share code, notes, and snippets.

@fsodogandji
Last active March 13, 2017 20:26
Show Gist options
  • Save fsodogandji/906361c6fadbb89e950dcdaabd2ddbcf to your computer and use it in GitHub Desktop.
Save fsodogandji/906361c6fadbb89e950dcdaabd2ddbcf to your computer and use it in GitHub Desktop.
pytorch osx compilation
  • OS 10.11.1 El Capitan
  • Python 2.7.13 :: Anaconda custom (x86_64)

$> /usr/bin/clang --version

Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.0.0
Thread model: posix

$> brew update && brew upgrade --all

$> brew cask install cuda

$> /usr/local/cuda/bin/nvcc --version

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2016 NVIDIA Corporation
Built on Tue_Jan_10_13:22:46_CST_2017
Cuda compilation tools, release 8.0, V8.0.61

$> git clone https://github.com/pytorch/pytorch.git

$> cd pytorch

In the file setup.py replace the line:

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

$> python setup.py install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment