Skip to content

[User] GCC 7.5.0 compilation failure fix #1633

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wyklq opened this issue May 29, 2023 · 2 comments
Closed

[User] GCC 7.5.0 compilation failure fix #1633

wyklq opened this issue May 29, 2023 · 2 comments
Labels

Comments

@wyklq
Copy link

wyklq commented May 29, 2023

GGML.c is using "_mm256_set_m128i" which is not available in GCC 7.5.0.

The workaround is to port the macro definition in GCC 9 directly to GGML.c.

--- a/ggml.c
+++ b/ggml.c
@@ -188,6 +188,12 @@ typedef double ggml_float;
 #else
 #if !defined(__riscv)
 #include <immintrin.h>
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_set_m128i (__m128i __H, __m128i __L)
+{
+  return _mm256_insertf128_si256 (_mm256_castsi128_si256 (__L), __H, 1);
+}
+
 #endif
 #endif
 #endif
@LostRuins
Copy link
Collaborator

If applying patch as a polyfill, it should be forwards compatible.

@github-actions github-actions bot added the stale label Mar 25, 2024
Copy link
Contributor

github-actions bot commented Apr 9, 2024

This issue was closed because it has been inactive for 14 days since being marked as stale.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants