Skip to content
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

Update Visual Studio build instructions #2355

Closed
wants to merge 11 commits into from
Closed

Conversation

bachase
Copy link
Collaborator

@bachase bachase commented Jan 25, 2018

This changeset removes the old VS2015 project files and adds Visual Studio 2017 instructions based on CMake.

The first two commits are from #2348, which will start requiring us too use boost 1.66.0.

In b29eddc, I added a default CMakeSettings.json file to the top-level directory, which means if you installed boost and openssl in the recommended C:\lib directories, the integrated cmake will work properly when opening the top-level folder in VS2017. However, the current convention is to include the boost version in the directory name, i.e. C:\lib\boost_1_66_0, so this file would need to change if you upgrade boost.

@bachase
Copy link
Collaborator Author

bachase commented Jan 25, 2018

I tagged our other main Windows developers, but appreciate anyone else having time to test these steps out. @manojsdoshi in particular might have some good feedback.

Any version of Visual Studio 2017 may be used to build rippled. The **Visual
Studio 2017 Community** edition is available free of charge (see [the product
page](https://www.visualstudio.com/products/visual-studio-community-vs) for
licensing details), while paid editions may be used for an free initial trial
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider "an initial free-trial period" instead.

licensing details), while paid editions may be used for an free initial trial
period.

As of this writing, the latest version of Visual Studio 2017 for Windows is
Copy link
Contributor

@mellery451 mellery451 Jan 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't object to this being here, but also don't think there is any benefit to mentioning current latest versions of software (one of them will surely be eclipsed within a short time). What could be useful is a table of known-to-work versions for each dependency. Perhaps this is what you were getting at here - if that's the case, I'd consider just making a table of each prerequisite and the version(s) that are known to work.

"variables": [
{
"name": "BOOST_ROOT",
"value": "C:\\lib\\boost_1_66_0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love that we're hard coding the boost version here. Is there a better way? Maybe just lib/boost?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree and that was part of my concern I wrote about in the first comment. Perhaps we just recommend C:\\lib\boost as you say, and users can do some type of symlink if they want to manage multiple versions.

@ripplelabs-jenkins
Copy link
Collaborator

ripplelabs-jenkins commented Jan 25, 2018

Jenkins Build Summary

Built from this commit

Built at 20180129 - 23:11:18

Test Results

Build Type Result Status
clang.debug.unity 985 cases, 0 failed, t: 442s PASS ✅
coverage 985 cases, 0 failed, t: 574s PASS ✅
clang.debug.nounity 983 cases, 0 failed, t: 350s PASS ✅
gcc.debug.unity 985 cases, 0 failed, t: 396s PASS ✅
gcc.debug.nounity 983 cases, 0 failed, t: 273s PASS ✅
clang.release.unity 984 cases, 0 failed, t: 476s PASS ✅
gcc.release.unity 984 cases, 0 failed, t: 506s PASS ✅


1. 64-bit. Use this if you are running 64-bit windows. As of this writing, the
link is called: "Win64 OpenSSL v1.0.2n".
2. 64-bit light - Don't use this. It is missing files needed to build rippled.
Copy link
Contributor

@mellery451 mellery451 Jan 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider adding emphasis to "Don't use this."

### Install OpenSSL

[Download OpenSSL.](http://slproweb.com/products/Win32OpenSSL.html) There will
be four variants available:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mention four variants then only list two. There will also be a link to download openssl 1.1, and people may be tempted to use it. However, rippled does not compile with openssl 1.1, only the 1.0 branch (at least last I checked, is this still true?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is still true AFAIK. I'll fix.

the bash prompt:

```powershell
git clone git@github.com:ripple/rippled.git
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to add the --recursive flag to get the submodules.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which components have submodules? I think after #2343 , docca will no longer be used. Are there others?

Copy link
Collaborator

@seelabs seelabs Jan 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, according to .gitmodules:

[submodule "src/nudb/extras/beast"]
        path = src/nudb/extras/beast
        url = https://github.com/vinniefalco/Beast.git
[submodule "src/nudb/extras/rocksdb"]
        path = src/nudb/extras/rocksdb
        url = https://github.com/facebook/rocksdb.git
[submodule "src/nudb/doc/docca"]
        path = src/nudb/doc/docca
        url = https://github.com/vinniefalco/docca.git

Copy link
Collaborator Author

@bachase bachase Jan 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are those actually needed for nudb though? Or just to build nudb examples and docs?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we need them, actually. If it works without the recursive them I'm fine leaving it off.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My test build did not do a --recursive clone, so I don't think they are. I'll leave it out unless someone else discovers otherwise.

"name": "x64-Debug",
"generator": "Visual Studio 15 2017 Win64",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64_x64" ],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is msvc_x64_x64 correct? I use msvc_x64.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think they added it after we started using it https://docs.microsoft.com/en-us/cpp/ide/cmake-tools-for-visual-cpp.

msvc_x64_x64 | Compile for AMD64 using 64-bit tools

]
}
]
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit. Add a carriage return for git happiness.

* [OpenSSL Library](README.md#install-openssl)
* [Boost library](README.md#build-boost)
* (Optional) [Cmake for Windows](README.md#optional-install-cmake-for-windows) -
Only needed if not using the integrated CMake in VS 2017.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it is worth mentioning that having Cmake for Windows will allow you to create VS project/solution files.

@@ -357,6 +357,12 @@ macro(use_boost)
if(NOT Boost_FOUND)
message(WARNING "Boost directory found, but not all components. May not be able to build.")
endif()
if(MSVC14)
# VS2017 with boost <= 1.66.0 requires a flag to suppress warnings
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: weird indentation here

link_directories($ENV{OPENSSL_ROOT}/lib)
if ((NOT DEFINED OPENSSL_ROOT) AND (DEFINED ENV{OPENSSL_ROOT}))
set(OPENSSL_ROOT $ENV{OPENSSL_ROOT})
endif()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: weird indentation here as well

@seelabs
Copy link
Collaborator

seelabs commented Jan 29, 2018

👍 After the indentation issues in CMakeFuncs.cmake are resolved

@miguelportilla
Copy link
Contributor

👍

@seelabs
Copy link
Collaborator

seelabs commented Jan 29, 2018

@bachase I just noticed that this PR doesn't interact well with scons vcxproj. We still need to support scons in 0.90.0.

@seelabs seelabs closed this Jan 29, 2018
@seelabs seelabs reopened this Jan 29, 2018
@bachase
Copy link
Collaborator Author

bachase commented Jan 29, 2018

scons vcxproj will still generate VS2015 project files, which can be opened with VS2017 too. I restored the deleted solution files for now and just note that they will be removed when we switch to cmake and remove scons support.

Copy link
Collaborator

@ximinez ximinez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ximinez ximinez added the Passed Passed code review & PR owner thinks it's ready to merge. Perf sign-off may still be required. label Jan 29, 2018
@seelabs
Copy link
Collaborator

seelabs commented Jan 30, 2018

In 0.90.0-b5

@seelabs seelabs closed this Jan 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Passed Passed code review & PR owner thinks it's ready to merge. Perf sign-off may still be required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants