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

__builtin / OS X / gcc 4.2.1 #41

Open
textbrowser opened this issue Dec 31, 2017 · 1 comment
Open

__builtin / OS X / gcc 4.2.1 #41

textbrowser opened this issue Dec 31, 2017 · 1 comment

Comments

@textbrowser
Copy link

The __builtin_cpu_supports function is not defined.

cc -g -Wall -Wextra -Wno-unused-parameter -DNTRU_DETECT_SIMD -O2  -c -fPIC src/hash.c -o src/hash.o
src/hash.c:83:9: error: use of unknown builtin '__builtin_cpu_supports' [-Wimplicit-function-declaration]
    if (__builtin_cpu_supports("ssse3") || __builtin_cpu_supports("avx2")) {

https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/X86-Built-in-Functions.html

@masonbrothers
Copy link

masonbrothers commented Mar 18, 2018

I was able to get it to build by using gcc instead of clang. I installed gcc with Homebrew:
brew install gcc

The makefile respects the CC environment variable.

I believe gcc is a symbolic link by default to clang on macOS (or this is at least true after Xcode has been installed). To get around this, I specified the version of gcc that I was using. The versions that bash knows of can be seen by typing in gcc in the console followed by two tabs.

On my computer, I had gcc-7.

To build I used:

export CC=gcc-7
make

Alternatively, I think that gcc could be added to the path before the symbolic link to clang.

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

No branches or pull requests

2 participants