macvim-dev / macvim

Vim - the text editor - for macOS
https://macvim.org
Vim License
7.53k stars 685 forks source link

How To Build for Arm #1246

Closed amadeus closed 2 years ago

amadeus commented 2 years ago

Steps to reproduce

  1. ./configure --with-features=huge --enable-terminal --enable-rubyinterp --enable-python3interp --enable-perlinterp --enable-cscope
  2. make
  3. Attempts to build, but eventually I get this error: ld: symbol(s) not found for architecture arm64, right after a long chain of stuff like this:
Undefined symbols for architecture arm64:
  "_PyBytes_AsString", referenced from:
      _DoPyCommand in if_python3.o
  "_PyBytes_AsStringAndSize", referenced from:
      _StringToLine in if_python3.o
      _StringToChars in if_python3.o
      __ConvertFromPyObject in if_python3.o
  "_PyBytes_FromString", referenced from:
      _ConvertToPyObject in if_python3.o
      _DictionaryListKeys in if_python3.o
      _DictionaryListItems in if_python3.o
      _DictionaryIterNext in if_python3.o
      _OptionsItem in if_python3.o
  "_PyBytes_FromStringAndSize", referenced from:
      _ConvertToPyObject in if_python3.o
      _VimToPython in if_python3.o
  "_PyCapsule_GetPointer", referenced from:
      _convert_dl in if_python3.o
  "_PyCapsule_New", referenced from:
      _convert_dl in if_python3.o
  "_PyDict_GetItemString", referenced from: // etc etc

Expected behaviour

App should be able to build successfully.

Version of Vim and architecture

n/a

Environment

Operating System: macOS Monterey, v12.4

How MacVim was installed

No response

Logs and stack traces

No response

Vim configuration where issue is reproducable

No response

Issue has been tested with given configuration

Issue has been tested with no configuration

Other conditions

eirnym commented 2 years ago

Thank you for an issue,

Could you check which architecture of Python do you have installed?

As logs show I suspect you have x86_64 Python and it definitely won't link with arm64

amadeus commented 2 years ago

Ahh yup, that is most certainly it. I have some python3 packages installed via nix that are not arm based. I will look into that and see if I can rectify it. Thanks for note!