X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=config%2Fmeson.build;h=4cdf589e2086fd8f3b504cf8df8c9661a17309d9;hb=1c9e61b3a45321b3cae742e8769b10c06c0324f0;hp=e80421003b68d2ccba1f50cc8eef04f964cbb398;hpb=cd27047dbee1eda0e8ed12300bc035636d89607b;p=dpdk.git diff --git a/config/meson.build b/config/meson.build index e80421003b..4cdf589e20 100644 --- a/config/meson.build +++ b/config/meson.build @@ -61,7 +61,8 @@ if not is_windows get_option('libdir'), pmd_subdir_opt) elif meson.version().version_compare('>=0.55.0') # 0.55.0 is required to use external program with add_install_script - meson.add_install_script(py3, '../buildtools/symlink-drivers-solibs.py', + meson.add_install_script(py3, + files('../buildtools/symlink-drivers-solibs.py'), get_option('libdir'), pmd_subdir_opt, get_option('bindir')) endif @@ -286,8 +287,6 @@ foreach arg: warning_flags endforeach # set other values pulled from the build options -dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores')) -dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes')) dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports')) dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet')) dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp')) @@ -321,6 +320,51 @@ if meson.is_cross_build() endif endif +max_lcores = get_option('max_lcores') +if max_lcores == 'detect' + # discovery makes sense only for non-cross builds + if meson.is_cross_build() + error('Discovery of max_lcores is not supported for cross-compilation.') + endif + # overwrite the default value with discovered values + max_lcores = run_command(get_cpu_count_cmd).stdout().to_int() + min_lcores = 2 + # DPDK must be built for at least 2 cores + if max_lcores < min_lcores + message('Found less than @0@ cores, building for @0@ cores'.format(min_lcores)) + max_lcores = min_lcores + else + message('Found @0@ cores'.format(max_lcores)) + endif + dpdk_conf.set('RTE_MAX_LCORE', max_lcores) +elif max_lcores != 'default' + # overwrite the default value from arch_subdir with user input + dpdk_conf.set('RTE_MAX_LCORE', max_lcores.to_int()) +endif + +max_numa_nodes = get_option('max_numa_nodes') +if max_numa_nodes == 'detect' + # discovery makes sense only for non-cross builds + if meson.is_cross_build() + error('Discovery of max_numa_nodes not supported for cross-compilation.') + endif + # overwrite the default value with discovered values + max_numa_nodes = run_command(get_numa_count_cmd).stdout().to_int() + message('Found @0@ numa nodes'.format(max_numa_nodes)) + dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes) +elif max_numa_nodes != 'default' + # overwrite the default value from arch_subdir with user input + dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes.to_int()) +endif + +# check that CPU and NUMA counts are set +if not dpdk_conf.has('RTE_MAX_LCORE') + error('Number of CPU cores not specified.') +endif +if not dpdk_conf.has('RTE_MAX_NUMA_NODES') + error('Number of NUMA nodes not specified.') +endif + # set the install path for the drivers dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path) @@ -339,7 +383,8 @@ if is_freebsd endif if is_windows - # VirtualAlloc2() is available since Windows 10 / Server 2016. + # VirtualAlloc2() is available since Windows 10 / Server 2019. + # It's essential for EAL, so we don't support older versions. add_project_arguments('-D_WIN32_WINNT=0x0A00', language: 'c') # Use MinGW-w64 stdio, because DPDK assumes ANSI-compliant formatting. @@ -351,17 +396,6 @@ if is_windows if cc.get_id() == 'clang' add_project_arguments('-D_CRT_SECURE_NO_WARNINGS', language: 'c') endif - - add_project_link_arguments('-lws2_32', language: 'c') - - # Contrary to docs, VirtualAlloc2() is exported by mincore.lib - # in Windows SDK, while MinGW exports it by advapi32.a. - if is_ms_linker - add_project_link_arguments('-lmincore', language: 'c') - endif - - add_project_link_arguments('-ladvapi32', '-lsetupapi', language: 'c') - add_project_link_arguments('-ldbghelp', language: 'c') endif if get_option('b_lto')