-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Error building from source on macOS #2220
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
Comments
Interestingly, was trying to replicate your error and got something completely different: error``` Traceback (most recent call last): File "setup.py", line 233, in setup( File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/site-packages/setuptools/__init__.py", line 144, in setup return distutils.core.setup(**attrs) File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/distutils/core.py", line 148, in setup dist.run_commands() File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/site-packages/setuptools/command/install.py", line 67, in run self.do_egg_install() File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/site-packages/setuptools/command/install.py", line 109, in do_egg_install self.run_command('bdist_egg') File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 173, in run cmd = self.call_command('install_lib', warn_dir=0) File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 159, in call_command self.run_command(cmdname) File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/site-packages/setuptools/command/install_lib.py", line 11, in run self.build() File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/distutils/command/install_lib.py", line 107, in build self.run_command('build_ext') File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 87, in run _build_ext.run(self) File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/distutils/command/build_ext.py", line 340, in run self.build_extensions() File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 580, in build_extensions build_ext.build_extensions(self) File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/distutils/command/build_ext.py", line 449, in build_extensions self._build_extensions_serial() File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/distutils/command/build_ext.py", line 474, in _build_extensions_serial self.build_extension(ext) File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 208, in build_extension _build_ext.build_extension(self, ext) File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/distutils/command/build_ext.py", line 528, in build_extension objects = self.compiler.compile(sources, File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 414, in unix_wrap_ninja_compile _write_ninja_file_and_compile_objects( File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1135, in _write_ninja_file_and_compile_objects _run_ninja_build( File "/Users/bkorbar/opt/anaconda3/envs/tv/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1413, in _run_ninja_build raise RuntimeError(message) RuntimeError: Error compiling objects for extension ``` I'll take a look into this a bit later next week, but here is the workaround I found
a few things of note @fepegar : Maybe we should document the build process better? :) |
Thanks @bjuncek, I just tried the following commands with the same luck: conda create -n tv python -y && conda activate tv
conda install -c conda-forge av -y
conda install pytorch -c pytorch -y
git clone https://github.com/pytorch/vision.git --depth 1
cd vision
MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py install |
Silly question, but how do I pull your branch? |
It would be something like
but I've just merged this on master, so you can just pull from torchvision again. The issue got auto-closed due to the merge, but let me know if it doesn't compile for you |
Thanks. I ran the lines form #2220 (comment). Build seems OK. Then I ran |
@fepegar this is a different issue, and I have a couple of ideas of what the problem might be:
|
I'll open a new issue. |
Uh oh!
There was an error while loading. Please reload this page.
🐛 Bug
I can't build
torchvision
from source. I get the following error in the log:To Reproduce
Steps to reproduce the behavior:
Output
Expected behavior
Successful build.
Environment
Additional context
I'm building from source to try the
video_reader
backend: #2216 (comment).The text was updated successfully, but these errors were encountered: