Bug 1283 - Failing to compile testpmd on Windows
Summary: Failing to compile testpmd on Windows
Status: CONFIRMED
Alias: None
Product: DPDK
Classification: Unclassified
Component: testpmd (show other bugs)
Version: 23.11
Hardware: x86 Windows
: Normal critical
Target Milestone: ---
Assignee: Tyler Retzlaff
URL:
Depends on:
Blocks:
 
Reported: 2023-09-06 09:28 CEST by Pier Damouny
Modified: 2023-10-03 16:34 CEST (History)
4 users (show)



Attachments

Description Pier Damouny 2023-09-06 09:28:10 CEST
when i do 

1. "C:\Program Files\Meson\meson.exe" --buildtype debug "-Dc_args=-I\"C:\Program Files\Mellanox\MLNX_WinOF2_DevX_SDK\inc\"" "-Dc_link_args=-L\"C:\Program Files\Mellanox\MLNX_WinOF2_DevX_SDK\lib\"" "-Dexamples=udpfwd,flow_filtering,l2fwd,l2fwd_default_flow,helloworld,udpfwd_rss,l2fwd_master,udpfwd_rx_tx_cheksum,l2fwd_rss" build

2. ninja 

i get 

FAILED: drivers/common/idpf/6e54547@@idpf_common_avx512_lib@sta/idpf_common_rxtx_avx512.c.obj
clang @drivers/common/idpf/6e54547@@idpf_common_avx512_lib@sta/idpf_common_rxtx_avx512.c.obj.rsp
In file included from ../drivers/common/idpf/idpf_common_rxtx_avx512.c:6:
In file included from ..\drivers\common\idpf/idpf_common_device.h:9:
In file included from ..\drivers\common\idpf/base/idpf_prototype.h:9:
In file included from ..\drivers\common\idpf/base/idpf_osdep.h:18:
In file included from ..\lib\eal\include\rte_malloc.h:16:
In file included from ..\lib\eal\include\rte_memory.h:25:
In file included from ..\lib\eal\include\rte_fbarray.h:39:
In file included from ..\lib\eal\x86\include\rte_rwlock.h:13:
In file included from ..\lib\eal\x86\include/rte_spinlock.h:18:
In file included from ..\lib\eal\x86\include/rte_cycles.h:12:
In file included from C:\Program Files\LLVM\lib\clang\11.0.0\include\x86intrin.h:24:
C:\Program Files\LLVM\lib\clang\11.0.0\include\prfchwintrin.h:50:1: error: conflicting types for '__m_prefetchw'
_m_prefetchw(void *__P)
^
..\lib\eal\windows\include\rte_windows.h:28:22: note: expanded from macro '_m_prefetchw'
#define _m_prefetchw __m_prefetchw
                     ^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um\winnt.h:3538:1: note: previous declaration is here
_m_prefetchw (
^
..\lib\eal\windows\include\rte_windows.h:28:22: note: expanded from macro '_m_prefetchw'
#define _m_prefetchw __m_prefetchw
                     ^
1 error generated.
[131/810] Compiling C object drivers/a715181@@tmp_rte_common_mlx5@sta/common_mlx5_mlx5_devx_cmds.c.obj
ninja: build stopped: subcommand failed.
Comment 1 David Marchand 2023-09-06 09:47:19 CEST
This sounds like a previous report from Ali, see bz1281 and confirm it is a duplicate.
Comment 2 Pier Damouny 2023-09-06 10:00:50 CEST
previous bug is failure in getting 'librte_log.lib', 'librte_kvargs.lib'

this bug is failure due to conflict for '__m_prefetchw' _m_prefetchw(void *__P)
Comment 3 Dmitry Kozlyuk 2023-09-06 10:03:35 CEST
David, this bug does not resemble BZ 1281 at all; doubtfully a duplicate.

Pier, I think this is broken by 58e7eb1acd0c ("eal/x86: use TSC intrinsic"), which added #include <x86intrin.h> to <rte_cycles.h>. This header should not be used directly but only through <rte_vect.h>. Similar issues were resolved before, e.g. 4feddcfc6cf1 ("net/iavf: build on Windows") and ce6617a0698e ("net/ice: build on Windows").
Comment 4 David Marchand 2023-09-06 10:19:25 CEST
Sorry, I mixed with another report from Ali.
This was reported and discussed here:

http://inbox.dpdk.org/dev/DM4PR12MB516765E72E643B57EDFE5758DAE2A@DM4PR12MB5167.namprd12.prod.outlook.com/
Comment 5 Tyler Retzlaff 2023-09-08 05:39:00 CEST
David, Dmitry the mail reference provided is the same issue as discussed on list.

Pier what I would like to understand is the impact.  Is using newer llvm/clang prohibitive?

Confirming as a bug because it is in fact broken, what is unclear is whether or not we will resolve this as won't fix.

Thanks
Comment 6 Pier Damouny 2023-10-01 17:07:52 CEST
Hi,
any update?
Comment 7 Dmitry Kozlyuk 2023-10-01 17:51:55 CEST
Pier, please try the following patch, it resolves the issue for me with clang/LLVM 10.0.0:

diff --git a/lib/eal/x86/include/rte_cycles.h b/lib/eal/x86/include/rte_cycles.h
index 2afe85e28c..58cc6f40de 100644
--- a/lib/eal/x86/include/rte_cycles.h
+++ b/lib/eal/x86/include/rte_cycles.h
@@ -9,7 +9,7 @@
 #ifdef RTE_TOOLCHAIN_MSVC
 #include <intrin.h>
 #else
-#include <x86intrin.h>
+#include <rte_vect.h>
 #endif

 #ifdef __cplusplus

Tyler, I think this would be a proper fix. You suggested using a newer toolchain, in which version of clang/LLVM does the current "main" build for you?
Comment 8 Pier Damouny 2023-10-03 16:34:50 CEST
llvm 12 didn't work for me so i installed 17 and all works now

Note You need to log in before you can comment on or make changes to this bug.