Skip to content
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

Undefined symbols for architecture arm64 when sudo ./install_requirements.sh --pybind coreml #3797

Open
joshuachak opened this issue Jun 1, 2024 · 2 comments
Labels
need-user-input The issue needs more information from the reporter before moving forward

Comments

@joshuachak
Copy link

I am using Macbook Pro M3 Max (MacOS 14.4.1 (23E224)), when doing sudo ./install_requirements.sh --pybind coreml, there is an error:

[100%] Building CXX object examples/models/llama2/custom_ops/CMakeFiles/custom_ops_aot_lib.dir/op_sdpa_aot.cpp.o
  [100%] Linking CXX shared library libcustom_ops_aot_lib.dylib
  Undefined symbols for architecture arm64:
    "c10::throwNullDataPtrError()", referenced from:
        void* c10::TensorImpl::data_impl<void, c10::TensorImpl::mutable_data()::'lambda'()>(c10::TensorImpl::mutable_data()::'lambda'() const&) const in op_sdpa_aot.cpp.o
    "c10::warnDeprecatedDataPtr()", referenced from:
        void* c10::TensorImpl::data_impl<void, c10::TensorImpl::mutable_data()::'lambda'()>(c10::TensorImpl::mutable_data()::'lambda'() const&) const in op_sdpa_aot.cpp.o
    "c10::impl::cow::materialize_cow_storage(c10::StorageImpl&)", referenced from:
        void* c10::TensorImpl::data_impl<void, c10::TensorImpl::mutable_data()::'lambda'()>(c10::TensorImpl::mutable_data()::'lambda'() const&) const in op_sdpa_aot.cpp.o
  ld: symbol(s) not found for architecture arm64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  make[3]: *** [examples/models/llama2/custom_ops/libcustom_ops_aot_lib.dylib] Error 1
  make[2]: *** [examples/models/llama2/custom_ops/CMakeFiles/custom_ops_aot_lib.dir/all] Error 2
  make[1]: *** [examples/models/llama2/custom_ops/CMakeFiles/custom_ops_aot_lib.dir/rule] Error 2
  make: *** [custom_ops_aot_lib] Error 2
  error: command '/opt/miniconda3/envs/executorch/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/miniconda3/envs/executorch/bin/python /opt/miniconda3/envs/executorch/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmplkwva39i
  cwd: /Users/admin/Documents/executorch
  Building wheel for executorch (pyproject.toml) ... error
  ERROR: Failed building wheel for executorch
Failed to build executorch
ERROR: Could not build wheels for executorch, which is required to install pyproject.toml-based projects
WARNING: Location 'pip/' is ignored: it is either a non-existing path or lacks a specific scheme.

Does anyone know how to fix it? Many thanks!!

@joshuachak joshuachak changed the title Undefined symbols for architecture arm64 when sudo ./install_requirements.sh --pybind corem Undefined symbols for architecture arm64 when sudo ./install_requirements.sh --pybind coreml Jun 1, 2024
@mergennachin
Copy link
Contributor

@joshuachak

I can't reproduce locally on the main branch. Which branch and git hash are you using?

@mergennachin mergennachin added the need-user-input The issue needs more information from the reporter before moving forward label Jun 4, 2024
@mergennachin
Copy link
Contributor

Can you try these?

git clean -xfd
pip uninstall executorch
rm -rf cmake-out

And try again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-user-input The issue needs more information from the reporter before moving forward
Projects
None yet
Development

No branches or pull requests

3 participants
@mergennachin @joshuachak and others