intel / intel-ipsec-mb

Intel(R) Multi-Buffer Crypto for IPSec
BSD 3-Clause "New" or "Revised" License
288 stars 87 forks source link

build failure main.c:104:19: error: ‘IMB_FEATURE_BMI2’ undeclared (first use in this function); did you mean ‘IMB_FEATURE_CMOV’? #88

Closed ColinIanKing closed 2 years ago

ColinIanKing commented 2 years ago

Building from head commit 9f3e9eb4a1cf0ec6f5d7d77e5c56d729c3f1cc05

lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu Impish Indri (development branch) Release: 21.10 Codename: impish

gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.2.0-7ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-ZPT0kp/gcc-11-11.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-ZPT0kp/gcc-11-11.2.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 11.2.0 (Ubuntu 11.2.0-7ubuntu2)

Build failure:

main.c: In function ‘print_hw_features’: main.c:104:19: error: ‘IMB_FEATURE_BMI2’ undeclared (first use in this function); did you mean ‘IMB_FEATURE_CMOV’? 104 | { IMB_FEATURE_BMI2, "BMI2" }, | ^~~~ | IMB_FEATURE_CMOV main.c:104:19: note: each undeclared identifier is reported only once for each function it appears in make[1]: [: main.o] Error 1 make[1]: Waiting for unfinished jobs.... utils.c:166:32: warning: argument 2 of type ‘uint8_t[6]’ {aka ‘unsigned char[6]’} with mismatched bound [-Warray-parameter=] 166 | uint8_t arch_support[IMB_ARCH_NUM], | ~~^~~~~~~~ In file included from utils.c:35: utils.h:39:54: note: previously declared as ‘uint8_t ’ {aka ‘unsigned char ’} 39 | int update_flags_and_archs(const char arg, uint8_t arch_support, | ~~~^~~~~~ utils.c:207:21: warning: argument 1 of type ‘uint8_t[6]’ {aka ‘unsigned char[6]’} with mismatched bound [-Warray-parameter=] 207 | detect_arch(uint8_t arch_support[IMB_ARCH_NUM]) | ~~^~~~~~~~ In file included from utils.c:35: utils.h:41:26: note: previously declared as ‘uint8_t ’ {aka ‘unsigned char ’} 41 | int detect_arch(uint8_t *arch_support); | ~~~^~~~~~ make[1]: Leaving directory '/home/cking/repos/intel-ipsec-mb/test'

pablodelara commented 2 years ago

Hi @ColinIanKing! Could you double check if you have another version of the library already installed? It sounds like you might have another header file that does not have IMB_FEATURE_BMI2 (the one in the repo does have it). I don't have access to Ubuntu 21.11 dev or gcc 11, but I'd say the environment is not the problem.

ColinIanKing commented 2 years ago

Ah, yes, I have older headers installed in a dev library. Apologies for the noise, this is my mistake.