* [dpdk-dev] [PATCH 1/6] eal/bsdapp: fix building kernel modules
2018-01-31 17:42 [dpdk-dev] [PATCH 0/6] Fix meson build on FreeBSD Bruce Richardson
@ 2018-01-31 17:42 ` Bruce Richardson
2018-01-31 17:42 ` [dpdk-dev] [PATCH 2/6] build: add dependency on execinfo for BSD meson builds Bruce Richardson
` (5 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: Bruce Richardson @ 2018-01-31 17:42 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
The kernel module source file directory passed via VPATH was wrong,
which caused the source files to be not found via make. Rather than
explicitly passing VPATH, make use of the fact that the full path
to the source files is passed by meson, so split that into directory
part - to be used as VPATH - and file part - to be used as the source
filename.
Fixes: 610beca42ea4 ("build: remove library special cases")
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/librte_eal/bsdapp/BSDmakefile.meson | 1 +
lib/librte_eal/meson.build | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_eal/bsdapp/BSDmakefile.meson b/lib/librte_eal/bsdapp/BSDmakefile.meson
index 2f16ac05b..42f5b2b9d 100644
--- a/lib/librte_eal/bsdapp/BSDmakefile.meson
+++ b/lib/librte_eal/bsdapp/BSDmakefile.meson
@@ -36,6 +36,7 @@
# source file is passed via KMOD_SRC as full path, we only use final
# component of it, as VPATH is used to find actual file, so as to
# have the .o files placed in the build, not source directory
+VPATH = ${KMOD_SRC:H}
SRCS = ${KMOD_SRC:T} device_if.h bus_if.h pci_if.h
CFLAGS += $(KMOD_CFLAGS)
diff --git a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build
index 6fb2ef17f..d9ba38533 100644
--- a/lib/librte_eal/meson.build
+++ b/lib/librte_eal/meson.build
@@ -36,7 +36,6 @@ elif host_machine.system() == 'freebsd'
command: ['make', '-f', '@INPUT0@',
'KMOD_SRC=@INPUT1@',
'KMOD=' + k,
- 'VPATH=' + join_paths(meson.current_source_dir(), k),
'KMOD_CFLAGS=' + ' '.join(kmod_cflags)],
build_by_default: get_option('enable_kmods'))
endforeach
--
2.14.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* [dpdk-dev] [PATCH 2/6] build: add dependency on execinfo for BSD meson builds
2018-01-31 17:42 [dpdk-dev] [PATCH 0/6] Fix meson build on FreeBSD Bruce Richardson
2018-01-31 17:42 ` [dpdk-dev] [PATCH 1/6] eal/bsdapp: fix building kernel modules Bruce Richardson
@ 2018-01-31 17:42 ` Bruce Richardson
2018-01-31 17:42 ` [dpdk-dev] [PATCH 3/6] test/test: mark tests as skipped when required lib not available Bruce Richardson
` (4 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: Bruce Richardson @ 2018-01-31 17:42 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
The binaries and apps in DPDK all need to be linked against the
execinfo library on FreeBSD so add this as a dependency in cases
where it is found. It's available by default on BSD, but not
at all on Linux
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
app/test-eventdev/meson.build | 1 +
app/test-pmd/meson.build | 1 +
test/test/meson.build | 1 +
3 files changed, 3 insertions(+)
diff --git a/app/test-eventdev/meson.build b/app/test-eventdev/meson.build
index 7fb3a280a..7c373c87b 100644
--- a/app/test-eventdev/meson.build
+++ b/app/test-eventdev/meson.build
@@ -13,6 +13,7 @@ sources = files('evt_main.c',
'test_perf_queue.c')
dep_objs = [get_variable(get_option('default_library') + '_rte_eventdev')]
+dep_objs += cc.find_library('execinfo', required: false) # BSD only
link_libs = []
if get_option('default_library') == 'static'
diff --git a/app/test-pmd/meson.build b/app/test-pmd/meson.build
index 9964dae75..7ed74db2b 100644
--- a/app/test-pmd/meson.build
+++ b/app/test-pmd/meson.build
@@ -37,6 +37,7 @@ dep_objs = []
foreach d:deps
dep_objs += get_variable(get_option('default_library') + '_rte_' + d)
endforeach
+dep_objs += cc.find_library('execinfo', required: false) # for BSD only
link_libs = []
if get_option('default_library') == 'static'
diff --git a/test/test/meson.build b/test/test/meson.build
index d5b768b9d..2457a2adb 100644
--- a/test/test/meson.build
+++ b/test/test/meson.build
@@ -234,6 +234,7 @@ foreach d:test_deps
def_lib = get_option('default_library')
test_dep_objs += get_variable(def_lib + '_rte_' + d)
endforeach
+test_dep_objs += cc.find_library('execinfo', required: false)
link_libs = []
if get_option('default_library') == 'static'
--
2.14.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* [dpdk-dev] [PATCH 3/6] test/test: mark tests as skipped when required lib not available
2018-01-31 17:42 [dpdk-dev] [PATCH 0/6] Fix meson build on FreeBSD Bruce Richardson
2018-01-31 17:42 ` [dpdk-dev] [PATCH 1/6] eal/bsdapp: fix building kernel modules Bruce Richardson
2018-01-31 17:42 ` [dpdk-dev] [PATCH 2/6] build: add dependency on execinfo for BSD meson builds Bruce Richardson
@ 2018-01-31 17:42 ` Bruce Richardson
2018-02-01 16:32 ` Hunt, David
2018-01-31 17:42 ` [dpdk-dev] [PATCH 4/6] test/test: fix dependency on power lib for BSD meson build Bruce Richardson
` (3 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Bruce Richardson @ 2018-01-31 17:42 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson, Ferruh Yigit, David Hunt
The power management and KNI libraries are not compiled on a FreeBSD
platform, which means that the tests can't run. Add in stub code for
these cases, allowing the tests to still be compiled, but to report
as skipped in those cases.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
CC: Ferruh Yigit <ferruh.yigit@intel.com>
CC: David Hunt <david.hunt@intel.com>
---
test/test/test_kni.c | 13 +++++++++++++
test/test/test_power.c | 12 ++++++++++++
test/test/test_power_acpi_cpufreq.c | 11 +++++++++++
test/test/test_power_kvm_vm.c | 11 +++++++++++
4 files changed, 47 insertions(+)
diff --git a/test/test/test_kni.c b/test/test/test_kni.c
index 539d23184..c669785ae 100644
--- a/test/test/test_kni.c
+++ b/test/test/test_kni.c
@@ -10,6 +10,17 @@
#include "test.h"
+#ifndef RTE_LIBRTE_KNI
+
+static int
+test_kni(void)
+{
+ printf("KNI not supported, skipping test\n");
+ return TEST_SKIPPED;
+}
+
+#else
+
#include <rte_string_fns.h>
#include <rte_mempool.h>
#include <rte_ethdev.h>
@@ -605,4 +616,6 @@ test_kni(void)
return ret;
}
+#endif
+
REGISTER_TEST_COMMAND(kni_autotest, test_kni);
diff --git a/test/test/test_power.c b/test/test/test_power.c
index d601a2730..a0ee21983 100644
--- a/test/test/test_power.c
+++ b/test/test/test_power.c
@@ -10,6 +10,17 @@
#include "test.h"
+#ifndef RTE_LIBRTE_POWER
+
+static int
+test_power(void)
+{
+ printf("Power management library not supported, skipping test\n");
+ return TEST_SKIPPED;
+}
+
+#else
+
#include <rte_power.h>
static int
@@ -74,5 +85,6 @@ test_power(void)
rte_power_unset_env();
return -1;
}
+#endif
REGISTER_TEST_COMMAND(power_autotest, test_power);
diff --git a/test/test/test_power_acpi_cpufreq.c b/test/test/test_power_acpi_cpufreq.c
index ad948fbe1..3bfd03351 100644
--- a/test/test/test_power_acpi_cpufreq.c
+++ b/test/test/test_power_acpi_cpufreq.c
@@ -10,6 +10,16 @@
#include "test.h"
+#ifndef RTE_LIBRTE_POWER
+
+static int
+test_power_acpi_cpufreq(void)
+{
+ printf("Power management library not supported, skipping test\n");
+ return TEST_SKIPPED;
+}
+
+#else
#include <rte_power.h>
#define TEST_POWER_LCORE_ID 2U
@@ -507,5 +517,6 @@ test_power_acpi_cpufreq(void)
rte_power_unset_env();
return -1;
}
+#endif
REGISTER_TEST_COMMAND(power_acpi_cpufreq_autotest, test_power_acpi_cpufreq);
diff --git a/test/test/test_power_kvm_vm.c b/test/test/test_power_kvm_vm.c
index 97b8af9b5..91b31c442 100644
--- a/test/test/test_power_kvm_vm.c
+++ b/test/test/test_power_kvm_vm.c
@@ -10,6 +10,16 @@
#include "test.h"
+#ifndef RTE_LIBRTE_POWER
+
+static int
+test_power_kvm_vm(void)
+{
+ printf("Power management library not supported, skipping test\n");
+ return TEST_SKIPPED;
+}
+
+#else
#include <rte_power.h>
#define TEST_POWER_VM_LCORE_ID 0U
@@ -270,5 +280,6 @@ test_power_kvm_vm(void)
rte_power_unset_env();
return -1;
}
+#endif
REGISTER_TEST_COMMAND(power_kvm_vm_autotest, test_power_kvm_vm);
--
2.14.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH 3/6] test/test: mark tests as skipped when required lib not available
2018-01-31 17:42 ` [dpdk-dev] [PATCH 3/6] test/test: mark tests as skipped when required lib not available Bruce Richardson
@ 2018-02-01 16:32 ` Hunt, David
0 siblings, 0 replies; 15+ messages in thread
From: Hunt, David @ 2018-02-01 16:32 UTC (permalink / raw)
To: Bruce Richardson, dev; +Cc: Ferruh Yigit
Hi Bruce,
On 31/1/2018 5:42 PM, Bruce Richardson wrote:
> The power management and KNI libraries are not compiled on a FreeBSD
> platform, which means that the tests can't run. Add in stub code for
> these cases, allowing the tests to still be compiled, but to report
> as skipped in those cases.
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> CC: Ferruh Yigit <ferruh.yigit@intel.com>
> CC: David Hunt <david.hunt@intel.com>
> ---
> test/test/test_kni.c | 13 +++++++++++++
> test/test/test_power.c | 12 ++++++++++++
> test/test/test_power_acpi_cpufreq.c | 11 +++++++++++
> test/test/test_power_kvm_vm.c | 11 +++++++++++
> 4 files changed, 47 insertions(+)
--snip--
Acked-by David Hunt <david.hunt@intel.com>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [dpdk-dev] [PATCH 4/6] test/test: fix dependency on power lib for BSD meson build
2018-01-31 17:42 [dpdk-dev] [PATCH 0/6] Fix meson build on FreeBSD Bruce Richardson
` (2 preceding siblings ...)
2018-01-31 17:42 ` [dpdk-dev] [PATCH 3/6] test/test: mark tests as skipped when required lib not available Bruce Richardson
@ 2018-01-31 17:42 ` Bruce Richardson
2018-01-31 17:42 ` [dpdk-dev] [PATCH 5/6] test/test: fix dependency on KNI " Bruce Richardson
` (2 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: Bruce Richardson @ 2018-01-31 17:42 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
The power library is not built on FreeBSD, so it needs to be an
optional rather than a mandatory dependency for building the autotest
binary.
Fixes: b5dc795a8a55 ("test: build app with meson as dpdk-test")
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
test/test/meson.build | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/test/test/meson.build b/test/test/meson.build
index 2457a2adb..e8ddb76e3 100644
--- a/test/test/meson.build
+++ b/test/test/meson.build
@@ -111,7 +111,6 @@ test_deps = ['acl',
'member',
'pipeline',
'port',
- 'power',
'reorder',
'ring',
'timer'
@@ -228,6 +227,9 @@ endif
if dpdk_conf.has('RTE_LIBRTE_RING_PMD')
test_deps += 'pmd_ring'
endif
+if dpdk_conf.has('RTE_LIBRTE_POWER')
+ test_deps += 'power'
+endif
test_dep_objs = []
foreach d:test_deps
--
2.14.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* [dpdk-dev] [PATCH 5/6] test/test: fix dependency on KNI lib for BSD meson build
2018-01-31 17:42 [dpdk-dev] [PATCH 0/6] Fix meson build on FreeBSD Bruce Richardson
` (3 preceding siblings ...)
2018-01-31 17:42 ` [dpdk-dev] [PATCH 4/6] test/test: fix dependency on power lib for BSD meson build Bruce Richardson
@ 2018-01-31 17:42 ` Bruce Richardson
2018-01-31 17:42 ` [dpdk-dev] [PATCH 6/6] examples: fix meson build on FreeBSD Bruce Richardson
2018-02-01 14:20 ` [dpdk-dev] [PATCH v2 0/5] Fix " Bruce Richardson
6 siblings, 0 replies; 15+ messages in thread
From: Bruce Richardson @ 2018-01-31 17:42 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
The KNI library is not built on FreeBSD, so it needs to be an
optional rather than a mandatory dependency for building the autotest
binary.
Fixes: b5dc795a8a55 ("test: build app with meson as dpdk-test")
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
test/test/meson.build | 3 +++
1 file changed, 3 insertions(+)
diff --git a/test/test/meson.build b/test/test/meson.build
index e8ddb76e3..eb3d87a4d 100644
--- a/test/test/meson.build
+++ b/test/test/meson.build
@@ -230,6 +230,9 @@ endif
if dpdk_conf.has('RTE_LIBRTE_POWER')
test_deps += 'power'
endif
+if dpdk_conf.has('RTE_LIBRTE_KNI')
+ test_deps += 'kni'
+endif
test_dep_objs = []
foreach d:test_deps
--
2.14.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* [dpdk-dev] [PATCH 6/6] examples: fix meson build on FreeBSD
2018-01-31 17:42 [dpdk-dev] [PATCH 0/6] Fix meson build on FreeBSD Bruce Richardson
` (4 preceding siblings ...)
2018-01-31 17:42 ` [dpdk-dev] [PATCH 5/6] test/test: fix dependency on KNI " Bruce Richardson
@ 2018-01-31 17:42 ` Bruce Richardson
2018-02-01 14:20 ` [dpdk-dev] [PATCH v2 0/5] Fix " Bruce Richardson
6 siblings, 0 replies; 15+ messages in thread
From: Bruce Richardson @ 2018-01-31 17:42 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
Fixes: 89f0711f9ddf ("examples: build some samples with meson")
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
examples/meson.build | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/examples/meson.build b/examples/meson.build
index 5658fbe04..2c6b3f889 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -6,12 +6,13 @@ if get_option('default_library') == 'static'
driver_libs = dpdk_drivers
endif
+execinfo = cc.find_library('execinfo', required: false)
foreach example: get_option('examples').split(',')
name = example
sources = []
allow_experimental_apis = false
cflags = machine_args
- ext_deps = []
+ ext_deps = [execinfo]
includes = [include_directories(example)]
deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
subdir(example)
--
2.14.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* [dpdk-dev] [PATCH v2 0/5] Fix meson build on FreeBSD
2018-01-31 17:42 [dpdk-dev] [PATCH 0/6] Fix meson build on FreeBSD Bruce Richardson
` (5 preceding siblings ...)
2018-01-31 17:42 ` [dpdk-dev] [PATCH 6/6] examples: fix meson build on FreeBSD Bruce Richardson
@ 2018-02-01 14:20 ` Bruce Richardson
2018-02-01 14:20 ` [dpdk-dev] [PATCH v2 1/5] eal/bsdapp: fix building kernel modules Bruce Richardson
` (5 more replies)
6 siblings, 6 replies; 15+ messages in thread
From: Bruce Richardson @ 2018-02-01 14:20 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
There are a few issues with building DPDK for FreeBSD using the
meson build system, specifically:
* the kernel modules aren't compiling due to an incorrect VPATH
* a number of unit tests depend on libraries not supported on BSD
* applications and examples need to be linked with execinfo library.
----
V2: merged patch 6 in with patch 2, since it's the same fix for main apps
and for the examples.
Bruce Richardson (5):
eal/bsdapp: fix building kernel modules
build: fix dependency on execinfo for BSD meson builds
test/test: mark tests as skipped when required lib not available
test/test: fix dependency on power lib for BSD meson build
test/test: fix dependency on KNI lib for BSD meson build
app/test-eventdev/meson.build | 1 +
app/test-pmd/meson.build | 1 +
examples/meson.build | 3 ++-
lib/librte_eal/bsdapp/BSDmakefile.meson | 1 +
lib/librte_eal/meson.build | 1 -
test/test/meson.build | 8 +++++++-
test/test/test_kni.c | 13 +++++++++++++
test/test/test_power.c | 12 ++++++++++++
test/test/test_power_acpi_cpufreq.c | 11 +++++++++++
test/test/test_power_kvm_vm.c | 11 +++++++++++
10 files changed, 59 insertions(+), 3 deletions(-)
--
2.14.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* [dpdk-dev] [PATCH v2 1/5] eal/bsdapp: fix building kernel modules
2018-02-01 14:20 ` [dpdk-dev] [PATCH v2 0/5] Fix " Bruce Richardson
@ 2018-02-01 14:20 ` Bruce Richardson
2018-02-01 14:20 ` [dpdk-dev] [PATCH v2 2/5] build: fix dependency on execinfo for BSD meson builds Bruce Richardson
` (4 subsequent siblings)
5 siblings, 0 replies; 15+ messages in thread
From: Bruce Richardson @ 2018-02-01 14:20 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
The kernel module source file directory passed via VPATH was wrong,
which caused the source files to be not found via make. Rather than
explicitly passing VPATH, make use of the fact that the full path
to the source files is passed by meson, so split that into directory
part - to be used as VPATH - and file part - to be used as the source
filename.
Fixes: 610beca42ea4 ("build: remove library special cases")
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/librte_eal/bsdapp/BSDmakefile.meson | 1 +
lib/librte_eal/meson.build | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_eal/bsdapp/BSDmakefile.meson b/lib/librte_eal/bsdapp/BSDmakefile.meson
index 2f16ac05b..42f5b2b9d 100644
--- a/lib/librte_eal/bsdapp/BSDmakefile.meson
+++ b/lib/librte_eal/bsdapp/BSDmakefile.meson
@@ -36,6 +36,7 @@
# source file is passed via KMOD_SRC as full path, we only use final
# component of it, as VPATH is used to find actual file, so as to
# have the .o files placed in the build, not source directory
+VPATH = ${KMOD_SRC:H}
SRCS = ${KMOD_SRC:T} device_if.h bus_if.h pci_if.h
CFLAGS += $(KMOD_CFLAGS)
diff --git a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build
index 6fb2ef17f..d9ba38533 100644
--- a/lib/librte_eal/meson.build
+++ b/lib/librte_eal/meson.build
@@ -36,7 +36,6 @@ elif host_machine.system() == 'freebsd'
command: ['make', '-f', '@INPUT0@',
'KMOD_SRC=@INPUT1@',
'KMOD=' + k,
- 'VPATH=' + join_paths(meson.current_source_dir(), k),
'KMOD_CFLAGS=' + ' '.join(kmod_cflags)],
build_by_default: get_option('enable_kmods'))
endforeach
--
2.14.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* [dpdk-dev] [PATCH v2 2/5] build: fix dependency on execinfo for BSD meson builds
2018-02-01 14:20 ` [dpdk-dev] [PATCH v2 0/5] Fix " Bruce Richardson
2018-02-01 14:20 ` [dpdk-dev] [PATCH v2 1/5] eal/bsdapp: fix building kernel modules Bruce Richardson
@ 2018-02-01 14:20 ` Bruce Richardson
2018-02-01 14:20 ` [dpdk-dev] [PATCH v2 3/5] test/test: mark tests as skipped when required lib not available Bruce Richardson
` (3 subsequent siblings)
5 siblings, 0 replies; 15+ messages in thread
From: Bruce Richardson @ 2018-02-01 14:20 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
The binaries and apps in DPDK all need to be linked against the
execinfo library on FreeBSD so add this as a dependency in cases
where it is found. It's available by default on BSD, but not
at all on Linux
Fixes: 16ade738fd0d ("app/testpmd: build with meson")
Fixes: 89f0711f9ddf ("examples: build some samples with meson")
Fixes: b5dc795a8a55 ("test: build app with meson as dpdk-test")
Fixes: 2ff67267b049 ("app/eventdev: build with meson")
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
app/test-eventdev/meson.build | 1 +
app/test-pmd/meson.build | 1 +
examples/meson.build | 3 ++-
test/test/meson.build | 1 +
4 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/app/test-eventdev/meson.build b/app/test-eventdev/meson.build
index 7fb3a280a..7c373c87b 100644
--- a/app/test-eventdev/meson.build
+++ b/app/test-eventdev/meson.build
@@ -13,6 +13,7 @@ sources = files('evt_main.c',
'test_perf_queue.c')
dep_objs = [get_variable(get_option('default_library') + '_rte_eventdev')]
+dep_objs += cc.find_library('execinfo', required: false) # BSD only
link_libs = []
if get_option('default_library') == 'static'
diff --git a/app/test-pmd/meson.build b/app/test-pmd/meson.build
index 9964dae75..7ed74db2b 100644
--- a/app/test-pmd/meson.build
+++ b/app/test-pmd/meson.build
@@ -37,6 +37,7 @@ dep_objs = []
foreach d:deps
dep_objs += get_variable(get_option('default_library') + '_rte_' + d)
endforeach
+dep_objs += cc.find_library('execinfo', required: false) # for BSD only
link_libs = []
if get_option('default_library') == 'static'
diff --git a/examples/meson.build b/examples/meson.build
index 5658fbe04..2c6b3f889 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -6,12 +6,13 @@ if get_option('default_library') == 'static'
driver_libs = dpdk_drivers
endif
+execinfo = cc.find_library('execinfo', required: false)
foreach example: get_option('examples').split(',')
name = example
sources = []
allow_experimental_apis = false
cflags = machine_args
- ext_deps = []
+ ext_deps = [execinfo]
includes = [include_directories(example)]
deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
subdir(example)
diff --git a/test/test/meson.build b/test/test/meson.build
index d5b768b9d..2457a2adb 100644
--- a/test/test/meson.build
+++ b/test/test/meson.build
@@ -234,6 +234,7 @@ foreach d:test_deps
def_lib = get_option('default_library')
test_dep_objs += get_variable(def_lib + '_rte_' + d)
endforeach
+test_dep_objs += cc.find_library('execinfo', required: false)
link_libs = []
if get_option('default_library') == 'static'
--
2.14.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* [dpdk-dev] [PATCH v2 3/5] test/test: mark tests as skipped when required lib not available
2018-02-01 14:20 ` [dpdk-dev] [PATCH v2 0/5] Fix " Bruce Richardson
2018-02-01 14:20 ` [dpdk-dev] [PATCH v2 1/5] eal/bsdapp: fix building kernel modules Bruce Richardson
2018-02-01 14:20 ` [dpdk-dev] [PATCH v2 2/5] build: fix dependency on execinfo for BSD meson builds Bruce Richardson
@ 2018-02-01 14:20 ` Bruce Richardson
2018-02-01 14:20 ` [dpdk-dev] [PATCH v2 4/5] test/test: fix dependency on power lib for BSD meson build Bruce Richardson
` (2 subsequent siblings)
5 siblings, 0 replies; 15+ messages in thread
From: Bruce Richardson @ 2018-02-01 14:20 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson, Ferruh Yigit, David Hunt
The power management and KNI libraries are not compiled on a FreeBSD
platform, which means that the tests can't run. Add in stub code for
these cases, allowing the tests to still be compiled, but to report
as skipped in those cases.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
CC: Ferruh Yigit <ferruh.yigit@intel.com>
CC: David Hunt <david.hunt@intel.com>
---
test/test/test_kni.c | 13 +++++++++++++
test/test/test_power.c | 12 ++++++++++++
test/test/test_power_acpi_cpufreq.c | 11 +++++++++++
test/test/test_power_kvm_vm.c | 11 +++++++++++
4 files changed, 47 insertions(+)
diff --git a/test/test/test_kni.c b/test/test/test_kni.c
index c6867f256..e4839cdb7 100644
--- a/test/test/test_kni.c
+++ b/test/test/test_kni.c
@@ -10,6 +10,17 @@
#include "test.h"
+#ifndef RTE_LIBRTE_KNI
+
+static int
+test_kni(void)
+{
+ printf("KNI not supported, skipping test\n");
+ return TEST_SKIPPED;
+}
+
+#else
+
#include <rte_string_fns.h>
#include <rte_mempool.h>
#include <rte_ethdev.h>
@@ -609,4 +620,6 @@ test_kni(void)
return ret;
}
+#endif
+
REGISTER_TEST_COMMAND(kni_autotest, test_kni);
diff --git a/test/test/test_power.c b/test/test/test_power.c
index d601a2730..a0ee21983 100644
--- a/test/test/test_power.c
+++ b/test/test/test_power.c
@@ -10,6 +10,17 @@
#include "test.h"
+#ifndef RTE_LIBRTE_POWER
+
+static int
+test_power(void)
+{
+ printf("Power management library not supported, skipping test\n");
+ return TEST_SKIPPED;
+}
+
+#else
+
#include <rte_power.h>
static int
@@ -74,5 +85,6 @@ test_power(void)
rte_power_unset_env();
return -1;
}
+#endif
REGISTER_TEST_COMMAND(power_autotest, test_power);
diff --git a/test/test/test_power_acpi_cpufreq.c b/test/test/test_power_acpi_cpufreq.c
index ad948fbe1..3bfd03351 100644
--- a/test/test/test_power_acpi_cpufreq.c
+++ b/test/test/test_power_acpi_cpufreq.c
@@ -10,6 +10,16 @@
#include "test.h"
+#ifndef RTE_LIBRTE_POWER
+
+static int
+test_power_acpi_cpufreq(void)
+{
+ printf("Power management library not supported, skipping test\n");
+ return TEST_SKIPPED;
+}
+
+#else
#include <rte_power.h>
#define TEST_POWER_LCORE_ID 2U
@@ -507,5 +517,6 @@ test_power_acpi_cpufreq(void)
rte_power_unset_env();
return -1;
}
+#endif
REGISTER_TEST_COMMAND(power_acpi_cpufreq_autotest, test_power_acpi_cpufreq);
diff --git a/test/test/test_power_kvm_vm.c b/test/test/test_power_kvm_vm.c
index 97b8af9b5..91b31c442 100644
--- a/test/test/test_power_kvm_vm.c
+++ b/test/test/test_power_kvm_vm.c
@@ -10,6 +10,16 @@
#include "test.h"
+#ifndef RTE_LIBRTE_POWER
+
+static int
+test_power_kvm_vm(void)
+{
+ printf("Power management library not supported, skipping test\n");
+ return TEST_SKIPPED;
+}
+
+#else
#include <rte_power.h>
#define TEST_POWER_VM_LCORE_ID 0U
@@ -270,5 +280,6 @@ test_power_kvm_vm(void)
rte_power_unset_env();
return -1;
}
+#endif
REGISTER_TEST_COMMAND(power_kvm_vm_autotest, test_power_kvm_vm);
--
2.14.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* [dpdk-dev] [PATCH v2 4/5] test/test: fix dependency on power lib for BSD meson build
2018-02-01 14:20 ` [dpdk-dev] [PATCH v2 0/5] Fix " Bruce Richardson
` (2 preceding siblings ...)
2018-02-01 14:20 ` [dpdk-dev] [PATCH v2 3/5] test/test: mark tests as skipped when required lib not available Bruce Richardson
@ 2018-02-01 14:20 ` Bruce Richardson
2018-02-01 14:20 ` [dpdk-dev] [PATCH v2 5/5] test/test: fix dependency on KNI " Bruce Richardson
2018-02-02 11:11 ` [dpdk-dev] [PATCH v2 0/5] Fix meson build on FreeBSD Bruce Richardson
5 siblings, 0 replies; 15+ messages in thread
From: Bruce Richardson @ 2018-02-01 14:20 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
The power library is not built on FreeBSD, so it needs to be an
optional rather than a mandatory dependency for building the autotest
binary.
Fixes: b5dc795a8a55 ("test: build app with meson as dpdk-test")
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
test/test/meson.build | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/test/test/meson.build b/test/test/meson.build
index 2457a2adb..e8ddb76e3 100644
--- a/test/test/meson.build
+++ b/test/test/meson.build
@@ -111,7 +111,6 @@ test_deps = ['acl',
'member',
'pipeline',
'port',
- 'power',
'reorder',
'ring',
'timer'
@@ -228,6 +227,9 @@ endif
if dpdk_conf.has('RTE_LIBRTE_RING_PMD')
test_deps += 'pmd_ring'
endif
+if dpdk_conf.has('RTE_LIBRTE_POWER')
+ test_deps += 'power'
+endif
test_dep_objs = []
foreach d:test_deps
--
2.14.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* [dpdk-dev] [PATCH v2 5/5] test/test: fix dependency on KNI lib for BSD meson build
2018-02-01 14:20 ` [dpdk-dev] [PATCH v2 0/5] Fix " Bruce Richardson
` (3 preceding siblings ...)
2018-02-01 14:20 ` [dpdk-dev] [PATCH v2 4/5] test/test: fix dependency on power lib for BSD meson build Bruce Richardson
@ 2018-02-01 14:20 ` Bruce Richardson
2018-02-02 11:11 ` [dpdk-dev] [PATCH v2 0/5] Fix meson build on FreeBSD Bruce Richardson
5 siblings, 0 replies; 15+ messages in thread
From: Bruce Richardson @ 2018-02-01 14:20 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
The KNI library is not built on FreeBSD, so it needs to be an
optional rather than a mandatory dependency for building the autotest
binary.
Fixes: b5dc795a8a55 ("test: build app with meson as dpdk-test")
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
test/test/meson.build | 3 +++
1 file changed, 3 insertions(+)
diff --git a/test/test/meson.build b/test/test/meson.build
index e8ddb76e3..eb3d87a4d 100644
--- a/test/test/meson.build
+++ b/test/test/meson.build
@@ -230,6 +230,9 @@ endif
if dpdk_conf.has('RTE_LIBRTE_POWER')
test_deps += 'power'
endif
+if dpdk_conf.has('RTE_LIBRTE_KNI')
+ test_deps += 'kni'
+endif
test_dep_objs = []
foreach d:test_deps
--
2.14.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH v2 0/5] Fix meson build on FreeBSD
2018-02-01 14:20 ` [dpdk-dev] [PATCH v2 0/5] Fix " Bruce Richardson
` (4 preceding siblings ...)
2018-02-01 14:20 ` [dpdk-dev] [PATCH v2 5/5] test/test: fix dependency on KNI " Bruce Richardson
@ 2018-02-02 11:11 ` Bruce Richardson
5 siblings, 0 replies; 15+ messages in thread
From: Bruce Richardson @ 2018-02-02 11:11 UTC (permalink / raw)
To: dev
On Thu, Feb 01, 2018 at 02:20:06PM +0000, Bruce Richardson wrote:
> There are a few issues with building DPDK for FreeBSD using the
> meson build system, specifically:
> * the kernel modules aren't compiling due to an incorrect VPATH
> * a number of unit tests depend on libraries not supported on BSD
> * applications and examples need to be linked with execinfo library.
>
> ----
> V2: merged patch 6 in with patch 2, since it's the same fix for main apps
> and for the examples.
>
> Bruce Richardson (5):
> eal/bsdapp: fix building kernel modules
> build: fix dependency on execinfo for BSD meson builds
> test/test: mark tests as skipped when required lib not available
> test/test: fix dependency on power lib for BSD meson build
> test/test: fix dependency on KNI lib for BSD meson build
>
> app/test-eventdev/meson.build | 1 +
> app/test-pmd/meson.build | 1 +
> examples/meson.build | 3 ++-
> lib/librte_eal/bsdapp/BSDmakefile.meson | 1 +
> lib/librte_eal/meson.build | 1 -
> test/test/meson.build | 8 +++++++-
> test/test/test_kni.c | 13 +++++++++++++
> test/test/test_power.c | 12 ++++++++++++
> test/test/test_power_acpi_cpufreq.c | 11 +++++++++++
> test/test/test_power_kvm_vm.c | 11 +++++++++++
> 10 files changed, 59 insertions(+), 3 deletions(-)
>
> --
Applied to dpdk-next-build
/Bruce
^ permalink raw reply [flat|nested] 15+ messages in thread