This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CODECOMPOSER: MacOS M2 ARM build errors

Part Number: CODECOMPOSER

Tool/software:

I've installed the latest Mac version I could find - 20.1.1.8__1.7.1 on a Macbook M2

When I try and build one of the example projects it fails with:

ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/_cffi_backend.cpython-311-darwin.so, 0x0002): tried: '/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/_cffi_backend.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/_cffi_backend.cpython-311-darwin.so' (no such file), '/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/_cffi_backend.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
[112]thread '<unnamed>' panicked at 'Python API call failed', /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-0.18.3/src/err/mod.rs:790:5

No errors or warning on installation

Are there any recommended ways to get this working with the build needing an x86_64 library on an ARM64 machine?

Regards

Neil

  • Hello,

    It looks like a post build step failure with conflicting libraries. What exact example are you using?

    Thanks

    ki

  • Hi Ki,

    hello_world_am263px-lp_r5fss0-0_freertos_ti-arm-clang

    It's probably some path issue but I am not sure where that is decided in the CCS build system.

    Regards

    Neil

  • I completely cleaned all python3 versions and any pip installed modules on the Mac.

    I made sure it was only running the OS installed version of python3.

    Rebooted.

    Re-installed CCS.

    Tried building the example project and again it failed.

    The user guide says "The Code Composer Studio installation is dependent on other software packages. For Windows and macOS users these packages will be installed automatically as part of the installation."

    However it obviously does not install the required python modules due to the failures displayed.

    I installed:

    pip3 install construct

    pip3 install pyelftools

    pip3 install cryptography

    Which progressed the build a bit but it now fails on:

    ImportError: dlopen(/Users/neil/Library/Python/3.9/lib/python/site-packages/_cffi_backend.cpython-39-darwin.so, 0x0002): tried: '/Users/neil/Library/Python/3.9/lib/python/site-packages/_cffi_backend.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/neil/Library/Python/3.9/lib/python/site-packages/_cffi_backend.cpython-39-darwin.so' (no such file), '/Users/neil/Library/Python/3.9/lib/python/site-packages/_cffi_backend.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))

    What needs to happen now to fix this incompatible architecture - is it possible to install x86_64 modules on an am64 machine?

    I assume it's some legacy which is why you need Rosetta rather than running native?

    It's a bit disappointing tbh that the first installation is more complicated than needed and the example compile is a failure.

    I also tried this on my personal Mac and got the exact same results.

    Regards

    Neil

  • I finally managed to get builds to succeed.

    Download the x86_64 version of the Python module cffi-1.17.1-cp39-cp39-macosx_10_9_x86_64.whl

    Unzip this in a temporary location.

    Rename ~/Library/Python/3.9/lib/python/site-packages/_cffi_backend.cpython-39-darwin.so to save it

    Copy the extracted x86_64 version of _cffi_backend.cpython-39-darwin.so to ~/Library/Python/3.9/lib/python/site-packages/_cffi_backend.cpython-39-darwin.so

    Approve any Mac security/privacy permissions.

    Run a build.

    Hopefully this can help someone else and TI to fix the installation issue.

    Regards

    Neil

  • What needs to happen now to fix this incompatible architecture - is it possible to install x86_64 modules on an am64 machine?

    I assume it's some legacy which is why you need Rosetta rather than running native?

    Yes. For MacOS on Arm based Mx processors, CCS is not a true arm64 application but a mix of arm64 and x86_64. Hence Rosetta is currently required to run CCS.

    The user guide says "The Code Composer Studio installation is dependent on other software packages. For Windows and macOS users these packages will be installed automatically as part of the installation."

    The issue is that it not CCS itself that needs python but there are some SDK example project that have a post-build step run outside of CCS that is dependent on it.

  • Hopefully this can help someone else and TI to fix the installation issue.

    Yes thank you for sharing this solution. We will look into improving the experience for the future.