This file contains instructions to build and install the TSS libraries.
To build and install the tpm2-tss software the following dependencies are required:
The following are dependencies only required when building the test suite. Most users will not need to install these dependencies:
$ sudo apt -y update $ sudo apt -y install \ autoconf-archive \ libcmocka0 \ libcmocka-dev \ build-essential \ git \ pkg-config \ gcc \ g++ \ m4 \ libtool \ automake \ autoconf
There is a package already, so the package build dependencies information can be used to make sure that the needed packages to compile from source are installed:
$ sudo dnf builddep tpm2-tss
To configure the tpm2-tss source code first run the bootstrap script, which generates list of source files, and creates the configure script:
$ ./bootstrap
Then run the configure script, which generates the makefiles:
$ ./configure
Then compile the code using make:
$ make -j$(nproc)
Once you've built the tpm2-tss software it can be installed with:
$ sudo make install
This will install the libraries to a location determined at configure time. See the output of ./configure --help for the available options. Typically you won't need to do much more than provide an alternative --prefix option at configure time, and maybe DESTDIR at install time if you're packaging for a distro.
NOTE: It may be necessary to run ldconfig (as root) to update the run-time bindings before executing a program that links against libsapi or a TCTI library:
$ sudo ldconfig
If you are having trouble installing the dependencies on your machine you can build in a container.
$ docker build -t tpm2 . $ docker run --name temp tpm2 /bin/true $ docker cp temp:/tpm2-tss tpm2-tss $ docker rm temp
tpm2-tss is now in your working directory and contains all the built files.