intel / linux-sgx

Intel SGX for Linux*
https://www.intel.com/content/www/us/en/developer/tools/software-guard-extensions/linux-overview.html
Other
1.33k stars 543 forks source link

Error when trying to build SampleDNNL #938

Open xenshinu opened 1 year ago

xenshinu commented 1 year ago

I tried to build the "SampleDNNL" project but it returns error when compile libenclave.so. I followed the README to install dnnl and copy libs and headers, but a symbol is undefined.

undefined reference to `dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)64, (dnnl_data_type_t)3, (dnnl_data_type_t)3, (dnnl_data_type_t)3>::cell_execution_gru(dnnl::impl::cpu::rnn_utils::rnn_conf_t const&, float*, float*, float*, float**, float**, float**, float*, float*, float*, float*, float*, float*, float*, float*, float*, float*, float*, float*) const'

I don't see any header file include that in sgx_dnnl. The full output is as following,

make[1]: Entering directory '/home/liuxs/intel/linux-sgx/SampleCode/SampleDNNL'
Using built-in specs.
COLLECT_GCC=g++
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.3.0-1ubuntu1~22.04' --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-xKiWfi/gcc-11-11.3.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-xKiWfi/gcc-11-11.3.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.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04)
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-o' 'libenclave.so' '-nostdlib' '-nodefaultlibs' '-nostartfiles' '-L/opt/intel/sgxsdk/lib64' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'libenclave.so.'
 /usr/lib/gcc/x86_64-linux-gnu/11/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/11/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper -plugin-opt=-fresolution=/tmp/ccgGpjUh.res --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o libenclave.so -L/opt/intel/sgxsdk/lib64 -L/usr/lib/gcc/x86_64-linux-gnu/11 -L/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/11/../../.. Enclave/Enclave_t.o Enclave/cnn_inference_f32_c.o Enclave/cpu_cnn_training_f32_c.o Enclave/Enclave.o Enclave/cnn_inference_f32_cpp.o Enclave/cnn_inference_int8_cpp.o Enclave/cnn_training_f32_cpp.o Enclave/cpu_rnn_inference_f32_cpp.o Enclave/cpu_rnn_inference_int8_cpp.o Enclave/getting_started.o Enclave/memory_format_propagation.o Enclave/rnn_training_f32_cpp.o -z relro -z now -z noexecstack --no-undefined --whole-archive -lsgx_trts --no-whole-archive --start-group -lsgx_tstdc -lsgx_tcxx -lsgx_dnnl -lsgx_omp -lsgx_pthread -lsgx_tcrypto -lsgx_tservice --end-group --version-script=Enclave/Enclave.lds -Bstatic -Bsymbolic --no-undefined -pie -eenclave_entry --export-dynamic --defsym __ImageBase=0 --gc-sections
/usr/local/bin/ld: /opt/intel/sgxsdk/lib64/libsgx_dnnl.a(cpu_engine.cpp.o): in function `dnnl_status_t dnnl_engine::get_primitive<dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)128, (dnnl_data_type_t)2, (dnnl_data_type_t)2, (dnnl_data_type_t)3>::pd_t::create_primitive(dnnl_primitive**) const::{lambda()#1}>(dnnl_primitive**, dnnl_primitive_desc const*, dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)128, (dnnl_data_type_t)2, (dnnl_data_type_t)2, (dnnl_data_type_t)3>::pd_t::create_primitive(dnnl_primitive**) const::{lambda()#1} const&, bool)':
cpu_engine.cpp:(.text._ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t128EL16dnnl_data_type_t2ELS6_2ELS6_3EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b[_ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t128EL16dnnl_data_type_t2ELS6_2ELS6_3EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b]+0x646): undefined reference to `dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)128, (dnnl_data_type_t)2, (dnnl_data_type_t)2, (dnnl_data_type_t)3>::cell_execution_gru_lbr(dnnl::impl::cpu::rnn_utils::rnn_conf_t const&, dnnl::impl::bfloat16_t*, float*, float*, dnnl::impl::bfloat16_t**, dnnl::impl::bfloat16_t**, float**, dnnl::impl::bfloat16_t*, dnnl::impl::bfloat16_t*, float*, float*, float*, float*, float*, float*, dnnl::impl::bfloat16_t*, dnnl::impl::bfloat16_t*, dnnl::impl::bfloat16_t*, dnnl::impl::bfloat16_t*) const'
/usr/local/bin/ld: cpu_engine.cpp:(.text._ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t128EL16dnnl_data_type_t2ELS6_2ELS6_3EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b[_ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t128EL16dnnl_data_type_t2ELS6_2ELS6_3EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b]+0x6bb): undefined reference to `dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)128, (dnnl_data_type_t)2, (dnnl_data_type_t)2, (dnnl_data_type_t)3>::cell_execution_gru(dnnl::impl::cpu::rnn_utils::rnn_conf_t const&, dnnl::impl::bfloat16_t*, float*, float*, dnnl::impl::bfloat16_t**, dnnl::impl::bfloat16_t**, float**, dnnl::impl::bfloat16_t*, dnnl::impl::bfloat16_t*, float*, float*, float*, float*, float*, float*, dnnl::impl::bfloat16_t*, dnnl::impl::bfloat16_t*, dnnl::impl::bfloat16_t*, dnnl::impl::bfloat16_t*) const'
/usr/local/bin/ld: cpu_engine.cpp:(.text._ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t128EL16dnnl_data_type_t2ELS6_2ELS6_3EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b[_ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t128EL16dnnl_data_type_t2ELS6_2ELS6_3EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b]+0x6e3): undefined reference to `dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)128, (dnnl_data_type_t)2, (dnnl_data_type_t)2, (dnnl_data_type_t)3>::cell_execution(dnnl::impl::cpu::rnn_utils::rnn_conf_t const&, dnnl::impl::bfloat16_t*, float*, float*, dnnl::impl::bfloat16_t**, dnnl::impl::bfloat16_t**, float**, dnnl::impl::bfloat16_t*, dnnl::impl::bfloat16_t*, float*, float*, float*, float*, float*, float*, dnnl::impl::bfloat16_t*, dnnl::impl::bfloat16_t*, dnnl::impl::bfloat16_t*, dnnl::impl::bfloat16_t*) const'
/usr/local/bin/ld: /opt/intel/sgxsdk/lib64/libsgx_dnnl.a(cpu_engine.cpp.o): in function `dnnl_status_t dnnl_engine::get_primitive<dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)128, (dnnl_data_type_t)3, (dnnl_data_type_t)3, (dnnl_data_type_t)3>::pd_t::create_primitive(dnnl_primitive**) const::{lambda()#1}>(dnnl_primitive**, dnnl_primitive_desc const*, dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)128, (dnnl_data_type_t)3, (dnnl_data_type_t)3, (dnnl_data_type_t)3>::pd_t::create_primitive(dnnl_primitive**) const::{lambda()#1} const&, bool)':
cpu_engine.cpp:(.text._ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t128EL16dnnl_data_type_t3ELS6_3ELS6_3EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b[_ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t128EL16dnnl_data_type_t3ELS6_3ELS6_3EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b]+0x646): undefined reference to `dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)128, (dnnl_data_type_t)3, (dnnl_data_type_t)3, (dnnl_data_type_t)3>::cell_execution_gru_lbr(dnnl::impl::cpu::rnn_utils::rnn_conf_t const&, float*, float*, float*, float**, float**, float**, float*, float*, float*, float*, float*, float*, float*, float*, float*, float*, float*, float*) const'
/usr/local/bin/ld: cpu_engine.cpp:(.text._ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t128EL16dnnl_data_type_t3ELS6_3ELS6_3EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b[_ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t128EL16dnnl_data_type_t3ELS6_3ELS6_3EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b]+0x6bb): undefined reference to `dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)128, (dnnl_data_type_t)3, (dnnl_data_type_t)3, (dnnl_data_type_t)3>::cell_execution_gru(dnnl::impl::cpu::rnn_utils::rnn_conf_t const&, float*, float*, float*, float**, float**, float**, float*, float*, float*, float*, float*, float*, float*, float*, float*, float*, float*, float*) const'
/usr/local/bin/ld: cpu_engine.cpp:(.text._ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t128EL16dnnl_data_type_t3ELS6_3ELS6_3EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b[_ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t128EL16dnnl_data_type_t3ELS6_3ELS6_3EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b]+0x6e3): undefined reference to `dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)128, (dnnl_data_type_t)3, (dnnl_data_type_t)3, (dnnl_data_type_t)3>::cell_execution(dnnl::impl::cpu::rnn_utils::rnn_conf_t const&, float*, float*, float*, float**, float**, float**, float*, float*, float*, float*, float*, float*, float*, float*, float*, float*, float*, float*) const'
/usr/local/bin/ld: /opt/intel/sgxsdk/lib64/libsgx_dnnl.a(cpu_engine.cpp.o): in function `dnnl_status_t dnnl_engine::get_primitive<dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)64, (dnnl_data_type_t)6, (dnnl_data_type_t)5, (dnnl_data_type_t)4>::pd_t::create_primitive(dnnl_primitive**) const::{lambda()#1}>(dnnl_primitive**, dnnl_primitive_desc const*, dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)64, (dnnl_data_type_t)6, (dnnl_data_type_t)5, (dnnl_data_type_t)4>::pd_t::create_primitive(dnnl_primitive**) const::{lambda()#1} const&, bool)':
cpu_engine.cpp:(.text._ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t64EL16dnnl_data_type_t6ELS6_5ELS6_4EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b[_ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t64EL16dnnl_data_type_t6ELS6_5ELS6_4EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b]+0x5fe): undefined reference to `dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)64, (dnnl_data_type_t)6, (dnnl_data_type_t)5, (dnnl_data_type_t)4>::cell_execution_gru_lbr(dnnl::impl::cpu::rnn_utils::rnn_conf_t const&, unsigned char*, float*, int*, signed char**, signed char**, float**, unsigned char*, unsigned char*, float*, int*, int*, int*, int*, int*, unsigned char*, int*, unsigned char*, int*) const'
/usr/local/bin/ld: cpu_engine.cpp:(.text._ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t64EL16dnnl_data_type_t6ELS6_5ELS6_4EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b[_ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t64EL16dnnl_data_type_t6ELS6_5ELS6_4EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b]+0x67b): undefined reference to `dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)64, (dnnl_data_type_t)6, (dnnl_data_type_t)5, (dnnl_data_type_t)4>::cell_execution(dnnl::impl::cpu::rnn_utils::rnn_conf_t const&, unsigned char*, float*, int*, signed char**, signed char**, float**, unsigned char*, unsigned char*, float*, int*, int*, int*, int*, int*, unsigned char*, int*, unsigned char*, int*) const'
/usr/local/bin/ld: cpu_engine.cpp:(.text._ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t64EL16dnnl_data_type_t6ELS6_5ELS6_4EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b[_ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t64EL16dnnl_data_type_t6ELS6_5ELS6_4EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b]+0x6a3): undefined reference to `dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)64, (dnnl_data_type_t)6, (dnnl_data_type_t)5, (dnnl_data_type_t)4>::cell_execution_gru(dnnl::impl::cpu::rnn_utils::rnn_conf_t const&, unsigned char*, float*, int*, signed char**, signed char**, float**, unsigned char*, unsigned char*, float*, int*, int*, int*, int*, int*, unsigned char*, int*, unsigned char*, int*) const'
/usr/local/bin/ld: /opt/intel/sgxsdk/lib64/libsgx_dnnl.a(cpu_engine.cpp.o): in function `dnnl_status_t dnnl_engine::get_primitive<dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)64, (dnnl_data_type_t)2, (dnnl_data_type_t)2, (dnnl_data_type_t)3>::pd_t::create_primitive(dnnl_primitive**) const::{lambda()#1}>(dnnl_primitive**, dnnl_primitive_desc const*, dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)64, (dnnl_data_type_t)2, (dnnl_data_type_t)2, (dnnl_data_type_t)3>::pd_t::create_primitive(dnnl_primitive**) const::{lambda()#1} const&, bool)':
cpu_engine.cpp:(.text._ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t64EL16dnnl_data_type_t2ELS6_2ELS6_3EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b[_ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t64EL16dnnl_data_type_t2ELS6_2ELS6_3EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b]+0x5fe): undefined reference to `dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)64, (dnnl_data_type_t)2, (dnnl_data_type_t)2, (dnnl_data_type_t)3>::cell_execution_gru_lbr(dnnl::impl::cpu::rnn_utils::rnn_conf_t const&, dnnl::impl::bfloat16_t*, float*, float*, dnnl::impl::bfloat16_t**, dnnl::impl::bfloat16_t**, float**, dnnl::impl::bfloat16_t*, dnnl::impl::bfloat16_t*, float*, float*, float*, float*, float*, float*, dnnl::impl::bfloat16_t*, float*, dnnl::impl::bfloat16_t*, float*) const'
/usr/local/bin/ld: cpu_engine.cpp:(.text._ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t64EL16dnnl_data_type_t2ELS6_2ELS6_3EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b[_ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t64EL16dnnl_data_type_t2ELS6_2ELS6_3EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b]+0x67b): undefined reference to `dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)64, (dnnl_data_type_t)2, (dnnl_data_type_t)2, (dnnl_data_type_t)3>::cell_execution(dnnl::impl::cpu::rnn_utils::rnn_conf_t const&, dnnl::impl::bfloat16_t*, float*, float*, dnnl::impl::bfloat16_t**, dnnl::impl::bfloat16_t**, float**, dnnl::impl::bfloat16_t*, dnnl::impl::bfloat16_t*, float*, float*, float*, float*, float*, float*, dnnl::impl::bfloat16_t*, float*, dnnl::impl::bfloat16_t*, float*) const'
/usr/local/bin/ld: cpu_engine.cpp:(.text._ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t64EL16dnnl_data_type_t2ELS6_2ELS6_3EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b[_ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t64EL16dnnl_data_type_t2ELS6_2ELS6_3EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b]+0x6a3): undefined reference to `dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)64, (dnnl_data_type_t)2, (dnnl_data_type_t)2, (dnnl_data_type_t)3>::cell_execution_gru(dnnl::impl::cpu::rnn_utils::rnn_conf_t const&, dnnl::impl::bfloat16_t*, float*, float*, dnnl::impl::bfloat16_t**, dnnl::impl::bfloat16_t**, float**, dnnl::impl::bfloat16_t*, dnnl::impl::bfloat16_t*, float*, float*, float*, float*, float*, float*, dnnl::impl::bfloat16_t*, float*, dnnl::impl::bfloat16_t*, float*) const'
/usr/local/bin/ld: /opt/intel/sgxsdk/lib64/libsgx_dnnl.a(cpu_engine.cpp.o): in function `dnnl_status_t dnnl_engine::get_primitive<dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)64, (dnnl_data_type_t)3, (dnnl_data_type_t)3, (dnnl_data_type_t)3>::pd_t::create_primitive(dnnl_primitive**) const::{lambda()#1}>(dnnl_primitive**, dnnl_primitive_desc const*, dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)64, (dnnl_data_type_t)3, (dnnl_data_type_t)3, (dnnl_data_type_t)3>::pd_t::create_primitive(dnnl_primitive**) const::{lambda()#1} const&, bool)':
cpu_engine.cpp:(.text._ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t64EL16dnnl_data_type_t3ELS6_3ELS6_3EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b[_ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t64EL16dnnl_data_type_t3ELS6_3ELS6_3EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b]+0x5fe): undefined reference to `dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)64, (dnnl_data_type_t)3, (dnnl_data_type_t)3, (dnnl_data_type_t)3>::cell_execution_gru_lbr(dnnl::impl::cpu::rnn_utils::rnn_conf_t const&, float*, float*, float*, float**, float**, float**, float*, float*, float*, float*, float*, float*, float*, float*, float*, float*, float*, float*) const'
/usr/local/bin/ld: cpu_engine.cpp:(.text._ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t64EL16dnnl_data_type_t3ELS6_3ELS6_3EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b[_ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t64EL16dnnl_data_type_t3ELS6_3ELS6_3EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b]+0x67b): undefined reference to `dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)64, (dnnl_data_type_t)3, (dnnl_data_type_t)3, (dnnl_data_type_t)3>::cell_execution(dnnl::impl::cpu::rnn_utils::rnn_conf_t const&, float*, float*, float*, float**, float**, float**, float*, float*, float*, float*, float*, float*, float*, float*, float*, float*, float*, float*) const'
/usr/local/bin/ld: cpu_engine.cpp:(.text._ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t64EL16dnnl_data_type_t3ELS6_3ELS6_3EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b[_ZN11dnnl_engine13get_primitiveIZNK4dnnl4impl3cpu17_ref_rnn_common_tIL16dnnl_prop_kind_t64EL16dnnl_data_type_t3ELS6_3ELS6_3EE4pd_t16create_primitiveEPP14dnnl_primitiveEUlvE_EE13dnnl_status_tSB_PK19dnnl_primitive_descRKT_b]+0x6a3): undefined reference to `dnnl::impl::cpu::_ref_rnn_common_t<(dnnl_prop_kind_t)64, (dnnl_data_type_t)3, (dnnl_data_type_t)3, (dnnl_data_type_t)3>::cell_execution_gru(dnnl::impl::cpu::rnn_utils::rnn_conf_t const&, float*, float*, float*, float**, float**, float**, float*, float*, float*, float*, float*, float*, float*, float*, float*, float*, float*, float*) const'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:256: libenclave.so] Error 1
make[1]: Leaving directory '/home/liuxs/intel/linux-sgx/SampleCode/SampleDNNL'
make: *** [Makefile:181: all] Error 2

I am running on ubuntu 22.04 and my chip is i7-8750hk.

lzha101 commented 1 year ago

Thanks for reporting this issue. I can reproduce this failure on Ubuntu 22.04. It looks the DNNL implementation is not compatible with the high GCC version. The default GCC version on Ubuntu 2204 is GCC 11.3. The DNNL version we port into SGX is v1.1.1, which doesn't support GCC 11. From the DNNL project , looks GCC 11 support was introduced starting from DNNL v2.2.4. We will evaluate whether we need to upgrade the DNNL.

wsy19961129 commented 7 months ago

I am using Ubuntu 22.04 and installed gcc 9.4 manually; however, I am still facing this issue.

wsy19961129 commented 7 months ago

I am using Ubuntu 22.04 and installed gcc 9.4 manually; however, I am still facing this issue.

Hi, just to provide more information: I have tried sgx_2.23, 2.22, 1.18 using gcc 8.4; all the steps are working fine except the last step building the project of the SampleDNNL. The error is the same as above mentioned.

Is it possible for you to help provide any support; or could you confirm the details of the environment you have tested on this demo? Thanks!