Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Builds fail on AMD without flags #93

Closed
KeeJef opened this issue Dec 4, 2018 · 6 comments
Closed

Builds fail on AMD without flags #93

KeeJef opened this issue Dec 4, 2018 · 6 comments
Labels
bug Something isn't working

Comments

@KeeJef
Copy link
Collaborator

KeeJef commented Dec 4, 2018

Builds still failing with fastadd errors if make is not passed

CFLAGS='-march=haswell -mfma' CXXFLAGS='-march=haswell -mfma'

We should include some kind of fix for this since AMD architecture is very common and we don't want people to have to go searching for the flags just to build Lokinet

In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/immintrin.h:85:0, from /home/dev/loki-network/crypto/libntrup/src/avx/mult.c:3: /home/dev/loki-network/crypto/libntrup/src/avx/mult.c: In function ‘fastadd’: /usr/lib/gcc/x86_64-linux-gnu/7/include/fmaintrin.h:63:1: error: inlining failed in call to always_inline ‘_mm256_fmadd_ps’: target specific option mismatch _mm256_fmadd_ps (__m256 __A, __m256 __B, __m256 __C) ^~~~~~~~~~~~~~~ /home/dev/loki-network/crypto/libntrup/src/avx/mult.c:128:10: note: called from here return _mm256_fmadd_ps(y, v1_float, x); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/immintrin.h:85:0, from /home/dev/loki-network/crypto/libntrup/src/avx/mult.c:3: /usr/lib/gcc/x86_64-linux-gnu/7/include/fmaintrin.h:63:1: error: inlining failed in call to always_inline ‘_mm256_fmadd_ps’: target specific option mismatch _mm256_fmadd_ps (__m256 __A, __m256 __B, __m256 __C) ^~~~~~~~~~~~~~~ /home/dev/loki-network/crypto/libntrup/src/avx/mult.c:128:10: note: called from here return _mm256_fmadd_ps(y, v1_float, x); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This issue is a replication of #92

@neuroscr neuroscr added the bug Something isn't working label Dec 4, 2018
@despair86
Copy link
Contributor

despair86 commented Dec 4, 2018

from the wikipedia page on FMA3/FMA4:

Zen: WikiChip's testing shows FMA4 still appears to work (under the conditions of the tests) despite not being officially supported and not even reported by CPUID. 
This has also been confirmed by Agner.[5] But other tests gave wrong results.[6] 
AMD Official Web Site FMA4 Support Note ZEN CPUs = AMD ThreadRipper 1900x, R7 Pro 1800, 1700, R5 Pro 1600, 1500, R3 Pro 1300, 1200, R3 2200G, R5 2400G.[7][8][9]

GCC and clang go on what CPUID returns for FPU feature flags

@KeeJef
Copy link
Collaborator Author

KeeJef commented Dec 12, 2018

We should work out how to do CPU detection to rectify this bug its really annoying :(

@KeeJef
Copy link
Collaborator Author

KeeJef commented Dec 12, 2018

confirming that #138 fixes this for me

@neuroscr
Copy link
Contributor

@KeeJef you mean AMD_RYZEN_HACK makes it compile for you?

I'd like to keep the issue open until we can actually get a build-time test, if that's possible.

@KeeJef
Copy link
Collaborator Author

KeeJef commented Dec 13, 2018

Yes AMD_RYZEN_HACK makes it compile without needing the above flags

@despair86
Copy link
Contributor

despair86 commented Dec 13, 2018

ye

that's because it fills in those flags for you -march=native -mavx -mavx2 -mfma -mfpmath=sse (yes that last one is there because multilib....there's probably 6 people that are going to throw the -m32 switch in there)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants