-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cmake build on Windows #1849
Cmake build on Windows #1849
Conversation
add build helper script extend windows build script to use vcpkg Adding check for invalid windows options
This pull request introduces 1 alert when merging 28a9e65 into bed5b80 - view on LGTM.com new alerts:
Comment posted by LGTM.com |
investigating the failed CI, looks like the python 2.7 windows build failed for some reason |
updating docs, making vcpkg-root option optional and Windows-only clean up unused import Current python build on Windows links against boost statically
3bdd7bf
to
ee4c06d
Compare
There is one difference between the outputs of the cmake and sln builds for Windows python. The cmake/setup.py installation ensures all required dlls are copied to the appropriate location |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, up to some questions and minor things.
# VW targets Windows 8.1 SDK | ||
if(WIN32) | ||
set(CMAKE_SYSTEM_VERSION 8.1 CACHE TYPE INTERNAL FORCE) | ||
endif() | ||
|
||
project(vowpal_wabbit C CXX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Minor] Is there a reason this line needs to be below the Win8.1 SDK targetting setting? If so, consider adding a comment about this.
CMakeLists.txt
Outdated
@@ -40,6 +40,10 @@ option(LTO "Enable Link Time optimization (Requires Release build, only works wi | |||
|
|||
string(TOUPPER "${CMAKE_BUILD_TYPE}" CONFIG) | |||
|
|||
if(WIN32 AND (PROFILE OR VALGRIND_PROFILE OR GCOV OR STATIC_LINK_VW OR BUILD_JAVA OR LTO)) | |||
message(FATAL_ERROR "Unsupported option enabled on Win32 build") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Minor] Are we actually building in Win32 mode? (X86) If not, consider changing to "on Windows build"
message(FATAL_ERROR "Unsupported option enabled on Win32 build") | |
message(FATAL_ERROR "Unsupported option enabled on Windows build") |
python/pylibvw.cc
Outdated
@@ -10,7 +10,7 @@ | |||
#include "../vowpalwabbit/options_serializer_boost_po.h" | |||
|
|||
// see http://www.boost.org/doc/libs/1_56_0/doc/html/bbv2/installation.html | |||
#define BOOST_PYTHON_STATIC_LIB | |||
//#define BOOST_PYTHON_STATIC_LIB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Minor] Can be removed?
//#define BOOST_PYTHON_STATIC_LIB |
build-windows.bat
Outdated
|
||
cmake %~dp0 -G "Visual Studio 14 2015 Win64" -DCMAKE_TOOLCHAIN_FILE=%VCPKG_PATH%\scripts\buildsystems\vcpkg.cmake | ||
msbuild vowpal_wabbit.sln /p:Configuration=Release | ||
GOTO FINISH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Minor] Consider using the :EOF automatic label.
GOTO FINISH | |
GOTO:EOF |
@@ -79,10 +83,6 @@ if(GCOV) | |||
set(linux_flags ${linux_flags} -g -O0 -fprofile-arcs -ftest-coverage -fno-strict-aliasing -pg) | |||
endif() | |||
|
|||
set(windows_release_config /GL /O2 /Gy /Oi /Ob2 /Ot /Oy /GT /MD) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not need these compiler flags? (I am not sure what they do offhand)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These flags are set in the CMakeSettings.json file. Setting this stuff here was causing problems between the various configs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does build-windows.bat need to reference this somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to be automagic CMake functionality
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is CMakeSettings.json? It isn't in the repo? These flags are required in some form
build-windows.bat
Outdated
@@ -0,0 +1,17 @@ | |||
@echo off |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this file be under python/? Or alternatively, call it build-windows-experimental.bat?
(This does not seem like it will build the .NET bindings, and that is one of the major Windows targets)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
build-windows-experimental.bat doesn't actually build the python bindings, just the main library (with associated dll/exes)
Dependencies managed through vcpkg
Required vcpkgs
Unsupported CMake options
edit:
Python build now supported!
A manual hack for python 2.7 is required on vcpkg because boost-python builds on python3 by default with no programatic way to change the version
Verified on Windows against python 2.7, 3.7