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

Build win32 #12

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Build win32 #12

wants to merge 7 commits into from

Conversation

tksharpless
Copy link

Summary

Build facebook360-dep on Windows using cmake targeting MSVCC toolchain;
dependencies installed with vcpkg;
result is native executables not requiring Docker.

Changelog

modified cmake scripts
-- target MSVCC 14.1 (VS 2017) toolchain
-- correct some library references
-- new sub-script to build ISPC compressor libraries
source code mods addressing
-- gflags linkage differences
-- use of wchar pathnames in boost::filesystem
-- remove some incorrect win32 options

Test Plan

clone repo
install required packages with vcpkg --
configure a build with cmake using VC15 project generator
build solution with Visual Studio
verify unit tests pass
run several processing jobs, comparing output with reference Linux build

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 10, 2019
@tksharpless
Copy link
Author

This is a complex work in progress, not expected to be production ready for some time.
The purpose of this pull request is to let facebook devs examine the proposed changes and provide feedback.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@aparrapo has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@tksharpless
Copy link
Author

It appears that zlib is not installed on the test build system. This cannot be due to the code changes in the branch under test.

@aparrapo
Copy link
Contributor

zlib is in Dockerfile:
https://github.com/facebook/facebook360_dep/blob/master/Dockerfile#L92

Try surrounding the include on CMakeLists.txt to avoid the include on UNIX/Apple builds. It can still work, it may just not find the package config file:

if(UNIX AND NOT APPLE):
  find_package(zlib REQUIRED)
endif()

CMakeLists.txt Outdated
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -m64 -O3 -funroll-loops -pipe")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -mmmx -mavx -msse -msse3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wsign-compare")
else(UNIX)
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be a regular else()?

Copy link
Author

Choose a reason for hiding this comment

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

Cmake allows arguments to else, endif etc as fiducial labels (used to require them). If given they must match the argument of matching bracket. So this is OK, but not necessary.
I see now that it actually is my fault that the Linux build failed with"could not find zlib". Evidently Linux packages don't need an external zlib; but Windows packages universally do, so I just reflexively added find_package(zlib). In the latest commit, which I will push soon, this line is protected by if(WIN32) so that build error should not happen again.
The new cmakelists includes the capability to create a vcpkg instance and populate it with all the required packages (except ICPC, which is not on the vcpkg repo); or alternatively to use an existing vcpkg instance. This is supported by cmake scripts in a new directory 'build_win32', which also has instructions for my windows build. All of this is WIN32-only and should have no effect on the Linux build.

@facebook-github-bot
Copy link
Contributor

@tksharpless has updated the pull request. Re-import the pull request

@tksharpless
Copy link
Author

Glad that the Linux build is working. I still have to add ispc and test to the Windows build, then will push again. I don't envision any further changes that might affect the Linux build, save possible source changes for compiler compatibility.
I hope you will be able to do some testing of the Windows build when it is complete. Note that it is not a Docker build and involves a manual step -- building the MSVC solution -- which actually could be automated with msbuild but I see no need for that at present.

@tksharpless
Copy link
Author

Question about Dep_unit_test. In CMakelists.txt one of the target link libraries is specified as 'gtest', but there is no find_package() for gtest. How does this library reference get resolved on Linux?
On windows the generated link command has 'gtest.lib' with no path, and the link fails.
And strangely, although adding find_pakage(gtest) does find the vcpkg installation of gtest, the name in the link command does not change.

@aparrapo
Copy link
Contributor

find_package forces CMake to search for a file called Find<package>.cmake, which contains information about where the package is installed, its version, and other useful details. Some packages do not add this .cmake file (e.g. sometimes via apt-get) but it doesn't mean the package is not installed. It will be found in the default installation path(s).

In Windows you can try adding the gtest source directory as a project subdirectory:
https://stackoverflow.com/a/21479008

@tksharpless
Copy link
Author

tksharpless commented Oct 14, 2019 via email

@tksharpless
Copy link
Author

tksharpless commented Oct 14, 2019 via email

@facebook-github-bot
Copy link
Contributor

@tksharpless has updated the pull request. Re-import the pull request

@tksharpless
Copy link
Author

tksharpless commented Oct 14, 2019 via email

@facebook-github-bot
Copy link
Contributor

@tksharpless has updated the pull request. Re-import the pull request

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@aparrapo has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@aparrapo
Copy link
Contributor

@tksharpless we somehow forgot to add the fused/striped data to the single frame dataset, but it should be on the multi-frame rendered sample sequence:
https://facebook360-dep-downloads.s3-us-west-2.amazonaws.com/room_chat/50_frames_unpacked_rendered.zip

Try to use that while we re-compute the data for the single frame case.

@tksharpless
Copy link
Author

tksharpless commented Oct 17, 2019 via email

@aparrapo
Copy link
Contributor

@tksharpless did you get a chance to test GlViewer?

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@aparrapo has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@tksharpless
Copy link
Author

tksharpless commented Dec 16, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants