SigmaGmbH / swisstronik-chain

Swisstronik is an identity-based hybrid layer-1 blockchain ecosystem. It lets Web 3.0 and traditional companies build KYC, AML and DPR compliant applications with enhanced data privacy
GNU Lesser General Public License v3.0
22 stars 27 forks source link

Can't build binary file use ubuntu 22.04 with SGX enabled #70

Open quangtuyen88 opened 8 months ago

quangtuyen88 commented 8 months ago

Got this err when run make build

Compile into Enclave_t.o
Compile into unsinged enclave
/usr/bin/ld: /opt/intel/sgxsdk/lib64/libsgx_tprotected_fs.a(file_flush.o): in function `protected_fs_file::multi_thread_update_data_nodes()':
file_flush.cpp:(.text._ZN17protected_fs_file30multi_thread_update_data_nodesEv+0x472): undefined reference to `pthread_create'
/usr/bin/ld: file_flush.cpp:(.text._ZN17protected_fs_file30multi_thread_update_data_nodesEv+0x4bf): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status

My server support SGX and SGX SDK installed

cpuid -1 | grep SGX
      SGX: Software Guard Extensions supported = true
      SGX_LC: SGX launch config supported      = true
   Software Guard Extensions (SGX) capability (0x12/0):
      SGX1 supported                           = true
      SGX2 supported                           = false
      SGX ENCLV E*VIRTCHILD, ESETCONTEXT       = false
      SGX ENCLS ETRACKC, ERDINFO, ELDBC, ELDUC = false
   SGX attributes: ECREATE SECS.ATTRIBUTES (0x12/1):
   SGX Enclave Page Cache (EPC) enumeration (0x12/0x2):
   SGX Enclave Page Cache (EPC) enumeration (0x12/0x3):
   ls /opt/intel/sgxsdk/
SampleCode  bin  buildenv.mk  environment  include  lib64  licenses  pkgconfig  sdk_libs  uninstall.sh
ls /dev/sgx*
/dev/sgx_enclave  /dev/sgx_provision  /dev/sgx_vepc

/dev/sgx:
enclave  provision
delneg commented 8 months ago

Hello, which branch ?

quangtuyen88 commented 8 months ago

Hello @delneg I'm using master branch

delneg commented 8 months ago

I've had this error, it was fixed with https://github.com/SigmaGmbH/swisstronik-chain/commit/cb1b1a8712d5f6ed362417dc224db02a8a263972

delneg commented 8 months ago

So until this lands in master, it won't build with newer sgx sdk

quangtuyen88 commented 8 months ago

I see. Thanks.. this time I still able to install use .deb file from the release