Skip to content

ratel-enclave/ratel-sdk

Repository files navigation

Intel(R) Software Guard Extensions for Linux* OS

linux-sgx

Introduction

Intel(R) Software Guard Extensions (Intel(R) SGX) is an Intel technology for application developers seeking to protect select code and data from disclosure or modification.

The Linux* Intel(R) SGX software stack is comprised of the Intel(R) SGX driver, the Intel(R) SGX SDK, and the Intel(R) SGX Platform Software (PSW). The Intel(R) SGX SDK and Intel(R) SGX PSW are hosted in the linux-sgx project.

The linux-sgx-driver project hosts the out-of-tree driver for the Linux* Intel(R) SGX software stack, which will be used until the driver upstreaming process is complete.

License

See License.txt for details.

Contributing

See CONTRIBUTING.md for details.

Documentation

Build and Install the Intel(R) SGX Driver

Follow the instructions in the linux-sgx-driver project to build and install the Intel(R) SGX driver.

Build the Intel(R) SGX SDK Package

Prerequisites:

  • Ensure that you have one of the following required operating systems:

    • Ubuntu* 16.04.1 LTS Desktop 64bits
    • Ubuntu* 16.04.1 LTS Server 64bits
  • Use the following command(s) to install the required tools to build the Intel(R) SGX SDK:

    • On Ubuntu 16.04:
      $ sudo apt-get install libssl-dev build-essential ocaml automake autoconf libtool wget python
    
  • Use the script download_prebuilt.sh inside source code package to download prebuilt binaries to prebuilt folder
    You may need set an https proxy for the wget tool used by the script (such as export https_proxy=http://test-proxy:test-port)

  $ ./download_prebuilt.sh

Build the Intel(R) SGX SDK

The following steps describe how to build the Intel(R) SGX SDK. You can build the project according to your requirements.

  • To build both Intel(R) SGX SDK with default configuration, enter the following command:
  $ make  

You can find the tools and libraries generated in the build/linux directory.
Note: You can also go to the sdk folder and use the make command to build the Intel(R) SGX SDK component only. However, building the PSW component is dependent on the result of building the Intel(R) SGX SDK.

  • To build Intel(R) SGX SDK with debug information, enter the following command:
  $ make DEBUG=1
  • To clean the files generated by previous make command, enter the following command:
  $ make clean

Build the Intel(R) SGX SDK Installer

To build the Intel(R) SGX SDK installer, enter the following command:

$ make sdk_install_pkg

You can find the generated Intel(R) SGX SDK installer sgx_linux_x64_sdk_${version}.bin located under linux/installer/bin/, where ${version} refers to the version number.

Note: The above command builds the Intel(R) SGX SDK with default configuration firstly and then generates the target SDK Installer. To build the Intel(R) SGX SDK Installer with debug information kept in the tools and libraries, enter the following command:

$ make sdk_install_pkg DEBUG=1

Install the Intel(R) SGX SDK

Prerequisites

  • Ensure that you have one of the following operating systems:
    • Ubuntu* 16.04.1 LTS Desktop 64bits
    • Ubuntu* 16.04.1 LTS Server 64bits
  • Use the following command to install the required tool to use Intel(R) SGX SDK:
    • On Ubuntu 16.04:
      $ sudo apt-get install build-essential python
    

Install the Intel(R) SGX SDK

To install the Intel(R) SGX SDK, invoke the installer, as follows:

$ cd linux/installer/bin
$ ./sgx_linux_x64_sdk_${version}.bin 

NOTE: You need to set up the needed environment variables before compiling your code. To do so, run:

  $ source ${sgx-sdk-install-path}/environment