Git Product home page Git Product logo

Comments (11)

romainguy avatar romainguy commented on May 8, 2024 2

Yes, we'll provide Windows binaries.

Did you run into compilation failures with clang or msvc? We only support building with clang on Windows at the moment.

from filament.

shartte avatar shartte commented on May 8, 2024

I've used the following build commands, and the compiler identification reads as Clang 6.0, so it seems to be using Clang.

I had to pass -Wno-everything because by default, it produces hundreds of thousands of lines of C++98 compat warnings, which seems unintentional.

mkdir cmake-windows
cd cmake-windows

cmake -T"LLVM-vs2014" -DCMAKE_CXX_FLAGS="-Wno-everything" -G "Visual Studio 14 2015 Win64" ..
msbuild TNT.sln /t:filament /p:configuration=Release

The initial output of CMake:

cmake -T"LLVM-vs2014" -DCMAKE_CXX_FLAGS="-Wno-everything" -G "Visual Studio 14 2015 Win64" ..
-- The C compiler identification is Clang 6.0.0
-- The CXX compiler identification is Clang 6.0.0
-- Check for working C compiler: C:/Program Files/LLVM/msbuild-bin/cl.exe
-- Check for working C compiler: C:/Program Files/LLVM/msbuild-bin/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files/LLVM/msbuild-bin/cl.exe
-- Check for working CXX compiler: C:/Program Files/LLVM/msbuild-bin/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM compiler identification is Clang
-- Found assembler: C:/Program Files/LLVM/msbuild-bin/cl.exe
-- The ASM_MASM compiler identification is unknown
-- Found assembler: ml64
-- Found Java: C:/Program Files/Java/jdk1.8.0/bin/java.exe (found version "1.8.0_162") 
-- Found JNI: C:/Program Files/Java/jdk1.8.0/lib/jawt.lib  
-- No build type selected, default to Debug
-- Found PythonInterp: C:/Python27/python.exe (found version "2.7.15") 
-- SPIR-V optimizer enabled
-- Configuring done
-- Generating done
-- Build files have been written to: C:/projects/filament/cmake-windows

Python is certainly outdated compared to what the build instructions ask for, but I have not seen how it is actually used during the build. On my own machine, I've used a more recent Python, but ran into the same issues.

Full log is accessible here: https://ci.appveyor.com/project/shartte/filament

But it seems to primarily relate to:

  C:\Program Files\LLVM\msbuild-bin\CL.exe /c /I"C:\projects\filament\third_party\spirv-cross\tnt\.." /I"C:\Tools\vcpkg\installed\x64-windows\include" /Zi /nologo /W1 /WX- /O2 /Ob2 /D _USE_MATH_DEFINES=1 /D NDEBUG /D "CMAKE_INTDIR=\"Release\"" /D _MBCS /Gm- /MT /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"spirv-cross-core.dir\Release\\" /Fd"spirv-cross-core.dir\Release\spirv-cross-core.pdb" /Gd /TP /errorReport:queue -m64 -fmsc-version=1900  -Wno-everything -fstrict-aliasing -Wno-unknown-pragmas -Wno-unused-function -fomit-frame-pointer -ffunction-sections -fdata-sections "C:\projects\filament\third_party\spirv-cross\spirv_cross.cpp" "C:\projects\filament\third_party\spirv-cross\spirv_cfg.cpp"
  In file included from C:\projects\filament\third_party\spirv-cross\spirv_cross.cpp:17:
  In file included from C:\projects\filament\third_party\spirv-cross\tnt\../spirv_cross.hpp:21:
  In file included from C:\projects\filament\third_party\spirv-cross\tnt\../spirv_cfg.hpp:20:
C:\projects\filament\third_party\spirv-cross\tnt\../spirv_common.hpp(1135,4): error : cannot use 'throw' with exceptions disabled [C:\projects\filament\cmake-windows\third_party\spirv-cross\tnt\spirv-cross-core.vcxproj]
                          SPIRV_CROSS_THROW("Overwriting a variant with new type.");
                          ^
  C:\projects\filament\third_party\spirv-cross\tnt\../spirv_common.hpp(68,30):  note: expanded from macro 'SPIRV_CROSS_THROW'
  #define SPIRV_CROSS_THROW(x) throw CompilerError(x)
                               ^

from filament.

bejado avatar bejado commented on May 8, 2024

@shartte I'm not quite sure how your AppVeyor is configured, but it's important that all the build commands be run in a "x86_64 cross tools command prompt". This ensures the correct environment variables are set for Windows builds. Since you're running the build through CI, you'll probably need to add a a call to vcvarsall.bat x86_amd64 first. See this MSDN article.

from filament.

romainguy avatar romainguy commented on May 8, 2024

Python is actually not necessary since we don't rely on the repo tool anymore. I'll update the README.

from filament.

shartte avatar shartte commented on May 8, 2024

@bejado I added an explicit call to vcvarsall to the build, but it didn't change the results.
I am using the MSVC 2015 build image, and the following build script:

call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64

mkdir cmake-windows
cd cmake-windows
cmake -T"LLVM-vs2014" -DCMAKE_CXX_FLAGS="-Wno-everything" -G "Visual Studio 14 2015 Win64" ..
msbuild TNT.sln /t:filament /p:configuration=Release

As before, the build log can be found here: https://ci.appveyor.com/project/shartte/filament

On a related note: Why does the documentation insist on using the cross-compilation toolset? According to MSDN, the native 64-bit compiler produces the same code as the 32-bit->64-bit cross-compiler. Is there any specific reason?

from filament.

bejado avatar bejado commented on May 8, 2024

I believe the issue you're seeing is the correct exception flag (/EHsc) not being passed to the compiler. I worry that by setting DCMAKE_CXX_FLAGS on the command line, you're overwriting this flag. The C++98 compat warnings is a an annoying, separate issue, but you could try not setting -Wno-everything on the command line to see if that fixes it.

Alternatively, I've been experimenting with using only Ninja and Clang to build, eliminating the need for MSVC (and the C++98 warnings). You still need the vcvarsall.bat command though, in order to get tools like rc on PATH.

"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
cmake .. -G Ninja -DCMAKE_CXX_COMPILER:PATH="C:\Program Files\LLVM\bin\clang-cl.exe" -DCMAKE_C_COMPILER:PATH="C:\Program Files\LLVM\bin\clang-cl.exe" -DCMAKE_LINKER:PATH="C:\Program Files\LLVM\bin\lld-link.exe" -DCMAKE_BUILD_TYPE=Debug
ninja

And you're right, if the machine you're using to build is 64 bit, you should be able to just call vcvarsall.bat amd64- cross tools aren't necessary.

from filament.

romainguy avatar romainguy commented on May 8, 2024

We should just assume the build machine is 64 bit. Not sure why we didn't assume that to begin with.

from filament.

bejado avatar bejado commented on May 8, 2024

And by the way, you should delete the build directory and start afresh, otherwise CMakeCache.txt seems to cache compiler flags- not sure if AppVeyor does this or not.

from filament.

shartte avatar shartte commented on May 8, 2024

I was able to successfully build locally with VS2017 + Clang6 + Ninja.
I will adapt my Appveyor config to get it to work. The issue I was facing with the C++98 compat warnings was that they caused the build to time out due to the size of the log (and apparent performance impact of 1000+ warnings per file).

After looking at what's causing the C++98 warnings: Apparently CMake seems to translate the -Wall setting to /Wall for clang-cl, which according to the clang docs actually means something else:

  /W4                     Enable -Wall and -Wextra
  /Wall                   Enable -Weverything

from filament.

bejado avatar bejado commented on May 8, 2024

Glad you were able to build, and thanks for the investigation into the -Wall setting.

from filament.

shartte avatar shartte commented on May 8, 2024

@bejado I've opened an upstream PR with spirv-tools to fix the -Wall issue in their project file:
KhronosGroup/SPIRV-Tools#1808

I'll look into opening one for filament itself to fix the -Wall in filament/CMakeLists.txt
There are some other options being passed to clang-cl.exe that are not actually supported (-fvisibility=hidden) which I might try to fix as well.

from filament.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.