From 9f9cfdc5917e63a571b123d90637785b2aa4c60b Mon Sep 17 00:00:00 2001 From: Piotr Pelplinski Date: Wed, 24 Oct 2018 09:16:07 +0200 Subject: [PATCH] doc: update doc with instructions for building shared lib Signed-off-by: Piotr Pelplinski Change-Id: Idc3aae5a0486008a8a593c13135f8f785dc73100 Reviewed-on: https://review.gerrithub.io/430538 Reviewed-by: Lance Hartmann Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris Reviewed-by: Ben Walker Tested-by: SPDK CI Jenkins --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index e48a8450b..5faa2d58d 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ The development kit currently includes: * [Unit Tests](#tests) * [Vagrant](#vagrant) * [Advanced Build Options](#advanced) +* [Shared libraries](#shared) * [Hugepages and Device Binding](#huge) * [Example Code](#examples) * [Contributing](#contributing) @@ -156,6 +157,33 @@ values in `mk/config.mk`. This can be useful if you, for example, generate a `mk/config.mk` using the `configure` script and then have one or two options (i.e. debug builds) that you wish to turn on and off frequently. + +## Shared libraries + +By default, the build of the SPDK yields static libraries against which +the SPDK applications and examples are linked. +Configure option `--with-shared` provides the ability to produce SPDK shared +libraries, in addition to the default static ones. Use of this flag also +results in the SPDK executables linked to the shared versions of libraries. +SPDK shared libraries by default, are located in `./build/lib`. This includes +the single SPDK shared lib encompassing all of the SPDK static libs +(`libspdk.so`) as well as individual SPDK shared libs corresponding to each +of the SPDK static ones. + +In order to start a SPDK app linked with SPDK shared libraries, make sure +to do the following steps: +- run ldconfig specifying the directory containing SPDK shared libraries +- provide proper `LD_LIBRARY_PATH` + +Linux: + +~~~{.sh} +./configure --with-shared +make +ldconfig -v -n ./build/lib +LD_LIBRARY_PATH=./build/lib/ ./app/spdk_tgt/spdk_tgt +~~~ + ## Hugepages and Device Binding