forked from Mellanox/pka
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.build
167 lines (112 loc) · 5.91 KB
/
README.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
© 2023 NVIDIA Corporation & affiliates.
License: BSD-3-Clause
BlueField PKA API 1.0
Author, Khalil Blaiech <[email protected]>
===============================================================================
Overview
===============================================================================
The Mellanox BlueField PKA software is a set of libraries and tests
intended to be used with the BlueField PKA hardware.
The Mellanox BlueField PKA software offers a custom API required to
code PKA-based applications.
===============================================================================
Dependencies
===============================================================================
Building PK library, documentation and tests requires the following:
1. Linux Kernel >= 4.11.0
Mellanox BlueField products supports the following Linux distributions:
* BlueField Yocto Poky (4.14.53 aarch64)
* CentOS 7 (4.11.0-22.el7a.aarch64)
* Ubuntu 18.04 (4.18.0-1000-mellanox aarch64)
The kernel configuration should enable VFIO support and its dependencies,
and hardware random number generator support.
2. Autotools
automake
autoconf
libtool
On CentOS systems:
# sudo yum install automake autoconf libtool
On Ubuntu systems:
# sudo apt install automake autoconf libtool
3. Required packages
Libraries currently required to link: openssl
OpenSSL is needed to build the dynamically-loadable BlueField PKA
engine. Note that OpenSSL 1.1 and higher is required. Earlier
versions may or may not work.
4. Doxygen documentation
The API documentation is generated via doxygen. The trusted version
of doxygen is 1.8.5. Only HTML documentation is built.
===============================================================================
Important Notes
===============================================================================
* The PKA libraries and drivers should be already installed within the
given Linux distribution;
On poky and CentOS, the PKA library is installed into
'/usr/lib64/libPKA.so'
On Ubuntu, the PKA library is installed into
'/usr/lib/aarch64-linux-gnu/libPKA.so'
===============================================================================
How to build
===============================================================================
1. Build PKA software and documentation:
# autoreconf -ivf
# ./configure
# make
# make install
2. Cross compile of PKA software:
To cross compile the PKA library and documentation, the Yocto-produced
SDK might be installed:
$ /mswg/release/sw_mc_soc/BlueField-1.0.<release>.<version>/poky-glibc-x86_64-core-image-full-sdk-aarch64-toolchain-BlueField-1.0.<release>.<version>.2.4.1.sh
Poky (Yocto Project Reference Distro) SDK installer version 2.4.1
=================================================================
Enter target directory for SDK (default: /opt/poky/2.4.1): /labhome/kblaiech/workspace/poky/2.4.1
You are about to install the SDK to "/labhome/kblaiech/workspace/poky/2.4.1". Proceed[Y/n]?
Y
Extracting SDK.............................................................
...........................................................................
...........................................................................
........................................................done
Setting it up...done
SDK has been successfully set up and is ready to be used.
Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
$ . /labhome/kblaiech/workspace/poky/2.4.1/environment-setup-aarch64-poky-linux
To use the SDK cross-compilation tools, you should 'source' the top-level
"environment-setup-aarch64-poky-linux" script to set various environment
variables, including $PATH, $CC, $CROSS_COMPILE, etc.
$ source <sdk_install_dir>/poky/2.4.1/environment-setup-aarch64-poky-linux
To build the PKA software:
$ autoreconf -ivf
$ ./configure --host=aarch64-poky-linux --prefix=<pka_install_dir>
$ make
$ make install
3. Build PKA tests
Look in 'README.tests' for further detail on how to build, install
and run the tests suite.
By default, tests suite support is enabled, run 'configure' script
with option '--disable-testutils' to disable it:
# ./configure --disable-testutils
4. Build PKA engine
Look in 'README.engine' for further detail on how to build, install,
load and run OpenSSL applications with BlueField PKA engine.
By default, engine support is enabled, run 'configure' script with
option '--without-libcrypto' to disable it:
# ./configure --without-libcrypto
===============================================================================
Building packages
===============================================================================
5 deb packages are generated: libpka1, libpka1-engine, libpka1-testutils, libpka1-dev, libpka1-doc.
libpka1 - main package that contains libPKA.so library
libpka1-engine - package that contains OpenSSL engine
libpka1-testutils - contains test utilities (pka_test_validation pka_test_performance)
libpka1-dev - contains header files for libPKA.so library
libpka1-doc - contains documentation
DEB packages:
For deb packages build is done using standard Debian tools such as dpkg-buildpackages, debuild or using debian/rules
Example of building deb package. Command should be run from source root:
$ dpkg-buildpackage -b -uc -us
RPM packages:
RPM packages are build using rpmbuild.
Example of building rpm package. Command should be run from source root:
$ rpmdev-setuptree
$ tar -cvzp --show-transformed --transform 's,^\.,./libpka-2.0,' --file /root/rpmbuild/SOURCES/libpka-2.0.tar.gz --exclude='.git*' .
$ rpmbuild -bb libpka.spec