Skip to content

Commit 06e732f

Browse files
committed
Update to use system wide dpdk install
1 parent 7356263 commit 06e732f

File tree

7 files changed

+30
-25
lines changed

7 files changed

+30
-25
lines changed

README.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ We've provided two scripts to install required dependencies, and configure your
1919
From the `openNetVM` folder, run the following two commands:
2020

2121
```text
22-
./scripts/install.sh
22+
sudo ./scripts/install.sh
2323
```
2424

2525
```text
@@ -31,25 +31,20 @@ sudo ./scripts/setup_runtime.sh
3131
OpenNetVM uses the [Meson][meson] build system to compile all components, including dpdk. From the `openNetVM` parent folder run the following to setup build:
3232

3333
```text
34-
meson build
34+
./scripts/build.sh
3535
```
3636

37-
Then, `cd` into the build folder and run ninja to compile:
37+
This will take care of the Meson build setup, compilation, and installation of onvm shared libriaries.
38+
39+
Afterwards you may need to run the following comand to update the linker.
3840

3941
```text
40-
cd ./build
41-
ninja
42+
ldconfig
4243
```
4344

4445
### Running onvm_mgr
4546

46-
After finishing build, from the build directory, you can run the `install` command to place the compiled executables in ther source directories.
47-
48-
```text
49-
meson install
50-
```
51-
52-
Then, you can use our provided startup script to launch onvm_mgr. This scripts assumes the `openNetVM` folder is your working directory.
47+
You can use our provided startup script to launch onvm_mgr. This scripts assumes the `openNetVM` folder is your working directory.
5348

5449
```text
5550
./scripts/startup.sh

examples/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ foreach example : onvm_examples
3737
name,
3838
sources,
3939
include_directories: includes,
40-
dependencies: [onvm_dpdk_shared_dep, onvm_nflib_dep],
40+
dependencies: [onvm_dpdk_dep, onvm_nflib_dep],
4141
install: true,
4242
install_tag: 'onvm',
4343
install_dir: onvm_output_dir + '/nf/' + example

meson.build

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
project('openNetVM', 'c')
2+
23
add_global_arguments('-msse4', language : 'c')
34

45
cc = meson.get_compiler('c')
@@ -11,14 +12,13 @@ onvm_output_dir = meson.current_source_dir() + '/bin'
1112
onvm_mgr_app_name = 'onvm_mgr'
1213

1314
# DPDK dependencies
14-
onvm_dpdk = subproject('dpdk')
15-
onvm_dpdk_dep = onvm_dpdk.get_variable('dpdk_static_lib_deps')
16-
onvm_dpdk_shared_dep = onvm_dpdk.get_variable('dpdk_shared_lib_deps')
15+
onvm_dpdk_dep = dependency('libdpdk')
1716

1817
# ONVM dependencies
1918
onvm_nflib_dep = []
2019
onvm_math_dep = cc.find_library('m')
2120
onvm_thread_dep = dependency('threads')
21+
onvm_systemd_dep = cc.find_library('systemd')
2222

2323
# Include directories to be used when building components and examples
2424
onvm_includes = include_directories('onvm/',

onvm/lib/meson.build

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ libonvmhelper = library(
77
sources,
88
include_directories : libonvmhelper_includes,
99
install: true,
10-
install_tag: 'onvm',
11-
install_dir: onvm_output_dir + '/lib'
10+
install_tag: 'onvm'
1211
)
1312

1413
libonvmhelper_dep = declare_dependency(

onvm/onvm_mgr/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ onvm_mgr_include = include_directories('.')
1212
executable(onvm_mgr_app_name,
1313
sources,
1414
include_directories: [onvm_mgr_include, onvm_includes],
15-
dependencies: [onvm_dpdk_shared_dep, onvm_thread_dep, libonvm_dep, libonvmhelper_dep, onvm_math_dep],
15+
dependencies: [onvm_dpdk_dep, onvm_thread_dep, libonvm_dep, libonvmhelper_dep, onvm_math_dep],
1616
install: true,
1717
install_tag: 'onvm',
1818
install_dir: onvm_output_dir,

onvm/onvm_nflib/meson.build

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ sources = files(
1313
libonvm_includes = include_directories('.')
1414

1515
libonvm_deps = [
16-
onvm_dpdk_shared_dep,
16+
onvm_dpdk_dep,
1717
onvm_thread_dep,
1818
libonvmhelper_dep
1919
]
@@ -23,9 +23,9 @@ libonvm = library(
2323
sources,
2424
include_directories : libonvm_includes,
2525
dependencies : libonvm_deps,
26+
pic: true,
2627
install: true,
27-
install_tag: 'onvm',
28-
install_dir: onvm_output_dir + '/lib')
28+
install_tag: 'onvm')
2929

3030
libonvm_dep = declare_dependency(
3131
link_with: libonvm,

scripts/install.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ packages=("build-essential" \
4848
"ninja-build" \
4949
"pkg-config" \
5050
"libnuma-dev" \
51-
"libpcap-dev")
51+
"libpcap-dev" \
52+
"libsystemd-dev")
5253
install_packages=true
5354

5455
pypackages=("meson" \
@@ -81,7 +82,7 @@ echo "- Installing required packages"
8182
if [ "$install_packages" = true ]; then
8283
echo " - installing: $required"
8384
sudo apt-get update
84-
sudo apt-get install $required
85+
sudo apt-get install $required -y
8586
else
8687
echo " - skipping due to --noinstall flag"
8788
fi
@@ -110,4 +111,14 @@ pip3 install $pyrequired
110111
# Build the dpdk-kmods uio kernel module
111112
echo "- Building the dpdk-kmods uio kernel module"
112113
cd subprojects/dpdk-kmods/linux/igb_uio
113-
make
114+
make
115+
cd -
116+
117+
# (5)
118+
# Install dpdk
119+
echo "- Installing dpdk"
120+
cd subprojects/dpdk
121+
meson build
122+
ninja -C build
123+
ninja -C build install
124+
sudo ldconfig

0 commit comments

Comments
 (0)