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

Rewrite compile.bat and Update GA workflow to build binaries on Windows: Use Git Version, Use MSBuild, and Allow custom Boost and MSBuild paths #395

Merged
merged 19 commits into from
Feb 15, 2025

Conversation

rwxayheee
Copy link
Collaborator

@rwxayheee rwxayheee commented Feb 15, 2025

This is a renovation of current build approach on Windows. To address Issue #390.

Expect to add an installation note in doc for people who want to build binaries on Windows.

@rwxayheee rwxayheee changed the title Update GA workflow to build binaries on Windows: Use Git Version, Use MSBuild, and allow customize Boost and MSBuild paths Rewrite compile.bat and Update GA workflow to build binaries on Windows: Use Git Version, Use MSBuild, and allow customize Boost and MSBuild paths Feb 15, 2025
@rwxayheee rwxayheee changed the title Rewrite compile.bat and Update GA workflow to build binaries on Windows: Use Git Version, Use MSBuild, and allow customize Boost and MSBuild paths Rewrite compile.bat and Update GA workflow to build binaries on Windows: Use Git Version, Use MSBuild, and Allow customize Boost and MSBuild paths Feb 15, 2025
@rwxayheee rwxayheee added the documentation Improvements or additions to documentation label Feb 15, 2025
@rwxayheee rwxayheee changed the title Rewrite compile.bat and Update GA workflow to build binaries on Windows: Use Git Version, Use MSBuild, and Allow customize Boost and MSBuild paths Rewrite compile.bat and Update GA workflow to build binaries on Windows: Use Git Version, Use MSBuild, and Allow custom Boost and MSBuild paths Feb 15, 2025
@rwxayheee
Copy link
Collaborator Author

rwxayheee commented Feb 15, 2025

Previously, the versions of the project, and the versions and locations of boost library were all hard-coded in the vcxproj files. This PR updates the build approach for Windows executables (vina.exe and vina_split.exe):

  • Replace the builder, Common7\IDE\devenv.com, by MSBuild for flexible installation and better control

This is also available

  • Getting Git Version in a similar manner to the build process on Linux/Mac

The artifact has version information similar to this:

AutoDock Vina v1.2.6-56-gc28e340
  • Customizable Boost location, and hereby more flexible with Boost version
    The steps in the GA workflow showcase a usage of the new compile.dat, in PowerShell:
.\compile.bat Release x64 "C:\local\boost_1_83_0\lib64-msvc-14.2" "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe" "$env:GIT_VERSION"

Here, 5 variables are passed in order to specify:

  • Configuration (see options in vcxproj)
  • Platform (see options in vcxproj)
  • Path of Boost Library. The Boost Include path (for header files) is interpreted based on the Boost Library Path (within vcxproj)
  • Path of MSBuild Executable. In theory, a full installation of Visual Studio is not required.
  • Git Version. This can be overriden by anything when people try to compile Vina by themselves. The default is Git Version.

An installation guide can be added to documentation, when this is in release. Building on WIndows with this approach currently requires:

  • Boost library
  • MSBuild
  • Git (optional, for versioning)

@rwxayheee rwxayheee requested a review from joanimato February 15, 2025 06:43
Copy link
Collaborator

@joanimato joanimato left a comment

Choose a reason for hiding this comment

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

I can't test this personally, but since the tests pass I'll assume everything works ok.

@@ -23,7 +23,7 @@ on:

jobs:
compile_binaries:
name: Build wheels on ${{ matrix.os }} ${{ matrix.arch }}
name: Compile binaries on ${{ matrix.os }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's leave this as it is, reporting both the os and arch.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We have specifc name including arch for each step. The generic name here might not apply. Here because we didn't define arch type for windows (not sure why though..) this might fail. I can try though!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You are right that the name still shows up in the log file. The individual job name follows the name of each step. I will make the correction. I can improve the names

@rwxayheee
Copy link
Collaborator Author

I can't test this personally, but since the tests pass I'll assume everything works ok.

Thanks! I can test on two more Windows computers with slightly different configurations.

@rwxayheee
Copy link
Collaborator Author

rwxayheee commented Feb 15, 2025

Tested on two more systems to make sure compile.bat can compile on older systems without powershell.

Made a small change in 3ba69f1 to allow compilation with different versions of msvc. Previously, msvc-v142 is hardcoded in vcxproj and it works for Visual Studio 2019 (v16.x). As of today, the official website is featuring Visual Studio 2022 (v17.x) and build tools, which need msvc-143.

This is ready :D can be merged any time. thanks!!

@joanimato joanimato merged commit 677c037 into ccsb-scripps:develop Feb 15, 2025
8 checks passed
@rwxayheee rwxayheee deleted the use_msbuild branch February 15, 2025 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants