diff --git a/ports/dpdk/0002-fix-dependencies.patch b/ports/dpdk/0002-fix-dependencies.patch index b3f78a5866..cb1d65ea37 100644 --- a/ports/dpdk/0002-fix-dependencies.patch +++ b/ports/dpdk/0002-fix-dependencies.patch @@ -8,7 +8,7 @@ index 34b85f10b5..5ed4625d9e 100644 if find_libnuma - numa_dep = cc.find_library('numa', required: false) - if numa_dep.found() and cc.has_header('numaif.h') -+ numa_dep = dependency('numa', method: 'pkg-config') ++ numa_dep = dependency('numa', method: 'pkg-config', required: false) + if numa_dep.found() dpdk_conf.set10('RTE_HAS_LIBNUMA', true) has_libnuma = true diff --git a/ports/dpdk/portfile.cmake b/ports/dpdk/portfile.cmake index 37316613e8..2ec0cd591c 100644 --- a/ports/dpdk/portfile.cmake +++ b/ports/dpdk/portfile.cmake @@ -1,4 +1,4 @@ -if(VCPKG_TARGET_IS_LINUX) +if(VCPKG_TARGET_IS_LINUX AND VCPKG_HOST_IS_LINUX) execute_process( COMMAND uname --kernel-release OUTPUT_VARIABLE KERNEL_VERSION @@ -36,6 +36,7 @@ vcpkg_from_github( 0003-remove-examples-src-from-datadir.patch 0004-stop-building-apps.patch 0005-no-absolute-driver-path.patch + rename-sched.h.diff ) macro(append_bool_option feature_name option_name) @@ -47,48 +48,55 @@ macro(append_bool_option feature_name option_name) endmacro() set(DPDK_OPTIONS "") +set(DPDK_OPTIONS_RELEASE "") append_bool_option("docs" "enable_docs") append_bool_option("kmods" "enable_kmods") append_bool_option("tests" "tests") append_bool_option("trace" "enable_trace_fp") -string(REPLACE "-Denable_docs=true" "-Denable_docs=false" DPDK_OPTIONS_DEBUG "${DPDK_OPTIONS}") -list(APPEND PYTHON_PACKAGES pyelftools) +set(PYTHON_PACKAGES "") +if(VCPKG_TARGET_IS_WINDOWS) + # https://doc.dpdk.org/guides/windows_gsg/build_dpdk.html#option-3-native-build-on-windows-using-msvc + list(APPEND DPDK_OPTIONS "-Denable_stdatomic=true") +else() + list(APPEND PYTHON_PACKAGES pyelftools) +endif() if("docs" IN_LIST FEATURES) + list(APPEND DPDK_OPTIONS_RELEASE "-Denable_docs=true") + vcpkg_find_acquire_program(DOXYGEN) list(APPEND PYTHON_PACKAGES packaging sphinx) endif() -x_vcpkg_get_python_packages(PYTHON_VERSION "3" PACKAGES ${PYTHON_PACKAGES}) +if(PYTHON_PACKAGES) + x_vcpkg_get_python_packages(OUT_PYTHON_VAR PYTHON3 PYTHON_VERSION "3" PACKAGES ${PYTHON_PACKAGES}) +endif() vcpkg_configure_meson(SOURCE_PATH "${SOURCE_PATH}" OPTIONS + -Ddeveloper_mode=disabled -Ddisable_drivers=regex/cn9k - -Dexamples= - OPTIONS_RELEASE ${DPDK_OPTIONS} - OPTIONS_DEBUG - ${DPDK_OPTIONS_DEBUG} + OPTIONS_RELEASE + ${DPDK_OPTIONS_RELEASE} + ADDITIONAL_BINARIES + "doxygen = ['${DOXYGEN}']" ) vcpkg_install_meson() - -set(tools - dpdk-cmdline-gen.py - dpdk-devbind.py - dpdk-pmdinfo.py - dpdk-telemetry.py - dpdk-hugepages.py - dpdk-rss-flows.py - dpdk-telemetry-exporter.py -) -vcpkg_copy_tools(TOOL_NAMES ${tools} AUTO_CLEAN) - vcpkg_fixup_pkgconfig() +file(GLOB scripts "${CURRENT_PACKAGES_DIR}/bin/*.py") +file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}") +foreach(script IN LISTS scripts) + cmake_path(GET script FILENAME filename) + file(RENAME "${script}" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/${filename}") + file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/${filename}") +endforeach() +vcpkg_clean_executables_in_bin(FILE_NAMES none) + if("docs" IN_LIST FEATURES) - file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/dpdk") - file(RENAME "${CURRENT_PACKAGES_DIR}/share/doc/dpdk" "${CURRENT_PACKAGES_DIR}/share/dpdk/doc") + file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/${PORT}") + file(RENAME "${CURRENT_PACKAGES_DIR}/share/doc/dpdk" "${CURRENT_PACKAGES_DIR}/share/${PORT}/doc") endif() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/share/doc") -file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/license/README") diff --git a/ports/dpdk/rename-sched.h.diff b/ports/dpdk/rename-sched.h.diff new file mode 100644 index 0000000000..78c51eaaba --- /dev/null +++ b/ports/dpdk/rename-sched.h.diff @@ -0,0 +1,71 @@ +diff --git a/lib/eal/common/eal_common_thread.c b/lib/eal/common/eal_common_thread.c +index a53bc63..087ec80 100644 +--- a/lib/eal/common/eal_common_thread.c ++++ b/lib/eal/common/eal_common_thread.c +@@ -6,7 +6,11 @@ + #include + #include + #include ++#ifdef _WIN32 ++#include ++#else + #include ++#endif + #include + #include + +diff --git a/lib/eal/windows/include/meson.build b/lib/eal/windows/include/meson.build +index e985a77..dbd6b4b 100644 +--- a/lib/eal/windows/include/meson.build ++++ b/lib/eal/windows/include/meson.build +@@ -6,5 +6,5 @@ includes += include_directories('.') + headers += files( + 'rte_os.h', + 'rte_windows.h', +- 'sched.h', ++ 'sched_from_dpdk.h', + ) +diff --git a/lib/eal/windows/include/pthread.h b/lib/eal/windows/include/pthread.h +index e1c3101..f28b37d 100644 +--- a/lib/eal/windows/include/pthread.h ++++ b/lib/eal/windows/include/pthread.h +@@ -6,7 +6,7 @@ + #define _PTHREAD_H_ + + #include +-#include ++#include + + /** + * This file is required to support the common code in eal_common_proc.c, +diff --git a/lib/eal/windows/include/rte_os.h b/lib/eal/windows/include/rte_os.h +index 9d69467..4df82dd 100644 +--- a/lib/eal/windows/include/rte_os.h ++++ b/lib/eal/windows/include/rte_os.h +@@ -14,7 +14,7 @@ + #include + #include + +-#include ++#include + + /* These macros are compatible with bundled sys/queue.h. */ + #define RTE_TAILQ_HEAD(name, type) \ +diff --git a/lib/eal/windows/include/sched.h b/lib/eal/windows/include/sched_from_dpdk.h +similarity index 97% +rename from lib/eal/windows/include/sched.h +rename to lib/eal/windows/include/sched_from_dpdk.h +index 912fed1..400c927 100644 +--- a/lib/eal/windows/include/sched.h ++++ b/lib/eal/windows/include/sched_from_dpdk.h +@@ -2,8 +2,8 @@ + * Copyright(c) 2019 Intel Corporation + */ + +-#ifndef _SCHED_H_ +-#define _SCHED_H_ ++#ifndef _SCHED_FROM_DPDK_H_ ++#define _SCHED_FROM_DPDK_H_ + + /** + * This file is added to support the common code in eal_common_thread.c diff --git a/ports/dpdk/usage b/ports/dpdk/usage deleted file mode 100644 index 5e058c3a4d..0000000000 --- a/ports/dpdk/usage +++ /dev/null @@ -1,6 +0,0 @@ -The package dpdk can be imported via CMake FindPkgConfig module: - - find_package(PkgConfig) - pkg_check_modules(DPDK REQUIRED IMPORTED_TARGET libdpdk) - - target_link_libraries(main PRIVATE PkgConfig::DPDK) diff --git a/ports/dpdk/vcpkg.json b/ports/dpdk/vcpkg.json index 194a1f9d18..4e8f096d3d 100644 --- a/ports/dpdk/vcpkg.json +++ b/ports/dpdk/vcpkg.json @@ -1,11 +1,12 @@ { "name": "dpdk", - "version-string": "24.11.3", + "version": "24.11.3", + "port-version": 1, "description": "A set of libraries and drivers for fast packet processing", "homepage": "https://www.dpdk.org/", - "documentation": "https://doc.dpdk.org/guides/index.html", + "documentation": "https://doc.dpdk.org/guides/", "license": "BSD-3-Clause", - "supports": "linux | freebsd", + "supports": "freebsd | linux | (windows & x64)", "dependencies": [ { "name": "libarchive", @@ -15,7 +16,6 @@ "name": "numactl", "platform": "linux" }, - "python3", { "name": "vcpkg-get-python-packages", "host": true diff --git a/scripts/ci.feature.baseline.txt b/scripts/ci.feature.baseline.txt index 84fb54d1f6..96ee1220a6 100644 --- a/scripts/ci.feature.baseline.txt +++ b/scripts/ci.feature.baseline.txt @@ -86,7 +86,6 @@ discord-game-sdk:x64-windows-static-md=fail discord-game-sdk:x64-windows-static=fail discord-rpc(uwp)=fail dmlc(uwp) = fail -dpdk[docs]:x64-linux = feature-fails # doxygen required to build docs ensmallen[openmp](osx) = feature-fails # No openmp on default osx toolchain epsilon(uwp)=fail faiss:arm64-windows=fail diff --git a/versions/baseline.json b/versions/baseline.json index 71bb3b7b17..c50b6d856f 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2526,7 +2526,7 @@ }, "dpdk": { "baseline": "24.11.3", - "port-version": 0 + "port-version": 1 }, "dpp": { "baseline": "10.1.3", diff --git a/versions/d-/dpdk.json b/versions/d-/dpdk.json index 822b51977b..3ada439fba 100644 --- a/versions/d-/dpdk.json +++ b/versions/d-/dpdk.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "c7a3787ad80d51937e2b97a7ef9888afe4b80061", + "version": "24.11.3", + "port-version": 1 + }, { "git-tree": "688a23c5e2022b2bfec803eb636b87e6d7655f34", "version-string": "24.11.3",