Skip to content

Commit

Permalink
Update to use system wide dpdk install
Browse files Browse the repository at this point in the history
  • Loading branch information
marascoben committed Sep 10, 2024
1 parent 7356263 commit c3f1bf4
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ We've provided two scripts to install required dependencies, and configure your
From the `openNetVM` folder, run the following two commands:

```text
./scripts/install.sh
sudo ./scripts/install.sh
```

```text
Expand Down
2 changes: 1 addition & 1 deletion examples/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ foreach example : onvm_examples
name,
sources,
include_directories: includes,
dependencies: [onvm_dpdk_shared_dep, onvm_nflib_dep],
dependencies: [onvm_dpdk_dep, onvm_nflib_dep],
install: true,
install_tag: 'onvm',
install_dir: onvm_output_dir + '/nf/' + example
Expand Down
6 changes: 3 additions & 3 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
project('openNetVM', 'c')

add_global_arguments('-msse4', language : 'c')

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

# DPDK dependencies
onvm_dpdk = subproject('dpdk')
onvm_dpdk_dep = onvm_dpdk.get_variable('dpdk_static_lib_deps')
onvm_dpdk_shared_dep = onvm_dpdk.get_variable('dpdk_shared_lib_deps')
onvm_dpdk_dep = dependency('libdpdk')

# ONVM dependencies
onvm_nflib_dep = []
onvm_math_dep = cc.find_library('m')
onvm_thread_dep = dependency('threads')
onvm_systemd_dep = cc.find_library('systemd')

# Include directories to be used when building components and examples
onvm_includes = include_directories('onvm/',
Expand Down
3 changes: 1 addition & 2 deletions onvm/lib/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ libonvmhelper = library(
sources,
include_directories : libonvmhelper_includes,
install: true,
install_tag: 'onvm',
install_dir: onvm_output_dir + '/lib'
install_tag: 'onvm'
)

libonvmhelper_dep = declare_dependency(
Expand Down
2 changes: 1 addition & 1 deletion onvm/onvm_mgr/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ onvm_mgr_include = include_directories('.')
executable(onvm_mgr_app_name,
sources,
include_directories: [onvm_mgr_include, onvm_includes],
dependencies: [onvm_dpdk_shared_dep, onvm_thread_dep, libonvm_dep, libonvmhelper_dep, onvm_math_dep],
dependencies: [onvm_dpdk_dep, onvm_thread_dep, libonvm_dep, libonvmhelper_dep, onvm_math_dep],
install: true,
install_tag: 'onvm',
install_dir: onvm_output_dir,
Expand Down
6 changes: 3 additions & 3 deletions onvm/onvm_nflib/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sources = files(
libonvm_includes = include_directories('.')

libonvm_deps = [
onvm_dpdk_shared_dep,
onvm_dpdk_dep,
onvm_thread_dep,
libonvmhelper_dep
]
Expand All @@ -23,9 +23,9 @@ libonvm = library(
sources,
include_directories : libonvm_includes,
dependencies : libonvm_deps,
pic: true,
install: true,
install_tag: 'onvm',
install_dir: onvm_output_dir + '/lib')
install_tag: 'onvm')

libonvm_dep = declare_dependency(
link_with: libonvm,
Expand Down
17 changes: 14 additions & 3 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ packages=("build-essential" \
"ninja-build" \
"pkg-config" \
"libnuma-dev" \
"libpcap-dev")
"libpcap-dev" \
"libsystemd-dev")
install_packages=true

pypackages=("meson" \
Expand Down Expand Up @@ -81,7 +82,7 @@ echo "- Installing required packages"
if [ "$install_packages" = true ]; then
echo " - installing: $required"
sudo apt-get update
sudo apt-get install $required
sudo apt-get install $required -y
else
echo " - skipping due to --noinstall flag"
fi
Expand Down Expand Up @@ -110,4 +111,14 @@ pip3 install $pyrequired
# Build the dpdk-kmods uio kernel module
echo "- Building the dpdk-kmods uio kernel module"
cd subprojects/dpdk-kmods/linux/igb_uio
make
make
cd -

# (5)
# Install dpdk
echo "- Installing dpdk"
cd subprojects/dpdk
meson build
ninja -C build
ninja -C build install
sudo ldconfig

0 comments on commit c3f1bf4

Please sign in to comment.