The Intel(R) Software Guard Extensions (Intel(R) SGX) Deep Neural Network Library (DNNL) is based on Intel(R) DNNL v1.1.1 (https://github.com/intel/mkl-dnn/tree/v1.1.1).

Build Intel(R) SGX DNNL
1.Enter: linux-trunk/external/dnnl
2.Execute: make

Install Intel(R) SGX DNNL lib and header files:
1.Copy Intel(R) SGX DNNL lib to the Intel(R) SGX SDK installation directory.
  For example:
  $ cp "./sgx_dnnl/lib/libsgx_dnnl.a" "$(SGX_SDK)/lib64"
2.Copy Intel(R) SGX DNNL header files to the Intel(R) SGX SDK header file directory.
  For example:
  $ cp "./sgx_dnnl/include/*" "$(SGX_SDK)/include"

Do the following to enable Intel(R) SGX DNNL in Intel(R) SGX:
1. Add "-lsgx_dnnl -lsgx_omp -lsgx_pthread" into enclave linking options in the Makefile.
   For example:
   Enclave_Link_Flags := $(SGX_COMMON_CFLAGS) -Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L$(SGX_LIBRARY_PATH) \
	-Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive \
	-Wl,--start-group -lsgx_tstdc -lsgx_tcxx -lsgx_dnnl -lsgx_omp -lsgx_pthread -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
	-Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
	-Wl,-pie,-eenclave_entry -Wl,--export-dynamic  \
	-Wl,--defsym,__ImageBase=0 \
	-Wl,--version-script=Enclave/Enclave.lds
