Opened 4 years ago

Closed 3 years ago

#62870 closed defect (wontfix)

gerbil: builds failing for Big Sur ARM; undeclared identifiers for intrinsics

Reported by: mascguy (Christopher Nielsen) Owned by: neverpanic (Clemens Lang)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: gerbil

Description

The following compilation errors are occurring on our Big Sur ARM buildbot, with complaints about missing intrinsics:

In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gerbil/gerbil/work/gerbil-5a7705fe1170f812a6cd0e79a1a853f4d8aec2cf/core/multi_img/multi_img_ext.cpp:13:
/Library/Developer/CommandLineTools/usr/lib/clang/12.0.5/include/mmintrin.h:33:5: error: use of undeclared identifier '__builtin_ia32_emms'; did you mean '__builtin_isless'?
    __builtin_ia32_emms();
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/c++/v1/math.h:649:12: note: '__builtin_isless' declared here
    return isless(__lcpp_x, __lcpp_y);
           ^
/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/math.h:545:22: note: expanded from macro 'isless'
#define isless(x, y) __builtin_isless((x),(y))
                     ^
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gerbil/gerbil/work/gerbil-5a7705fe1170f812a6cd0e79a1a853f4d8aec2cf/core/multi_img/multi_img_ext.cpp:13:
/Library/Developer/CommandLineTools/usr/lib/clang/12.0.5/include/mmintrin.h:33:25: error: too few arguments to function call, expected 2, have 0
    __builtin_ia32_emms();
                        ^
/Library/Developer/CommandLineTools/usr/lib/clang/12.0.5/include/mmintrin.h:50:19: error: use of undeclared identifier '__builtin_ia32_vec_init_v2si'
    return (__m64)__builtin_ia32_vec_init_v2si(__i, 0);
                  ^
/Library/Developer/CommandLineTools/usr/lib/clang/12.0.5/include/mmintrin.h:67:12: error: use of undeclared identifier '__builtin_ia32_vec_ext_v2si'
    return __builtin_ia32_vec_ext_v2si((__v2si)__m, 0);
           ^

[...etc, etc...]

Full log attached.

Attachments (1)

gerbil-buildbot-compile-failure-big-sur-arm.txt.gz (6.1 KB) - added by mascguy (Christopher Nielsen) 4 years ago.

Download all attachments as: .zip

Change History (14)

Changed 4 years ago by mascguy (Christopher Nielsen)

comment:1 Changed 4 years ago by mascguy (Christopher Nielsen)

Reviewing the compilation arguments passed to Clang, I'm seeing -msse2, which I think (?) is Intel-specific. It should probably be something like -march=native.

I'd need someone to confirm though...

comment:2 Changed 4 years ago by Christopher Nielsen <mascguy@…>

Resolution: fixed
Status: assignedclosed

In 4e33117dfbc71b2b229693c146ac66111d2f4aeb/macports-ports (master):

gerbil: patch to fix ARM build

Closes: #62870

comment:3 Changed 4 years ago by mascguy (Christopher Nielsen)

Resolution: fixed
Status: closedreopened

Hmmmm, -march=native doesn't work for ARM builds. Might be easier to simply not specify anything for the ARM case...

comment:4 Changed 4 years ago by Christopher Nielsen <mascguy@…>

Resolution: fixed
Status: reopenedclosed

In 139e4f3125fb3230036ef40a2ba12b3f786acb46/macports-ports (master):

gerbil: fix ARM build, take 2

Closes: #62870

comment:5 Changed 4 years ago by mascguy (Christopher Nielsen)

Resolution: fixed
Status: closedreopened

Still not working, sigh. Back to the drawing board...

comment:6 Changed 4 years ago by jmroot (Joshua Root)

I think the real question is why it's including mmintrin.h at all, since that is an MMX-specific file.

comment:7 Changed 4 years ago by jmroot (Joshua Root)

BTW, only VoleModuleMacros.cmake uses the enable_sse2 macro. Removing it there would likely make more sense than changing the macro's definition.

comment:8 Changed 4 years ago by mascguy (Christopher Nielsen)

Great points Josh, I'll take a look at the code.

Last edited 4 years ago by mascguy (Christopher Nielsen) (previous) (diff)

comment:9 Changed 4 years ago by mascguy (Christopher Nielsen)

It looks like the port is directly utilizing Intel intrinsics, so we'll need to add a shim like simde to fill in the gaps. Thankfully we already have a port for that, so I'll see if I can integrate it into the port for ARM builds.

Local testing is going to be a challenge without an M1 Mac, but we'll see...

Last edited 4 years ago by mascguy (Christopher Nielsen) (previous) (diff)

comment:10 Changed 4 years ago by mascguy (Christopher Nielsen)

Hmmmm. This might be doable, if we patch the source files to include the appropriate simde headers, rather than mminstrin.h and friends. Though this is turning into a mini-project, which may not be worth the trouble.

Plus I'd hate to deprive the maintainer of this challenge... :-)

comment:11 Changed 4 years ago by Christopher Nielsen <mascguy@…>

In fd6f5ed31e329bd3a7df21448115104869ac4fe1/macports-ports (master):

gerbil: revert ARM build fix

See: #62870

comment:12 Changed 3 years ago by mascguy (Christopher Nielsen)

Clemens, is this something that would be worth tackling? If not, we can close this as "wontfix."

comment:13 Changed 3 years ago by mascguy (Christopher Nielsen)

Resolution: wontfix
Status: reopenedclosed

Let's close this for now. We can always revisit later, if there's interest in an ARM build.

Note: See TracTickets for help on using tickets.