mc2-project / secure-xgboost

Secure collaborative training and inference for XGBoost.
https://mc2-project.github.io/secure-xgboost/
Apache License 2.0
105 stars 32 forks source link

fatal error: mbedtls/gcm.h: No such file or directory #133

Closed jeanjluo closed 3 years ago

jeanjluo commented 3 years ago

I am getting the following error building Secure XG Boost in an Azure VM

~/secure-xgboost/build$ make -j4
[ 11%] Built target dmlc
[ 18%] Built target rabit
[ 22%] Built target objxgboost
Scanning dependencies of target xgboost
[ 23%] Linking CXX shared library ../libxgboost.so
[ 24%] Building CXX object enclave/CMakeFiles/xgboost_enclave.dir/ecalls_mc.cpp.o
[ 25%] Building CXX object enclave/CMakeFiles/xgboost_enclave.dir/dmlc-core/src/data.cc.o
[ 26%] Building CXX object enclave/CMakeFiles/xgboost_enclave.dir/dmlc-core/src/io.cc.o
[ 26%] Built target xgboost
[ 27%] Building CXX object enclave/CMakeFiles/xgboost_enclave.dir/dmlc-core/src/io/filesys.cc.o
In file included from /home/secureml/secure-xgboost/enclave/include/enclave_context.h:9:0,
                 from /home/secureml/secure-xgboost/enclave/ecalls_mc.cpp:10:
/home/secureml/secure-xgboost/enclave/../include/enclave/crypto.h:12:10: fatal error: mbedtls/gcm.h: No such file or directory
 #include "mbedtls/gcm.h"
          ^~~~~~~~~~~~~~~
compilation terminated.
enclave/CMakeFiles/xgboost_enclave.dir/build.make:72: recipe for target 'enclave/CMakeFiles/xgboost_enclave.dir/ecalls_mc.cpp.o' failed
make[2]: *** [enclave/CMakeFiles/xgboost_enclave.dir/ecalls_mc.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /home/secureml/secure-xgboost/enclave/dmlc-core/src/data/././text_parser.h:24:0,
                 from /home/secureml/secure-xgboost/enclave/dmlc-core/src/data/./libsvm_parser.h:21,
                 from /home/secureml/secure-xgboost/enclave/dmlc-core/src/data/disk_row_iter.h:19,
                 from /home/secureml/secure-xgboost/enclave/dmlc-core/src/data.cc:13:
/home/secureml/secure-xgboost/enclave/../include/enclave/crypto.h:12:10: fatal error: mbedtls/gcm.h: No such file or directory
 #include "mbedtls/gcm.h"
          ^~~~~~~~~~~~~~~
compilation terminated.
enclave/CMakeFiles/xgboost_enclave.dir/build.make:85: recipe for target 'enclave/CMakeFiles/xgboost_enclave.dir/dmlc-core/src/data.cc.o' failed
make[2]: *** [enclave/CMakeFiles/xgboost_enclave.dir/dmlc-core/src/data.cc.o] Error 1
CMakeFiles/Makefile2:349: recipe for target 'enclave/CMakeFiles/xgboost_enclave.dir/all' failed
make[1]: *** [enclave/CMakeFiles/xgboost_enclave.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

VM Image: Canonical:UbuntuServer:18_04-lts-gen2:18.04.201908220 $ dmesg | grep -i sgx [ 4.164734] systemd[1]: Set hostname to . [ 4.851648] sgx: EPC section 0x4c0200000-0x4c6ffffff [ 4.852377] sgx: EPC section 0x4c7200000-0x4c73fffff [ 4.854938] sgx: intel_sgx: Intel SGX DCAP Driver v1.33

chester-leung commented 3 years ago

Have you installed MbedTLS?

sudo apt-get install -y libmbedtls-dev

jeanjluo commented 3 years ago

Have you installed MbedTLS?

sudo apt-get install -y libmbedtls-dev

Yes.

$ sudo apt-get install -y libmbedtls-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libmbedtls-dev is already the newest version (2.8.0-1).
0 upgraded, 0 newly installed, 0 to remove and 80 not upgraded.

Not sure if it is a version conflict with the VM i am using. Can you provide an VM image urn I could use?

chester-leung commented 3 years ago

We don't have a VM image as we do development directly on Azure Confidential Computing, but you can try this Docker image: https://hub.docker.com/r/rishabhp89/ubuntu-oe

What version of Open Enclave do you have installed?

jeanjluo commented 3 years ago
libprotobuf10 is already the newest version (3.0.0-9.1ubuntu1).
gdb is already the newest version (8.1.1-0ubuntu1).
libssl-dev is already the newest version (1.1.1-1ubuntu2.1~18.04.7).
libsgx-dcap-ql is already the newest version (1.9.100.3-bionic1).
libsgx-dcap-ql-dev is already the newest version (1.9.100.3-bionic1).
libsgx-enclave-common is already the newest version (2.12.100.3-bionic1).
clang-7 is already the newest version (1:7.1.0~svn353565-1~exp1~20190406090509.61).
az-dcap-client is already the newest version (1.6).
open-enclave is already the newest version (0.13.0).

I will try Azure Confidential Computing.

jeanjluo commented 3 years ago

I was able to install in Azure Confidential Computing. Thanks for your help!