Closed KursatCAKAL closed 1 year ago
I handled the issue by using CLion. Please use Reference_Implementation under "ref" directory. Open File from CLion menu (File -> Open -> ref (or any file name which includes original content))
I installed OpenSSL to my MacOS by using brew package manager. So, look for installed path of OpenSSL.
brew info openssl
Please update your Makefile like below:
CC=/usr/bin/gcc
CFLAGS+= -O3 -march=native -fomit-frame-pointer
LDFLAGS+= -L/opt/homebrew/opt/openssl@3/lib -lssl -lcrypto
OPENSSL_INCLUDE = /opt/homebrew/opt/openssl@3/include
OPENSSL_LIB = /opt/homebrew/opt/openssl@3/lib
SOURCES= cbd.c fips202.c indcpa.c kem.c ntt.c poly.c polyvec.c PQCgenKAT_kem.c reduce.c rng.c verify.c symmetric-shake.c
HEADERS= api.h cbd.h fips202.h indcpa.h ntt.h params.h poly.h polyvec.h reduce.h rng.h verify.h symmetric.h
PQCgenKAT_kem: $(HEADERS) $(SOURCES)
$(CC) $(CFLAGS) -I$(OPENSSL_INCLUDE) -L$(OPENSSL_LIB) -o $@ $(SOURCES) $(LDFLAGS)
.PHONY: clean
clean:
-rm PQCgenKAT_kem
Hi,
Did you test the repo in a Mac? Are you sure working fine?
I am getting below error. I think issue is an architecture related paradigm. I want to know if you have successfully compiled repo in your Mac PCs. If not, I will change my platform to linux.
I think the error is related with below issue. Could you please validate me ?
ISSUE 👍🏻
ERROR MESSAGE 👍🏻
pcs@pcs-MacBook-Air avx2 % make cc -I/opt/homebrew/opt/openssl@3.1/include -Wall -Wextra -Wpedantic -Wmissing-prototypes -Wredundant-decls -Wshadow -Wpointer-arith -mavx2 -mbmi2 -mpopcnt -maes -march=native -mtune=native -O3 -fomit-frame-pointer -c keccak4x/KeccakP-1600-times4-SIMD256.c -o keccak4x/KeccakP-1600-times4-SIMD256.o clang: warning: argument unused during compilation: '-mavx2' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-mbmi2' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-mpopcnt' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-maes' [-Wunused-command-line-argument] In file included from keccak4x/KeccakP-1600-times4-SIMD256.c:19: /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/smmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"
error "This header is only meant to be used on x86 and x64 architecture"
^ In file included from keccak4x/KeccakP-1600-times4-SIMD256.c:19: In file included from /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/smmintrin.h:17: /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/tmmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"
error "This header is only meant to be used on x86 and x64 architecture"
^ In file included from keccak4x/KeccakP-1600-times4-SIMD256.c:19: In file included from /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/smmintrin.h:17: In file included from /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/tmmintrin.h:17: /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/pmmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"
error "This header is only meant to be used on x86 and x64 architecture"
^ In file included from keccak4x/KeccakP-1600-times4-SIMD256.c:19: In file included from /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/smmintrin.h:17: In file included from /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/tmmintrin.h:17: In file included from /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/pmmintrin.h:17: /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/emmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"
error "This header is only meant to be used on x86 and x64 architecture"
^ In file included from keccak4x/KeccakP-1600-times4-SIMD256.c:19: In file included from /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/smmintrin.h:17: In file included from /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/tmmintrin.h:17: In file included from /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/pmmintrin.h:17: In file included from /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/emmintrin.h:17: /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/xmmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"
error "This header is only meant to be used on x86 and x64 architecture"
^ In file included from keccak4x/KeccakP-1600-times4-SIMD256.c:19: In file included from /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/smmintrin.h:17: In file included from /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/tmmintrin.h:17: In file included from /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/pmmintrin.h:17: In file included from /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/emmintrin.h:17: In file included from /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/xmmintrin.h:17: /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/mmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"
error "This header is only meant to be used on x86 and x64 architecture"
^ /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/mmintrin.h:54:12: error: invalid conversion between vector type 'm64' (vector of 1 'long long' value) and integer type 'int' of different size return (m64)builtin_ia32_vec_init_v2si(i, 0); ^
~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/mmintrin.h:133:12: error: invalid conversion between vector type 'm64' (vector of 1 'long long' value) and integer type 'int' of different size return (m64)builtin_ia32_packsswb((v4hi)m1, (v4hi)m2); ^~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/mmintrin.h:163:12: error: invalid conversion between vector type 'm64' (vector of 1 'long long' value) and integer type 'int' of different size return (m64)builtin_ia32_packssdw((v2si)m1, (v2si)m2); ^~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/mmintrin.h:193:12: error: invalid conversion between vector type 'm64' (vector of 1 'long long' value) and integer type 'int' of different size return (m64)builtin_ia32_packuswb((v4hi)m1, (v4hi)m2); ^~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/mmintrin.h:220:12: error: invalid conversion between vector type 'm64' (vector of 1 'long long' value) and integer type 'int' of different size return (m64)builtin_ia32_punpckhbw((v8qi)m1, (v8qi)m2); ^~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/mmintrin.h:243:12: error: invalid conversion between vector type 'm64' (vector of 1 'long long' value) and integer type 'int' of different size return (m64)builtin_ia32_punpckhwd((v4hi)m1, (v4hi)m2); ^~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/mmintrin.h:264:12: error: invalid conversion between vector type 'm64' (vector of 1 'long long' value) and integer type 'int' of different size return (m64)builtin_ia32_punpckhdq((v2si)m1, (v2si)m2); ^~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/mmintrin.h:291:12: error: invalid conversion between vector type 'm64' (vector of 1 'long long' value) and integer type 'int' of different size return (m64)builtin_ia32_punpcklbw((v8qi)m1, (v8qi)m2); ^~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/mmintrin.h:314:12: error: invalid conversion between vector type 'm64' (vector of 1 'long long' value) and integer type 'int' of different size return (m64)builtin_ia32_punpcklwd((v4hi)m1, (v4hi)m2); ^~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/mmintrin.h:335:12: error: invalid conversion between vector type 'm64' (vector of 1 'long long' value) and integer type 'int' of different size return (m64)builtin_ia32_punpckldq((v2si)m1, (v2si)m2); ^~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/mmintrin.h:356:12: error: invalid conversion between vector type 'm64' (vector of 1 'long long' value) and integer type 'int' of different size return (m64)builtin_ia32_paddb((v8qi)m1, (v8qi)m2); ^~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/mmintrin.h:377:12: error: invalid conversion between vector type 'm64' (vector of 1 'long long' value) and integer type 'int' of different size return (m64)builtin_ia32_paddw((v4hi)m1, (v4hi)m2); ^~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/mmintrin.h:398:12: error: invalid conversion between vector type 'm64' (vector of 1 'long long' value) and integer type 'int' of different size return (m64)builtin_ia32_paddd((v2si)m1, (v2si)m2); ^~~~~~~~~~~~~~~ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated.