From patchwork Mon Sep 21 01:32:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alin Serdean X-Patchwork-Id: 1368019 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cloudbasesolutions.com Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bvn593JkPz9sSn for ; Mon, 21 Sep 2020 11:33:17 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id E2CA585F66; Mon, 21 Sep 2020 01:33:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BadPXHTLWByV; Mon, 21 Sep 2020 01:33:11 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 1C44685F98; Mon, 21 Sep 2020 01:33:11 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id D952DC0893; Mon, 21 Sep 2020 01:33:10 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 93BEEC0051 for ; Mon, 21 Sep 2020 01:33:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 811958716D for ; Mon, 21 Sep 2020 01:33:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OyPIRrKIDdAe for ; Mon, 21 Sep 2020 01:33:03 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by hemlock.osuosl.org (Postfix) with ESMTPS id B6F4B87176 for ; Mon, 21 Sep 2020 01:33:02 +0000 (UTC) X-Originating-IP: 89.137.184.67 Received: from localhost.localdomain (unknown [89.137.184.67]) (Authenticated sender: aserdean@ovn.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id D192BC0008; Mon, 21 Sep 2020 01:33:00 +0000 (UTC) From: Alin Gabriel Serdean To: dev@openvswitch.org Date: Mon, 21 Sep 2020 04:32:39 +0300 Message-Id: <20200921013241.654-6-aserdean@cloudbasesolutions.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200921013241.654-1-aserdean@cloudbasesolutions.com> References: <20200921013241.654-1-aserdean@cloudbasesolutions.com> MIME-Version: 1.0 Subject: [ovs-dev] [PATCH v2 6/8] windows: Update build with latest pthread project X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" pthreads-win32 has moved too PThreads4W. This patch updates the build steps, CI (appveyor) and documentation. Signed-off-by: Alin Gabriel Serdean --- Documentation/intro/install/windows.rst | 10 +++++----- appveyor.yml | 18 +++++++----------- m4/openvswitch.m4 | 19 ++++--------------- 3 files changed, 16 insertions(+), 31 deletions(-) diff --git a/Documentation/intro/install/windows.rst b/Documentation/intro/install/windows.rst index 4c7724b57..dd7af4015 100644 --- a/Documentation/intro/install/windows.rst +++ b/Documentation/intro/install/windows.rst @@ -95,13 +95,13 @@ The following explains the steps in some detail. Visual studio's linker is used. You should also see a 'which sort' report ``/bin/sort.exe``. -- pthreads-win32 +- PThreads4W - For pthread support, install the library, dll and includes of pthreads-win32 + For pthread support, install the library, dll and includes of PThreads4W project from `sourceware - `__ to a - directory (e.g.: ``C:/pthread``). You should add the pthread-win32's dll path - (e.g.: ``C:\pthread\dll\x86``) to the Windows' PATH environment variable. + `__ to a directory + (e.g.: ``C:/pthread``). You should add the PThreads4W's dll path + (e.g.: ``C:\pthread\bin``) to the Windows' PATH environment variable. - OpenSSL diff --git a/appveyor.yml b/appveyor.yml index fa6754ce2..6e2b2e9e2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,5 @@ version: 1.0.{build} +image: Visual Studio 2019 branches: only: - master @@ -7,16 +8,8 @@ init: - ps: $env:PATH ="C:\Python37;"+$env:PATH - ps: New-Item -Type HardLink -Path "C:\Python37\python3.exe" -Value "C:\Python37\python.exe" - ps: >- - mkdir C:\pthreads-win32 - mkdir C:\ovs-build-downloads - $source = "ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-9-1-release.zip" - - $destination = "C:\pthreads-win32\pthreads-win32.zip" - - Invoke-WebRequest $source -OutFile $destination - $source = "https://slproweb.com/download/Win32OpenSSL-1_0_2t.exe" $destination = "C:\ovs-build-downloads\Win32OpenSSL-1_0_2t.exe" @@ -35,14 +28,17 @@ init: cd C:\openvswitch + git clone https://git.code.sf.net/p/pthreads4w/code c:\pthreads4w-code + python3 -m pip install pypiwin32 --disable-pip-version-check build_script: -- '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd"' +- '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"' - C:\MinGW\msys\1.0\bin\bash -lc "echo \"C:/MinGW /mingw\" > /etc/fstab" -- C:\MinGW\msys\1.0\bin\bash -lc "cp /c/pthreads-win32/Pre-built.2/dll/x86/*.dll /c/openvswitch/." - C:\MinGW\msys\1.0\bin\bash -lc "mv /bin/link.exe /bin/link_copy.exe" +# Build pthreads +- C:\MinGW\msys\1.0\bin\bash -lc "cd /c/pthreads4w-code && nmake all install" - C:\MinGW\msys\1.0\bin\bash -lc "cd /c/openvswitch && ./boot.sh" -- C:\MinGW\msys\1.0\bin\bash -lc "cd /c/openvswitch && ./configure CC=build-aux/cccl LD=\"`which link`\" LIBS=\"-lws2_32 -lShlwapi -liphlpapi -lwbemuuid -lole32 -loleaut32\" --with-pthread=C:/pthreads-win32/Pre-built.2 --with-openssl=C:/OpenSSL-Win32 --with-vstudiotarget=\"Debug\" +- C:\MinGW\msys\1.0\bin\bash -lc "cd /c/openvswitch && ./configure CC=build-aux/cccl LD=\"`which link`\" LIBS=\"-lws2_32 -lShlwapi -liphlpapi -lwbemuuid -lole32 -loleaut32\" --with-pthread=c:/PTHREADS-BUILT/ --with-openssl=C:/OpenSSL-Win32 --with-vstudiotarget=\"Debug\" - C:\MinGW\msys\1.0\bin\bash -lc "cd /c/openvswitch && make" - C:\MinGW\msys\1.0\bin\bash -lc "cd /c/openvswitch && make datapath_windows_analyze" diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4 index 31b0f56b0..e0ed1dbf5 100644 --- a/m4/openvswitch.m4 +++ b/m4/openvswitch.m4 @@ -95,23 +95,12 @@ AC_DEFUN([OVS_CHECK_WIN32], AC_MSG_ERROR([Invalid --with-pthread value]) ;; *) - if (cl) 2>&1 | grep 'x64' >/dev/null 2>&1; then - cl_cv_x64=yes - else - cl_cv_x64=no - fi - if test "$cl_cv_x64" = yes; then - PTHREAD_WIN32_DIR=$withval/lib/x64 - PTHREAD_WIN32_DIR_DLL=/$(echo ${withval} | ${SED} -e 's/://')/dll/x64 - PTHREAD_WIN32_DIR_DLL_WIN_FORM=$withval/dll/x64 - else - PTHREAD_WIN32_DIR=$withval/lib/x86 - PTHREAD_WIN32_DIR_DLL=/$(echo ${withval} | ${SED} -e 's/://')/dll/x86 - PTHREAD_WIN32_DIR_DLL_WIN_FORM=$withval/dll/x86 - fi + PTHREAD_WIN32_DIR=$withval/lib + PTHREAD_WIN32_DIR_DLL=/$(echo ${withval} | ${SED} -e 's/://')/bin + PTHREAD_WIN32_DIR_DLL_WIN_FORM=$withval/bin PTHREAD_INCLUDES=-I$withval/include PTHREAD_LDFLAGS=-L$PTHREAD_WIN32_DIR - PTHREAD_LIBS="-lpthreadVC2" + PTHREAD_LIBS="-lpthreadVC3" AC_SUBST([PTHREAD_WIN32_DIR_DLL_WIN_FORM]) AC_SUBST([PTHREAD_WIN32_DIR_DLL]) AC_SUBST([PTHREAD_INCLUDES])