- Ubuntu 16.04-LTS 64-bits
Use the following command to download the source code and set the current directory to it.
git clone https://github.com/openenclave/openenclave.git
cd openenclaveThis creates a source tree under the directory called openenclave.
Ansible is required to install the project prerequisites. You can install it by running:
sudo ./scripts/ansible/install-ansible.shTo install all the Open Enclave prerequisites you can execute the environment-setup.yml tasks from linux/openenclave Ansible role:
cd openenclave/scripts/ansible
ansible localhost -m import_role -a "name=linux/openenclave tasks_from=environment-setup.yml" --become --ask-become-passTo build first create a build directory ("build/" in the example below) and change into it.
mkdir build/
cd build/Then run cmake to configure the build and generate the make files and build:
cmake -DUSE_LIBSGX=OFF ..
makeIf you want to compile in parallel you can use the -j argument for make (i.e. make -j).
Refer to the Advanced Build Information documentation for further information.
After building, run all unit test cases using ctest to confirm the SDK is built and working as expected.
Note that to run the tests in simulation mode, the OE_SIMULATION environment variable must be set to 1.
Run the following command from the build directory:
OE_SIMULATION=1 ctestYou will see test logs similar to the following:
~/openenclave/build$ OE_SIMULATION=1 ctest
Test project /home/youradminusername/openenclave/build
Start 1: tests/aesm
1/123 Test #1: tests/aesm ...............................................................................................................***Skipped 0.00 sec
Start 2: tests/mem
2/123 Test #2: tests/mem ................................................................................................................ Passed 0.00 sec
Start 3: tests/str
3/123 Test #3: tests/str ................................................................................................................ Passed 0.00 sec
....
....
....
121/123 Test #121: samples .................................................................................................................. Passed 4.46 sec
Start 122: tools/oedump
122/123 Test #122: tools/oedump ............................................................................................................. Passed 0.00 sec
Start 123: oeelf
123/123 Test #123: oeelf .................................................................................................................... Passed 0.00 sec
93% tests passed, 8 tests failed out of 123
Total Test time (real) = 38.81 sec
The following tests FAILED:
1 - tests/aesm (Not Run)
6 - tests/debug-unsigned (Not Run)
7 - tests/debug-signed (Not Run)
8 - tests/nodebug-signed (Not Run)
9 - tests/nodebug-unsigned (Not Run)
33 - tests/report (Not Run)
37 - tests/sealKey (Not Run)
115 - tests/VectorException (Not Run)
Errors while running CTestSome of the tests are skipped (Not Run) by design because the current simulator is not fully featured yet.
A clean pass of the above unit tests is an indication that your Open Enclave setup was successful.
You can start playing with those Open Enclave samples after following the instructions in the "Install" section below to configure samples for building,
For more information refer to the Advanced Test Info document.
Follow the instructions in the Install Info document to install the Open Enclave SDK built above.
To build and run the samples, please look here.