Skip to content

Building wheel for executorch (pyproject.toml) did not run successfully. #8874

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

Open
ManojShanmugamTruminds opened this issue Mar 3, 2025 · 17 comments
Assignees
Labels
module: build/install Issues related to the cmake and buck2 builds, and to installing ExecuTorch triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@ManojShanmugamTruminds
Copy link

ManojShanmugamTruminds commented Mar 3, 2025

ld: symbol(s) not found for architecture x86_64
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[3]: *** [extension/llm/custom_ops/CMakeFiles/custom_ops_aot_lib.dir/build.make:271: extension/llm/custom_ops/libcustom_ops_aot_lib.dylib] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:2662: extension/llm/custom_ops/CMakeFiles/custom_ops_aot_lib.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:2669: extension/llm/custom_ops/CMakeFiles/custom_ops_aot_lib.dir/rule] Error 2
gmake: *** [Makefile:858: custom_ops_aot_lib] Error 2
error: command '/opt/anaconda3/envs/et_mps/bin/cmake' failed with exit code 2
error: subprocess-exited-with-error

× Building wheel for executorch (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
full command: /opt/anaconda3/envs/et_mps/bin/python /opt/anaconda3/envs/et_mps/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /var/folders/ys/j_jmfr7n1nlbsc4zl1tqhxmw0000gn/T/tmps4kx1bsc
cwd: /Users/manojshanmugam/executorch
Building wheel for executorch (pyproject.toml) ... error
ERROR: Failed building wheel for executorch
Failed to build executorch
ERROR: Failed to build installable wheels for some pyproject.toml based projects (executorch)
Traceback (most recent call last):
File "/Users/manojshanmugam/executorch/./install_executorch.py", line 257, in
main(sys.argv[1:])
File "/Users/manojshanmugam/executorch/./install_executorch.py", line 232, in main
subprocess.run(
File "/opt/anaconda3/envs/et_mps/lib/python3.10/subprocess.py", line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/opt/anaconda3/envs/et_mps/bin/python', '-m', 'pip', 'install', '.', '--no-build-isolation', '-v', '--extra-index-url', 'https://download.pytorch.org/whl/nightly/cpu']' returned non-zero exit status 1.

cc @larryliu0820 @lucylq

@github-project-automation github-project-automation bot moved this to To triage in ExecuTorch Core Mar 3, 2025
@iseeyuan iseeyuan added module: build/install Issues related to the cmake and buck2 builds, and to installing ExecuTorch triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels Mar 3, 2025
@iseeyuan
Copy link
Contributor

iseeyuan commented Mar 3, 2025

@jathu and @larryliu0820 , could you help on this issue?

@larryliu0820
Copy link
Contributor

Hello @ManojShanmugamTruminds can you run the following command and attach logs?

python -m pip install . --no-build-isolation -vv --extra-index-url https://download.pytorch.org/whl/nightly/cpu

@ManojShanmugamTruminds
Copy link
Author

Tried below command
python -m pip install . --no-build-isolation -vv --extra-index-url https://download.pytorch.org/whl/nightly/cpu

ld: symbol(s) not found for architecture x86_64
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[3]: *** [extension/llm/custom_ops/CMakeFiles/custom_ops_aot_lib.dir/build.make:271: extension/llm/custom_ops/libcustom_ops_aot_lib.dylib] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:1146: extension/llm/custom_ops/CMakeFiles/custom_ops_aot_lib.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:1153: extension/llm/custom_ops/CMakeFiles/custom_ops_aot_lib.dir/rule] Error 2
gmake: *** [Makefile:429: custom_ops_aot_lib] Error 2
error: command '/opt/anaconda3/envs/et_mps/bin/cmake' failed with exit code 2
error: subprocess-exited-with-error

× Building wheel for executorch (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
full command: /opt/anaconda3/envs/et_mps/bin/python3 /opt/anaconda3/envs/et_mps/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /var/folders/ys/j_jmfr7n1nlbsc4zl1tqhxmw0000gn/T/tmpc293jyj4
cwd: /Users/manojshanmugam/executorch
Building wheel for executorch (pyproject.toml) ... error
ERROR: Failed building wheel for executorch
Failed to build executorch
Remote version of pip: 25.0.1
Local version of pip: 25.0
Was pip installed by pip? False
ERROR: Failed to build installable wheels for some pyproject.toml based projects (executorch)
Exception information:
Traceback (most recent call last):
File "/opt/anaconda3/envs/et_mps/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 106, in _run_wrapper
status = _inner_run()
File "/opt/anaconda3/envs/et_mps/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 97, in _inner_run
return self.run(options, args)
File "/opt/anaconda3/envs/et_mps/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 67, in wrapper
return func(self, options, args)
File "/opt/anaconda3/envs/et_mps/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 435, in run
raise InstallationError(
pip._internal.exceptions.InstallationError: Failed to build installable wheels for some pyproject.toml based projects (executorch)
Removed build tracker: '/private/var/folders/ys/j_jmfr7n1nlbsc4zl1tqhxmw0000gn/T/pip-build-tracker-09x1jxyo'

@larryliu0820
Copy link
Contributor

@ManojShanmugamTruminds Hi thanks for the quick reply.

Can you do

python -m pip install . --no-build-isolation -vv --extra-index-url https://download.pytorch.org/whl/nightly/cpu > log.txt 2>&1

And paste log.txt?

@ManojShanmugamTruminds
Copy link
Author

log.txt

@larryliu0820
Copy link
Contributor

  ld: warning: ignoring file '/opt/anaconda3/envs/et_mps/lib/python3.10/site-packages/torch/lib/libtorch_cpu.dylib': found architecture 'arm64', required architecture 'x86_64'

Can you uninstall torch:

pip uninstall torch

And try ExecuTorch again?

@ManojShanmugamTruminds
Copy link
Author

Uninstalled pip uninstall torch . Still getting error

ld: symbol(s) not found for architecture x86_64
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[3]: *** [extension/llm/custom_ops/CMakeFiles/custom_ops_aot_lib.dir/build.make:271: extension/llm/custom_ops/libcustom_ops_aot_lib.dylib] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:2662: extension/llm/custom_ops/CMakeFiles/custom_ops_aot_lib.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:2669: extension/llm/custom_ops/CMakeFiles/custom_ops_aot_lib.dir/rule] Error 2
gmake: *** [Makefile:858: custom_ops_aot_lib] Error 2
error: command '/opt/anaconda3/envs/et_mps/bin/cmake' failed with exit code 2
error: subprocess-exited-with-error

× Building wheel for executorch (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
full command: /opt/anaconda3/envs/et_mps/bin/python /opt/anaconda3/envs/et_mps/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /var/folders/ys/j_jmfr7n1nlbsc4zl1tqhxmw0000gn/T/tmp_yc_q9xq
cwd: /Users/manojshanmugam/executorch
Building wheel for executorch (pyproject.toml) ... error
ERROR: Failed building wheel for executorch
Failed to build executorch
ERROR: Failed to build installable wheels for some pyproject.toml based projects (executorch)
Traceback (most recent call last):
File "/Users/manojshanmugam/executorch/./install_executorch.py", line 257, in
main(sys.argv[1:])
File "/Users/manojshanmugam/executorch/./install_executorch.py", line 232, in main
subprocess.run(
File "/opt/anaconda3/envs/et_mps/lib/python3.10/subprocess.py", line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/opt/anaconda3/envs/et_mps/bin/python', '-m', 'pip', 'install', '.', '--no-build-isolation', '-v', '--extra-index-url', 'https://download.pytorch.org/whl/nightly/cpu']' returned non-zero exit status 1.

@larryliu0820
Copy link
Contributor

Can I get your log.txt again?

@ManojShanmugamTruminds
Copy link
Author

log.txt

@larryliu0820
Copy link
Contributor

Hi sorry I don't think you uninstalled torch properly. Please make sure you don't see anything under

/opt/anaconda3/envs/et_mps/lib/python3.10/site-packages/torch/

After you uninstall torch.

@ManojShanmugamTruminds
Copy link
Author

ManojShanmugamTruminds commented Mar 3, 2025

Still getting same error

log.txt

Image

@larryliu0820
Copy link
Contributor

larryliu0820 commented Mar 4, 2025

Hi can you do

ARCHFLAGS="-arch x86_64" python -m pip install . --no-build-isolation -vv --extra-index-url https://download.pytorch.org/whl/nightly/cpu

or

ARCHFLAGS="-arch arm64" python -m pip install . --no-build-isolation -vv --extra-index-url https://download.pytorch.org/whl/nightly/cpu

@larryliu0820
Copy link
Contributor

Are you on mac m1+?

The thing is your pip is installing torch with a different arch flavor (arm64) than what ExecuTorch expects (x86_64). I think your pip or python is not built for your mac.

@ManojShanmugamTruminds
Copy link
Author

Image

@larryliu0820
Copy link
Contributor

@ManojShanmugamTruminds ok can you try:

ARCHFLAGS="-arch arm64" python -m pip install . --no-build-isolation -vv --extra-index-url https://download.pytorch.org/whl/nightly/cpu

@ManojShanmugamTruminds
Copy link
Author

Tried this command
ARCHFLAGS="-arch arm64" python -m pip install . --no-build-isolation -vv --extra-index-url https://download.pytorch.org/whl/nightly/cpu

ld: symbol(s) not found for architecture x86_64
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[3]: *** [extension/llm/custom_ops/CMakeFiles/custom_ops_aot_lib.dir/build.make:271: extension/llm/custom_ops/libcustom_ops_aot_lib.dylib] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:1146: extension/llm/custom_ops/CMakeFiles/custom_ops_aot_lib.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:1153: extension/llm/custom_ops/CMakeFiles/custom_ops_aot_lib.dir/rule] Error 2
gmake: *** [Makefile:429: custom_ops_aot_lib] Error 2
error: command '/opt/anaconda3/envs/et_mps/bin/cmake' failed with exit code 2
error: subprocess-exited-with-error

× Building wheel for executorch (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
full command: /opt/anaconda3/envs/et_mps/bin/python3 /opt/anaconda3/envs/et_mps/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /var/folders/ys/j_jmfr7n1nlbsc4zl1tqhxmw0000gn/T/tmpjz7q53dp
cwd: /Users/manojshanmugam/executorch
Building wheel for executorch (pyproject.toml) ... error
ERROR: Failed building wheel for executorch
Failed to build executorch
Remote version of pip: 25.0.1
Local version of pip: 25.0
Was pip installed by pip? False
ERROR: Failed to build installable wheels for some pyproject.toml based projects (executorch)
Exception information:
Traceback (most recent call last):
File "/opt/anaconda3/envs/et_mps/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 106, in _run_wrapper
status = _inner_run()
File "/opt/anaconda3/envs/et_mps/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 97, in _inner_run
return self.run(options, args)
File "/opt/anaconda3/envs/et_mps/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 67, in wrapper
return func(self, options, args)
File "/opt/anaconda3/envs/et_mps/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 435, in run
raise InstallationError(
pip._internal.exceptions.InstallationError: Failed to build installable wheels for some pyproject.toml based projects (executorch)
Removed build tracker: '/private/var/folders/ys/j_jmfr7n1nlbsc4zl1tqhxmw0000gn/T/pip-build-tracker-nbj_4atp'

@larryliu0820
Copy link
Contributor

larryliu0820 commented Mar 4, 2025

I think your whole environment is messed up. Your pip thinks you are on x86_64 which is incorrect. Can you start a new conda?

Try:

conda deactivate
CONDA_SUBDIR=osx-arm64 conda create -n et_mps2 python=3.11
conda activate et_mps2
bash ./install_executorch.sh

Source https://towardsdatascience.com/python-conda-environments-for-both-arm64-and-x86-64-on-m1-apple-silicon-147b943ffa55/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: build/install Issues related to the cmake and buck2 builds, and to installing ExecuTorch triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
Status: To triage
Development

No branches or pull requests

4 participants