M-chip
Bert Gold
bgold04@gmail.com
Wed Dec 4 21:47:29 GMT 2024
I am posting my recent interaction with chatGPT. I hope it sheds light for
some of you.
bgold wrote:
Clang is unable to support pybind11 on a MiniMac M4 computer. Here is my
bug report to the pybind11 group:
https://github.com/pybind/pybind11/issues/5455
ChatGPT said:
ChatGPT
Thank you for sharing the background and your detailed bug report on the
pybind11 GitHub repository. Given the constraints with both clang and gcc
on the macOS ARM64 architecture, here are some tailored suggestions to
proceed effectively:
Key Insights from the Issue
clang and pybind11 Incompatibilities:
pybind11 relies heavily on standard C++ features, which can have nuanced
differences in their implementation between compilers. The failure you
described with clang likely involves macOS-specific quirks in either its
standard library or runtime support for templates and attributes that
pybind11 uses.
gcc on macOS:
While gcc can theoretically work, Homebrew's gcc isn't optimized for native
macOS toolchains. It is more suited for POSIX-compliant environments and
can create cross-platform complications like generating ELF binaries
instead of Mach-O.
Compilers and macOS Toolchain:
Apple tightly integrates its development stack with clang and Xcode, and
deviations (like forcing gcc) often run into edge-case issues due to the
lack of native gcc support.
On Wed, Dec 4, 2024 at 5:09 AM Hans Åberg <hans.aberg_1@icloud.com> wrote:
>
> > On 4 Dec 2024, at 09:52, Simon Wright <simon@pushface.org> wrote:
> >
> > On 3 Dec 2024, at 23:43, Bert Gold via Gcc-help <gcc-help@gcc.gnu.org>
> wrote:
> >> One might expect that using
> >>
> >>
> Cellar/gcc/14.2.0_1/bin/../libexec/gcc/aarch64-apple-darwin24/14/lto-wrapper
> >>
> >> on an M-chip Mac, we would get an ARM64 shared library. But, no!
> >>
> >> This is what I get:
> >>
> >> ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically
> >> linked, BuildID[sha1]=abf0c9f9112ea87ddc35d0e7a99d6259bbbd74be, not
> stripped
> >
> > I get
> > $ file lto-wrapper
> > lto-wrapper: Mach-O 64-bit executable arm64
> >
> > so perhaps you need to reinstall.
> >
> >> Of course the x86_64 won't work with the reduced instruction set of the
> >> M-chip.
> >
> > An x86_64 executable will run on Apple silicon under Rosetta 2
>
> On MacPorts, one gets a warning that the installation is running under
> Rosetta, and should run 'port migrate', after which GCC14 is arm64.
>
>
>
--
Bert Gold
Falmouth, MA
302-507-1827
More information about the Gcc-help
mailing list