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

Cannot compile on Windows #6

Closed
coincoin73 opened this issue May 19, 2020 · 12 comments
Closed

Cannot compile on Windows #6

coincoin73 opened this issue May 19, 2020 · 12 comments

Comments

@coincoin73
Copy link

coincoin73 commented May 19, 2020

Hello

I have tried to compile Visqol on Windows 10 but I have an error message with Bazel:

Cannot open include file: 'boost/filesystem.hpp': No such file or directory

Boost is installed in c:\boost, and I have check the match with the WORKSPACE file.
I also tried to clean the cache with bazel clean --expunge.

Bazel version is 1.0.0 (to avoid bash usage in previous version)
Boost version is 1.73
Visual Studio 2019

Thanks for your help.

@mchinen
Copy link
Collaborator

mchinen commented May 20, 2020

Thanks for this result. Looks like the search path isn't including boost for some reason. We normally are on linux or mac; it has been a while since we have a windows machine set up, unfortunately. I'll try to get one, but please update if you make progress on this.

@coincoin73
Copy link
Author

Thanks for the answer.
I have tried several modifications in the BUILD files without success.

@whlteXbread
Copy link
Contributor

I'm having the same issue---that glob on line 100 of WORKSPACE doesn't seem to be working as expected.

I made sure that I set up the boost stuff in the expected way, the headers are in c:\boost\boost.

I'm digging through the bazel docs now

@whlteXbread
Copy link
Contributor

I think there are a few things happening here:

  • the README says this was tested with bazel version 0.22.0, which is very out of date
  • bazel 0.22.0 is required to be run in msys, which I would think would prevent a path like `"C:\boost" from working
    • btw, don't forget to set the path for bazel and git in this shell
  • bazel 0.22.0 can't build protobuf anymore for some reason
  • bazel 3.3.0 (latest) can build everything, but it can't find the boost headers.
  • i tried running bazel 3.3.0 in msys and changing the path to /c/boost, no luck
  • also tried symlinking the boost folder into the visqol repo folder and setting a relative path, but that does not work
  • also tried adding **/*.hpp to the glob, because:
$ ls /c/boost/**/*.hpp | grep filesystem
/c/boost/boost/filesystem.hpp

I...am stumped!

@jonnor
Copy link
Contributor

jonnor commented Jun 26, 2020

@whlteXbread @coincoin73 Can you provide a build log verbose output, such that one can see the compiler invokations? I think running adding -s to the bazel command should do the trick. Hopefully one can see from the compiler command how the include paths are wrong, and from that maybe fix it

@whlteXbread
Copy link
Contributor

After issuing the following command:

bazel build :visqol -c opt --verbose_failures                                                             

here is the verbose output:

PS C:\Users\bordr\source\repos\google\visqol> bazel build :visqol -c opt --verbose_failures                                                                                                  INFO: Analyzed target //:visqol (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: C:/users/bordr/source/repos/google/visqol/BUILD:98:10: C++ compilation of rule '//:visqol' failed (Exit 2): cl.exe failed: error executing command
  cd C:/users/bordr/_bazel_bordr/jxvk2om5/execroot/__main__
  SET INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt
    SET PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\\Extensions\Microsoft\IntelliCode\CLI;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\\x64;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\;C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\\MSBuild\Current\Bin;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\;;C:\WINDOWS\system32;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja
    SET PWD=/proc/self/cwd
    SET RUNFILES_MANIFEST_ONLY=1
    SET TEMP=C:\Users\bordr\AppData\Local\Temp
    SET TMP=C:\Users\bordr\AppData\Local\Temp
  C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/HostX64/x64/cl.exe /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0601 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /bigobj /Zm500 /EHsc /wd4351 /wd4291 /wd4250 /wd4996 /I. /Ibazel-out/x64_windows-opt/bin /Iexternal/pffft_lib_win /Ibazel-out/x64_windows-opt/bin/external/pffft_lib_win /Iexternal/com_google_protobuf /Ibazel-out/x64_windows-opt/bin/external/com_google_protobuf /Iexternal/com_google_absl /Ibazel-out/x64_windows-opt/bin/external/com_google_absl /Iexternal/svm_lib /Ibazel-out/x64_windows-opt/bin/external/svm_lib /Iexternal/armadillo_headers /Ibazel-out/x64_windows-opt/bin/external/armadillo_headers /Iexternal/bazel_tools /Ibazel-out/x64_windows-opt/bin/external/bazel_tools /Isrc/include /Ibazel-out/x64_windows-opt/bin/src/include /Isrc/proto /Ibazel-out/x64_windows-opt/bin/src/proto /Isrc/svr_training /Ibazel-out/x64_windows-opt/bin/src/svr_training /Iexternal/com_google_protobuf/src /Ibazel-out/x64_windows-opt/bin/external/com_google_protobuf/src /Iexternal/armadillo_headers/include /Ibazel-out/x64_windows-opt/bin/external/armadillo_headers/include /D__CLANG_SUPPORT_DYN_ANNOTATION__ /showIncludes /MD /O2 /Oy- /DNDEBUG /wd4117 -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" /Gy /Gw /Fobazel-out/x64_windows-opt/bin/_objs/visqol/main.obj /c src/main.cc
Execution platform: @local_config_platform//:host
C:\users\bordr\_bazel_bordr\jxvk2om5\execroot\__main__\src\include\file_path.h(23): fatal error C1083: Cannot open include file: 'boost/filesystem.hpp': No such file or directory
Target //:visqol failed to build
INFO: Elapsed time: 8.567s, Critical Path: 2.79s
INFO: 0 processes.
FAILED: Build did NOT complete successfully

I don't know why, but there's no mention of boost in the SET INCLUDE= bit, despite it being explicitly set in the WORKSPACE file:

####################
# Platform Windows #
####################
# Boost Headers
new_local_repository(
    name = "boost_headers_windows",
    path = "C:\\boost",
    build_file_content = """
cc_library(
    name = "boost_header",
    hdrs = glob(["boost/**/*.hpp","boost/**/*.h"]),
    visibility = ["//visibility:public"],
)
""",
)

I know next to nothing about Bazel, but from what I've read in the docs, this config seems reasonable.

@jonnor
Copy link
Contributor

jonnor commented Jul 3, 2020

Seems that the Boost includes are completely missing from the include path. A workaround would be to put boost (or a symlink/hardlink) into one of the directories that is already on the include path. Like to have the files at src/include/boost/foo.hpp

@whlteXbread
Copy link
Contributor

I agree, I can't figure out why it's not in the include path.

You make a good suggestion though. I symlinked c:\boost into the last dir in the include path C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt:

 Directory of C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\cppwinrt

07/03/2020  04:48 PM    <DIR>          .
07/03/2020  04:48 PM    <DIR>          ..
07/03/2020  04:48 PM    <SYMLINKD>     boost [c:\boost]
08/09/2018  02:43 PM             1,159 LICENSE.txt
06/20/2020  06:35 PM    <DIR>          winrt
               1 File(s)          1,159 bytes
               4 Dir(s)  72,943,042,560 bytes free

I then opened msys, changed to that dir and verified that the glob boost/**/*.hpp returned the correct .hpp.

Same error.

@FeargusOG
Copy link
Contributor

Hi all! I worked on the original windows build for ViSQOL so I'll jump into this and see if I can make some headway on a solution.

@jonnor
Copy link
Contributor

jonnor commented Aug 1, 2020

Was able to get it working (at least under MSYS2) with very minor changes. See #16

@FeargusOG
Copy link
Contributor

Thanks @jonnor

@whlteXbread
Copy link
Contributor

Thanks @jonnor , I'll give this a shot soon!

@mchinen mchinen closed this as completed in c7706d7 Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants