[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Request for help] Bug: #976479 scrappie: FTBFS: scrappie_matrix.h:5:14: fatal error: immintrin.h: No such file or directory





On Mon, 7 Dec 2020 at 11:49, Nilesh Patra <npatra974@gmail.com> wrote:
Hi Michael

Thanks for the hint, I did this (not yet pushed):

-#include <xmmintrin.h>
-
 /* yes I know, the top of this file is quite ugly */
 
+define SIMDE_ENABLE_NATIVE_ALIASES
+#include <simde/x86/sse.h>

But I end up with the same error that I pasted earlier. Am I missing something in the hint?
Please let me know.

This is because  upstream used a private symbol, __v4sf is not part of the public interface for any x86 SIMD: https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=v4sf

Looking at /usr/lib/gcc/x86_64-linux-gnu/9/include/xmmintrin.h we find the following definition

/* Internal data types for implementing the intrinsics.  */
typedef float __v4sf __attribute__ ((__vector_size__ (16)));

But this doesn't look very portable.

Grepping through the SIMDe source for a portable version, we see that __vector_size__ is used in simde/simde-common.h

#  if \
    HEDLEY_GCC_VERSION_CHECK(4,8,0)
#    define SIMDE_VECTOR(size) __attribute__((__vector_size__(size)))

So we keep looking for a usage of SIMDE_VECTOR involving a float, and in simde/x86/sse.h we find

SIMDE_ALIGN_TO_16 simde_float32  f32 SIMDE_VECTOR(16) SIMDE_MAY_ALIAS;

so the portable thing to emulate the private definition is to do

typedef simde_float32 __v4sf SIMDE_VECTOR(16);

I've done so in a branch at https://salsa.debian.org/med-team/scrappie/-/tree/mr-c-wip

FYI, you mentioned using the porterbox to test, you can also cross-build for arm64 on an amd64 system using cowbuilder-dist.

We can check http://crossqa.debian.net/src/scrappie (The "cross" link on the right side of https://tracker.debian.org/pkg/scrappie) to confirm that cross-building has worked in the past.

cowbuilder-dist sid build scrappie_1.4.2-3.dsc --host-arch arm64

If you have qemu-user-static installed it can even run build-time tests via "--no-auto-cross"

cowbuilder-dist sid build scrappie_1.4.2-3.dsc --host-arch arm64 --no-auto-cross
 

Reply to: