-
Notifications
You must be signed in to change notification settings - Fork 50
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
Compile error on Raspbian "Buster" #40
Comments
Try something like this:
```
#if defined(__x86_64__)
// checkAvxSupport
//
// Tests the underlying platform for AVX support. 2020 needs AVX support
to run
// in real-time, and old processors do not offer AVX support
//
void __cpuid(int* cpuinfo, int info)
{
__asm__ __volatile__(
"xchg %%ebx, %%edi;"
"cpuid;"
"xchg %%ebx, %%edi;"
:"=a" (cpuinfo[0]), "=D" (cpuinfo[1]), "=c" (cpuinfo[2]), "=d"
(cpuinfo[3])
:"0" (info)
);
}
// These methods are defined for Windows but must be created otherwise
unsigned long long __xgetbv(unsigned int index)
{
unsigned int eax, edx;
__asm__ __volatile__(
"xgetbv;"
: "=a" (eax), "=d"(edx)
: "c" (index)
);
return ((unsigned long long)edx << 32) | eax;
}
void MainFrame::checkAvxSupport(void)
{
int cpuinfo[4];
__cpuid(cpuinfo, 1);
bool avxSupported = false;
avxSupported = cpuinfo[2] & (1 << 28) || false;
bool osxsaveSupported = cpuinfo[2] & (1 << 27) || false;
if (osxsaveSupported && avxSupported)
{
// _XCR_XFEATURE_ENABLED_MASK = 0
unsigned long long xcrFeatureMask = __xgetbv(0);
avxSupported = (xcrFeatureMask & 0x6) == 0x6;
}
isAvxPresent = false;
}
#else
void MainFrame::checkAvxSupport(void)
{
isAvxPresent = false;
}
#endif
```
|
Great stuff! Regards, Thorsten |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
i tried to build the latest freedv on an Raspberry Pi 3 on Raspbian "Buster".
Codec2 and LPCNet seems to build well, but when compiling freedv-gui, the build process stops at about 25% with the following error:
Maybe this part of code isn't supported on ARM targets.
Any solutions how to solve?
Thanks in advance.
Regards, Thorsten
The text was updated successfully, but these errors were encountered: