Skip to content

[filament] add Filament port#41916

Closed
aminya wants to merge 34 commits intomicrosoft:masterfrom
aminya:filament
Closed

[filament] add Filament port#41916
aminya wants to merge 34 commits intomicrosoft:masterfrom
aminya:filament

Conversation

@aminya
Copy link
Copy Markdown
Contributor

@aminya aminya commented Nov 2, 2024

This adds Google/Filament

Fixes #35789
Fixes #14906

This is a successor of #17369

  • Changes comply with the maintainer guide.
  • The name of the port matches an existing name for this component on https://repology.org/ if possible, and/or is strongly associated with that component on search engines.
  • Optional dependencies are resolved in exactly one way. For example, if the component is built with CMake, all find_package calls are REQUIRED, are satisfied by vcpkg.json's declared dependencies, or disabled with CMAKE_DISABLE_FIND_PACKAGE_Xxx.
  • The versioning scheme in vcpkg.json matches what upstream says.
  • The license declaration in vcpkg.json matches what upstream says.
  • The installed as the "copyright" file matches what upstream says.
  • The source code of the component installed comes from an authoritative source.
  • The generated "usage text" is accurate. See adding-usage for context.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is in the new port's versions file.
  • Only one version is added to each modified port's versions file.

@aminya aminya mentioned this pull request Nov 2, 2024
11 tasks
@aminya aminya force-pushed the filament branch 2 times, most recently from 24a9023 to 2926a79 Compare November 2, 2024 14:29
@aminya
Copy link
Copy Markdown
Contributor Author

aminya commented Nov 2, 2024

The linker fails to find some of the libraries although their targets are linked in CMake. Any clue why this happens?

[174/500] : && /usr/lib/llvm-18/bin/clang++ -fPIC -std=c++17 -fstrict-aliasing -Wno-unknown-pragmas -Wno-unused-function -Wno-deprecated-declarations -fPIC -fcolor-diagnostics -fvisibility=hidden -DTNT_DEV -g -fstack-protector -Wl,--gc-sections tools/cmgen/CMakeFiles/cmgen.dir/src/cmgen.cpp.o tools/cmgen/CMakeFiles/cmgen.dir/src/ProgressUpdater.cpp.o -o tools/cmgen/cmgen  libs/ibl/libibl.a  libs/imageio/libimageio.a  third_party/getopt/libgetopt.a  libs/image/libimage.a  libs/math/libmath.a  libs/utils/libutils.a  -ldl  -lpng  -ltinyexr  -lz  -lbasis_encoder && :
FAILED: tools/cmgen/cmgen 
: && /usr/lib/llvm-18/bin/clang++ -fPIC -std=c++17 -fstrict-aliasing -Wno-unknown-pragmas -Wno-unused-function -Wno-deprecated-declarations -fPIC -fcolor-diagnostics -fvisibility=hidden -DTNT_DEV -g -fstack-protector -Wl,--gc-sections tools/cmgen/CMakeFiles/cmgen.dir/src/cmgen.cpp.o tools/cmgen/CMakeFiles/cmgen.dir/src/ProgressUpdater.cpp.o -o tools/cmgen/cmgen  libs/ibl/libibl.a  libs/imageio/libimageio.a  third_party/getopt/libgetopt.a  libs/image/libimage.a  libs/math/libmath.a  libs/utils/libutils.a  -ldl  -lpng  -ltinyexr  -lz  -lbasis_encoder && :
/usr/bin/ld: cannot find -ltinyexr: No such file or directory
/usr/bin/ld: cannot find -lbasis_encoder: No such file or directory
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

@dg0yt
Copy link
Copy Markdown
Contributor

dg0yt commented Nov 2, 2024

I don't see any -L flags.

@dg0yt
Copy link
Copy Markdown
Contributor

dg0yt commented Nov 2, 2024

Maybe the "targets" are not targets where they are used? They are not namespaced, so you don't get good diagnostics. Try using the GLOBAL option to find_package.

@aminya
Copy link
Copy Markdown
Contributor Author

aminya commented Nov 4, 2024

Maybe the "targets" are not targets where they are used? They are not namespaced, so you don't get good diagnostics. Try using the GLOBAL option to find_package.

Thanks, I added GLOBAL and it fixed the issue!

@dg0yt
Copy link
Copy Markdown
Contributor

dg0yt commented Nov 4, 2024

Maybe the "targets" are not targets where they are used? They are not namespaced, so you don't get good diagnostics. Try using the GLOBAL option to find_package.

Thanks, I added GLOBAL and it fixed the issue!

Thanks for the feedback. Taken as an example to https://gitlab.kitware.com/cmake/cmake/-/issues/25866.

@aminya
Copy link
Copy Markdown
Contributor Author

aminya commented Nov 4, 2024

It seems all the build system issues are resolved. Now, I am hitting some linker errors because of the differences between how Filament uses its vendored Glslang, spirv, civetweb, etc.

[206/500] : && /usr/lib/llvm-18/bin/clang++ -fPIC -std=c++17 -fstrict-aliasing -Wno-unknown-pragmas -Wno-unused-function -Wno-deprecated-declarations -fPIC -fcolor-diagnostics -fvisibility=hidden -DTNT_DEV -g -fstack-protector -Wl,--gc-sections tools/matc/CMakeFiles/matc.dir/src/main.cpp.o -o tools/matc/matc  tools/matc/libmatlang.a  third_party/getopt/libgetopt.a  libs/filamat/libfilamat.a  shaders/libshaders.a  third_party/smol-v/tnt/libsmol-v.a  -Wl,--start-group  ./installed/x64-linux/debug/lib/libSPIRV.a  ./installed/x64-linux/debug/lib/libglslang.a  ./installed/x64-linux/debug/lib/libMachineIndependent.a  ./installed/x64-linux/debug/lib/libglslang.a  ./installed/x64-linux/debug/lib/libMachineIndependent.a  ./installed/x64-linux/debug/lib/libSPIRV-Tools-opt.a  ./installed/x64-linux/debug/lib/libSPIRV-Tools.a  -lrt  ./installed/x64-linux/debug/lib/libspirv-cross-glsl.a  ./installed/x64-linux/debug/lib/libspirv-cross-core.a  -Wl,--end-group  libs/filabridge/libfilabridge.a  libs/math/libmath.a  libs/utils/libutils.a  -ldl && :
FAILED: tools/matc/matc 
: && /usr/lib/llvm-18/bin/clang++ -fPIC -std=c++17 -fstrict-aliasing -Wno-unknown-pragmas -Wno-unused-function -Wno-deprecated-declarations -fPIC -fcolor-diagnostics -fvisibility=hidden -DTNT_DEV -g -fstack-protector -Wl,--gc-sections tools/matc/CMakeFiles/matc.dir/src/main.cpp.o -o tools/matc/matc  tools/matc/libmatlang.a  third_party/getopt/libgetopt.a  libs/filamat/libfilamat.a  shaders/libshaders.a  third_party/smol-v/tnt/libsmol-v.a  -Wl,--start-group  ./installed/x64-linux/debug/lib/libSPIRV.a  ./installed/x64-linux/debug/lib/libglslang.a  ./installed/x64-linux/debug/lib/libMachineIndependent.a  ./installed/x64-linux/debug/lib/libglslang.a  ./installed/x64-linux/debug/lib/libMachineIndependent.a  ./installed/x64-linux/debug/lib/libSPIRV-Tools-opt.a  ./installed/x64-linux/debug/lib/libSPIRV-Tools.a  -lrt  ./installed/x64-linux/debug/lib/libspirv-cross-glsl.a  ./installed/x64-linux/debug/lib/libspirv-cross-core.a  -Wl,--end-group  libs/filabridge/libfilabridge.a  libs/math/libmath.a  libs/utils/libutils.a  -ldl && :
/usr/bin/ld: warning: shaders.S.o: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
/usr/bin/ld: libs/filamat/libfilamat.a(GLSLPostProcessor.cpp.o): in function `filamat::GLSLPostProcessor::spirvToMsl(std::vector<unsigned int, std::allocator<unsigned int> > const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, filament::backend::ShaderStage, filament::backend::ShaderModel, bool, std::array<utils::FixedCapacityVector<std::tuple<utils::CString, filament::backend::DescriptorSetLayoutBinding, std::optional<filament::SamplerInterfaceBlock::SamplerInfo> >, std::allocator<std::tuple<utils::CString, filament::backend::DescriptorSetLayoutBinding, std::optional<filament::SamplerInterfaceBlock::SamplerInfo> > >, true>, 4ul> const&, filamat::ShaderMinifier const*)':
./buildtrees/filament/src/v1.55.0-5cc38bf927/libs/filamat/src/GLSLPostProcessor.cpp:350:(.text+0x931): undefined reference to `spirv_cross::CompilerMSL::CompilerMSL(std::vector<unsigned int, std::allocator<unsigned int> >)'
/usr/bin/ld: ./buildtrees/filament/src/v1.55.0-5cc38bf927/libs/filamat/src/GLSLPostProcessor.cpp:453:(.text+0x1208): undefined reference to `spirv_cross::CompilerMSL::add_dynamic_buffer(unsigned int, unsigned int, unsigned int)'
/usr/bin/ld: ./buildtrees/filament/src/v1.55.0-5cc38bf927/libs/filamat/src/GLSLPostProcessor.cpp:482:(.text+0x161a): undefined reference to `spirv_cross::CompilerMSL::add_msl_resource_binding(spirv_cross::MSLResourceBinding const&)'
/usr/bin/ld: ./buildtrees/filament/src/v1.55.0-5cc38bf927/libs/filamat/src/GLSLPostProcessor.cpp:484:(.text+0x1632): undefined reference to `spirv_cross::CompilerMSL::compile[abi:cxx11]()'
/usr/bin/ld: libs/filamat/libfilamat.a(GLSLPostProcessor.cpp.o): in function `filamat::GLSLPostProcessor::spirvToMsl(std::vector<unsigned int, std::allocator<unsigned int> > const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, filament::backend::ShaderStage, filament::backend::ShaderModel, bool, std::array<utils::FixedCapacityVector<std::tuple<utils::CString, filament::backend::DescriptorSetLayoutBinding, std::optional<filament::SamplerInterfaceBlock::SamplerInfo> >, std::allocator<std::tuple<utils::CString, filament::backend::DescriptorSetLayoutBinding, std::optional<filament::SamplerInterfaceBlock::SamplerInfo> > >, true>, 4ul> const&, filamat::ShaderMinifier const*)::$_0::operator()(unsigned int, unsigned int) const':
./buildtrees/filament/src/v1.55.0-5cc38bf927/libs/filamat/src/GLSLPostProcessor.cpp:392:(.text+0x18d1): undefined reference to `spirv_cross::CompilerMSL::add_msl_resource_binding(spirv_cross::MSLResourceBinding const&)'
/usr/bin/ld: libs/filamat/libfilamat.a(GLSLPostProcessor.cpp.o): in function `filamat::GLSLPostProcessor::optimizeSpirv(std::shared_ptr<spvtools::Optimizer>, std::vector<unsigned int, std::allocator<unsigned int> >&) const':
./buildtrees/filament/src/v1.55.0-5cc38bf927/libs/filamat/src/GLSLPostProcessor.cpp:847:(.text+0x3f50): undefined reference to `spv::spirvbin_t::remap(std::vector<unsigned int, std::allocator<unsigned int> >&, unsigned int)'
/usr/bin/ld: libs/filamat/libfilamat.a(GLSLPostProcessor.cpp.o): in function `spv::spirvbin_t::registerErrorHandler(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>)':
./installed/x64-linux/include/glslang/SPIRV/SPVRemapper.h:121:(.text._ZN3spv10spirvbin_t20registerErrorHandlerESt8functionIFvRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE[_ZN3spv10spirvbin_t20registerErrorHandlerESt8functionIFvRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE]+0x12): undefined reference to `spv::spirvbin_t::errorHandler[abi:cxx11]'
/usr/bin/ld: libs/filamat/libfilamat.a(GLSLPostProcessor.cpp.o): in function `spirv_cross::CompilerMSL::~CompilerMSL()':
./installed/x64-linux/include/spirv_cross/spirv_msl.hpp:291:(.text._ZN11spirv_cross11CompilerMSLD2Ev[_ZN11spirv_cross11CompilerMSLD2Ev]+0x17): undefined reference to `vtable for spirv_cross::CompilerMSL'
/usr/bin/ld: libs/filamat/libfilamat.a(GLSLPostProcessor.cpp.o): in function `spv::spirvbin_t::spirvbin_t(int)':
./installed/x64-linux/include/glslang/SPIRV/SPVRemapper.h:105:(.text._ZN3spv10spirvbin_tC2Ei[_ZN3spv10spirvbin_tC2Ei]+0x1a): undefined reference to `vtable for spv::spirvbin_t'
/usr/bin/ld: libs/filamat/libfilamat.a(GLSLPostProcessor.cpp.o): in function `spv::spirvbin_t::~spirvbin_t()':
./installed/x64-linux/include/glslang/SPIRV/SPVRemapper.h:107:(.text._ZN3spv10spirvbin_tD2Ev[_ZN3spv10spirvbin_tD2Ev]+0x17): undefined reference to `vtable for spv::spirvbin_t'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[207/500] : && /usr/lib/llvm-18/bin/clang++ -fPIC -std=c++17 -fstrict-aliasing -Wno-unknown-pragmas -Wno-unused-function -Wno-deprecated-declarations -fPIC -fcolor-diagnostics -fvisibility=hidden -DTNT_DEV -g -fstack-protector -Wl,--gc-sections tools/matinfo/CMakeFiles/matinfo.dir/src/main.cpp.o -o tools/matinfo/matinfo  libs/matdbg/libmatdbg.a  libs/filaflat/libfilaflat.a  third_party/getopt/libgetopt.a  ./installed/x64-linux/debug/lib/libcivetweb.a  ./installed/x64-linux/debug/lib/libz.a  libs/filamat/libfilamat.a  libs/filabridge/libfilabridge.a  libs/math/libmath.a  third_party/smol-v/tnt/libsmol-v.a  shaders/libshaders.a  -Wl,--start-group  -Wl,--end-group  libs/matdbg/libmatdbg_resources.a  ./installed/x64-linux/debug/lib/libSPIRV.a  ./installed/x64-linux/debug/lib/libglslang.a  ./installed/x64-linux/debug/lib/libMachineIndependent.a  ./installed/x64-linux/debug/lib/libglslang.a  ./installed/x64-linux/debug/lib/libMachineIndependent.a  ./installed/x64-linux/debug/lib/libSPIRV-Tools-opt.a  ./installed/x64-linux/debug/lib/libspirv-cross-glsl.a  ./installed/x64-linux/debug/lib/libspirv-cross-core.a  ./installed/x64-linux/debug/lib/libSPIRV-Tools.a  -lrt  libs/utils/libutils.a  -ldl && :
FAILED: tools/matinfo/matinfo 
: && /usr/lib/llvm-18/bin/clang++ -fPIC -std=c++17 -fstrict-aliasing -Wno-unknown-pragmas -Wno-unused-function -Wno-deprecated-declarations -fPIC -fcolor-diagnostics -fvisibility=hidden -DTNT_DEV -g -fstack-protector -Wl,--gc-sections tools/matinfo/CMakeFiles/matinfo.dir/src/main.cpp.o -o tools/matinfo/matinfo  libs/matdbg/libmatdbg.a  libs/filaflat/libfilaflat.a  third_party/getopt/libgetopt.a  ./installed/x64-linux/debug/lib/libcivetweb.a  ./installed/x64-linux/debug/lib/libz.a  libs/filamat/libfilamat.a  libs/filabridge/libfilabridge.a  libs/math/libmath.a  third_party/smol-v/tnt/libsmol-v.a  shaders/libshaders.a  -Wl,--start-group  -Wl,--end-group  libs/matdbg/libmatdbg_resources.a  ./installed/x64-linux/debug/lib/libSPIRV.a  ./installed/x64-linux/debug/lib/libglslang.a  ./installed/x64-linux/debug/lib/libMachineIndependent.a  ./installed/x64-linux/debug/lib/libglslang.a  ./installed/x64-linux/debug/lib/libMachineIndependent.a  ./installed/x64-linux/debug/lib/libSPIRV-Tools-opt.a  ./installed/x64-linux/debug/lib/libspirv-cross-glsl.a  ./installed/x64-linux/debug/lib/libspirv-cross-core.a  ./installed/x64-linux/debug/lib/libSPIRV-Tools.a  -lrt  libs/utils/libutils.a  -ldl && :
/usr/bin/ld: warning: matdbg_resources.S.o: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o): in function `filament::matdbg::DebugServer::DebugServer(filament::backend::Backend, int)':
./buildtrees/filament/src/v1.55.0-5cc38bf927/libs/matdbg/src/DebugServer.cpp:155:(.text+0x36f): undefined reference to `CivetServer::CivetServer(char const**, CivetCallbacks const*, void const*)'
/usr/bin/ld: ./buildtrees/filament/src/v1.55.0-5cc38bf927/libs/matdbg/src/DebugServer.cpp:166:(.text+0x547): undefined reference to `CivetServer::addHandler(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, CivetHandler*)'
/usr/bin/ld: ./buildtrees/filament/src/v1.55.0-5cc38bf927/libs/matdbg/src/DebugServer.cpp:167:(.text+0x5cd): undefined reference to `CivetServer::addHandler(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, CivetHandler*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o): in function `filament::matdbg::DebugServer::~DebugServer()':
./buildtrees/filament/src/v1.55.0-5cc38bf927/libs/matdbg/src/DebugServer.cpp:176:(.text+0x817): undefined reference to `CivetServer::close()'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o): in function `CivetHandler::CivetHandler()':
./installed/x64-linux/include/CivetServer.h:51:(.text._ZN12CivetHandlerC2Ev[_ZN12CivetHandlerC2Ev]+0xf): undefined reference to `vtable for CivetHandler'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x28): undefined reference to `CivetHandler::handleGet(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x30): undefined reference to `CivetHandler::handlePost(CivetServer*, mg_connection*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x38): undefined reference to `CivetHandler::handlePost(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x40): undefined reference to `CivetHandler::handleHead(CivetServer*, mg_connection*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x48): undefined reference to `CivetHandler::handleHead(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x50): undefined reference to `CivetHandler::handlePut(CivetServer*, mg_connection*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x58): undefined reference to `CivetHandler::handlePut(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x60): undefined reference to `CivetHandler::handleDelete(CivetServer*, mg_connection*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x68): undefined reference to `CivetHandler::handleDelete(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x70): undefined reference to `CivetHandler::handleOptions(CivetServer*, mg_connection*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x78): undefined reference to `CivetHandler::handleOptions(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x80): undefined reference to `CivetHandler::handlePatch(CivetServer*, mg_connection*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x88): undefined reference to `CivetHandler::handlePatch(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTIN8filament6matdbg18FileRequestHandlerE[_ZTIN8filament6matdbg18FileRequestHandlerE]+0x10): undefined reference to `typeinfo for CivetHandler'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro+0x28): undefined reference to `CivetHandler::handleGet(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro+0x38): undefined reference to `CivetHandler::handlePost(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro+0x40): undefined reference to `CivetHandler::handleHead(CivetServer*, mg_connection*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro+0x48): undefined reference to `CivetHandler::handleHead(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro+0x50): undefined reference to `CivetHandler::handlePut(CivetServer*, mg_connection*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro+0x58): undefined reference to `CivetHandler::handlePut(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro+0x60): undefined reference to `CivetHandler::handleDelete(CivetServer*, mg_connection*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro+0x68): undefined reference to `CivetHandler::handleDelete(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro+0x70): undefined reference to `CivetHandler::handleOptions(CivetServer*, mg_connection*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro+0x78): undefined reference to `CivetHandler::handleOptions(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro+0x80): undefined reference to `CivetHandler::handlePatch(CivetServer*, mg_connection*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro+0x88): undefined reference to `CivetHandler::handlePatch(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro+0xa0): undefined reference to `typeinfo for CivetHandler'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

@dg0yt
Copy link
Copy Markdown
Contributor

dg0yt commented Nov 4, 2024

Now, I am hitting some linker errors because of the differences between how Filament uses its vendored Glslang, spirv, civetweb, etc.

Maybe that's a good intermediate result? Without de-vendoring, such issues might be offloaded to the users of vpckg ports...

@LilyWangLL LilyWangLL added the category:new-port The issue is requesting a new library to be added; consider making a PR! label Nov 4, 2024
@aminya
Copy link
Copy Markdown
Contributor Author

aminya commented Nov 5, 2024

Now, I am hitting some linker errors because of the differences between how Filament uses its vendored Glslang, spirv, civetweb, etc.

Maybe that's a good intermediate result? Without de-vendoring, such issues might be offloaded to the users of vpckg ports...

Yes, it's a good progress. However, the issue is happening because of de-vendoring. They use custom CMake for glslang, spirv, civetweb, and the versions they use are different from the vcpkg versions.

I tried with GCC, and I get a similar error. Inside the CI, there are other errors that must be resolved.

[206/500] : && /usr/bin/g++ -fPIC -std=c++17 -fstrict-aliasing -Wno-unknown-pragmas -Wno-unused-function -Wno-deprecated-declarations -fPIC -fvisibility=hidden -DTNT_DEV -g -fstack-protector -Wl,--gc-sections tools/matc/CMakeFiles/matc.dir/src/main.cpp.o -o tools/matc/matc -L/usr/lib/gcc/x86_64-linux-gnu/13 tools/matc/libmatlang.a  third_party/getopt/libgetopt.a  libs/filamat/libfilamat.a  shaders/libshaders.a  third_party/smol-v/tnt/libsmol-v.a  -Wl,--start-group  ./installed/x64-linux/debug/lib/libSPIRV.a  ./installed/x64-linux/debug/lib/libglslang.a  ./installed/x64-linux/debug/lib/libMachineIndependent.a  ./installed/x64-linux/debug/lib/libglslang.a  ./installed/x64-linux/debug/lib/libMachineIndependent.a  ./installed/x64-linux/debug/lib/libSPIRV-Tools-opt.a  ./installed/x64-linux/debug/lib/libSPIRV-Tools.a  -lrt  ./installed/x64-linux/debug/lib/libspirv-cross-glsl.a  ./installed/x64-linux/debug/lib/libspirv-cross-core.a  -Wl,--end-group  libs/filabridge/libfilabridge.a  libs/math/libmath.a  libs/utils/libutils.a  -ldl && :
FAILED: tools/matc/matc 
: && /usr/bin/g++ -fPIC -std=c++17 -fstrict-aliasing -Wno-unknown-pragmas -Wno-unused-function -Wno-deprecated-declarations -fPIC -fvisibility=hidden -DTNT_DEV -g -fstack-protector -Wl,--gc-sections tools/matc/CMakeFiles/matc.dir/src/main.cpp.o -o tools/matc/matc -L/usr/lib/gcc/x86_64-linux-gnu/13 tools/matc/libmatlang.a  third_party/getopt/libgetopt.a  libs/filamat/libfilamat.a  shaders/libshaders.a  third_party/smol-v/tnt/libsmol-v.a  -Wl,--start-group  ./installed/x64-linux/debug/lib/libSPIRV.a  ./installed/x64-linux/debug/lib/libglslang.a  ./installed/x64-linux/debug/lib/libMachineIndependent.a  ./installed/x64-linux/debug/lib/libglslang.a  ./installed/x64-linux/debug/lib/libMachineIndependent.a  ./installed/x64-linux/debug/lib/libSPIRV-Tools-opt.a  ./installed/x64-linux/debug/lib/libSPIRV-Tools.a  -lrt  ./installed/x64-linux/debug/lib/libspirv-cross-glsl.a  ./installed/x64-linux/debug/lib/libspirv-cross-core.a  -Wl,--end-group  libs/filabridge/libfilabridge.a  libs/math/libmath.a  libs/utils/libutils.a  -ldl && :
/usr/bin/ld: warning: shaders.S.o: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
/usr/bin/ld: libs/filamat/libfilamat.a(GLSLPostProcessor.cpp.o): in function `filamat::GLSLPostProcessor::spirvToMsl(std::vector<unsigned int, std::allocator<unsigned int> > const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, filament::backend::ShaderStage, filament::backend::ShaderModel, bool, std::array<utils::FixedCapacityVector<std::tuple<utils::CString, filament::backend::DescriptorSetLayoutBinding, std::optional<filament::SamplerInterfaceBlock::SamplerInfo> >, std::allocator<std::tuple<utils::CString, filament::backend::DescriptorSetLayoutBinding, std::optional<filament::SamplerInterfaceBlock::SamplerInfo> > >, true>, 4ul> const&, filamat::ShaderMinifier const*)::{lambda(unsigned int, unsigned int)#1}::operator()(unsigned int, unsigned int) const':
./buildtrees/filament/src/v1.55.0-8c9bcb1d21/libs/filamat/src/GLSLPostProcessor.cpp:392:(.text+0x1366): undefined reference to `spirv_cross::CompilerMSL::add_msl_resource_binding(spirv_cross::MSLResourceBinding const&)'
/usr/bin/ld: libs/filamat/libfilamat.a(GLSLPostProcessor.cpp.o): in function `filamat::GLSLPostProcessor::spirvToMsl(std::vector<unsigned int, std::allocator<unsigned int> > const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, filament::backend::ShaderStage, filament::backend::ShaderModel, bool, std::array<utils::FixedCapacityVector<std::tuple<utils::CString, filament::backend::DescriptorSetLayoutBinding, std::optional<filament::SamplerInterfaceBlock::SamplerInfo> >, std::allocator<std::tuple<utils::CString, filament::backend::DescriptorSetLayoutBinding, std::optional<filament::SamplerInterfaceBlock::SamplerInfo> > >, true>, 4ul> const&, filamat::ShaderMinifier const*)':
    ./buildtrees/filament/src/v1.55.0-8c9bcb1d21/libs/filamat/src/GLSLPostProcessor.cpp:350:(.text+0x1411): undefined reference to `spirv_cross::CompilerMSL::CompilerMSL(std::vector<unsigned int, std::allocator<unsigned int> >)'
/usr/bin/ld: ./buildtrees/filament/src/v1.55.0-8c9bcb1d21/libs/filamat/src/GLSLPostProcessor.cpp:453:(.text+0x1b0c): undefined reference to `spirv_cross::CompilerMSL::add_dynamic_buffer(unsigned int, unsigned int, unsigned int)'
/usr/bin/ld: ./buildtrees/filament/src/v1.55.0-8c9bcb1d21/libs/filamat/src/GLSLPostProcessor.cpp:482:(.text+0x1dc6): undefined reference to `spirv_cross::CompilerMSL::add_msl_resource_binding(spirv_cross::MSLResourceBinding const&)'
/usr/bin/ld: ./buildtrees/filament/src/v1.55.0-8c9bcb1d21/libs/filamat/src/GLSLPostProcessor.cpp:484:(.text+0x1ddf): undefined reference to `spirv_cross::CompilerMSL::compile[abi:cxx11]()'
/usr/bin/ld: libs/filamat/libfilamat.a(GLSLPostProcessor.cpp.o): in function `filamat::GLSLPostProcessor::optimizeSpirv(std::shared_ptr<spvtools::Optimizer>, std::vector<unsigned int, std::allocator<unsigned int> >&) const':
./buildtrees/filament/src/v1.55.0-8c9bcb1d21/libs/filamat/src/GLSLPostProcessor.cpp:847:(.text+0x3d5b): undefined reference to `spv::spirvbin_t::remap(std::vector<unsigned int, std::allocator<unsigned int> >&, unsigned int)'
/usr/bin/ld: libs/filamat/libfilamat.a(GLSLPostProcessor.cpp.o): in function `spv::spirvbin_t::spirvbin_t(int)':
./installed/x64-linux/include/glslang/SPIRV/SPVRemapper.h:104:(.text._ZN3spv10spirvbin_tC2Ei[_ZN3spv10spirvbin_tC5Ei]+0x16): undefined reference to `vtable for spv::spirvbin_t'
/usr/bin/ld: libs/filamat/libfilamat.a(GLSLPostProcessor.cpp.o): in function `spv::spirvbin_t::~spirvbin_t()':
./installed/x64-linux/include/glslang/SPIRV/SPVRemapper.h:107:(.text._ZN3spv10spirvbin_tD2Ev[_ZN3spv10spirvbin_tD5Ev]+0x13): undefined reference to `vtable for spv::spirvbin_t'
/usr/bin/ld: libs/filamat/libfilamat.a(GLSLPostProcessor.cpp.o): in function `spv::spirvbin_t::registerErrorHandler(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>)':
./installed/x64-linux/include/glslang/SPIRV/SPVRemapper.h:121:(.text._ZN3spv10spirvbin_t20registerErrorHandlerESt8functionIFvRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE[_ZN3spv10spirvbin_t20registerErrorHandlerESt8functionIFvRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE]+0x1a): undefined reference to `spv::spirvbin_t::errorHandler[abi:cxx11]'
/usr/bin/ld: libs/filamat/libfilamat.a(GLSLPostProcessor.cpp.o): in function `spirv_cross::CompilerMSL::~CompilerMSL()':
./installed/x64-linux/include/spirv_cross/spirv_msl.hpp:291:(.text._ZN11spirv_cross11CompilerMSLD2Ev[_ZN11spirv_cross11CompilerMSLD5Ev]+0x13): undefined reference to `vtable for spirv_cross::CompilerMSL'
collect2: error: ld returned 1 exit status
[207/500] : && /usr/bin/g++ -fPIC -std=c++17 -fstrict-aliasing -Wno-unknown-pragmas -Wno-unused-function -Wno-deprecated-declarations -fPIC -fvisibility=hidden -DTNT_DEV -g -fstack-protector -Wl,--gc-sections tools/matinfo/CMakeFiles/matinfo.dir/src/main.cpp.o -o tools/matinfo/matinfo -L/usr/lib/gcc/x86_64-linux-gnu/13 libs/matdbg/libmatdbg.a  libs/filaflat/libfilaflat.a  third_party/getopt/libgetopt.a  ./installed/x64-linux/debug/lib/libcivetweb.a  ./installed/x64-linux/debug/lib/libz.a  libs/filamat/libfilamat.a  libs/filabridge/libfilabridge.a  libs/math/libmath.a  third_party/smol-v/tnt/libsmol-v.a  shaders/libshaders.a  -Wl,--start-group  -Wl,--end-group  libs/matdbg/libmatdbg_resources.a  ./installed/x64-linux/debug/lib/libSPIRV.a  ./installed/x64-linux/debug/lib/libglslang.a  ./installed/x64-linux/debug/lib/libMachineIndependent.a  ./installed/x64-linux/debug/lib/libglslang.a  ./installed/x64-linux/debug/lib/libMachineIndependent.a  ./installed/x64-linux/debug/lib/libSPIRV-Tools-opt.a  ./installed/x64-linux/debug/lib/libspirv-cross-glsl.a  ./installed/x64-linux/debug/lib/libspirv-cross-core.a  ./installed/x64-linux/debug/lib/libSPIRV-Tools.a  -lrt  libs/utils/libutils.a  -ldl && :
FAILED: tools/matinfo/matinfo 
: && /usr/bin/g++ -fPIC -std=c++17 -fstrict-aliasing -Wno-unknown-pragmas -Wno-unused-function -Wno-deprecated-declarations -fPIC -fvisibility=hidden -DTNT_DEV -g -fstack-protector -Wl,--gc-sections tools/matinfo/CMakeFiles/matinfo.dir/src/main.cpp.o -o tools/matinfo/matinfo -L/usr/lib/gcc/x86_64-linux-gnu/13 libs/matdbg/libmatdbg.a  libs/filaflat/libfilaflat.a  third_party/getopt/libgetopt.a  ./installed/x64-linux/debug/lib/libcivetweb.a  ./installed/x64-linux/debug/lib/libz.a  libs/filamat/libfilamat.a  libs/filabridge/libfilabridge.a  libs/math/libmath.a  third_party/smol-v/tnt/libsmol-v.a  shaders/libshaders.a  -Wl,--start-group  -Wl,--end-group  libs/matdbg/libmatdbg_resources.a  ./installed/x64-linux/debug/lib/libSPIRV.a  ./installed/x64-linux/debug/lib/libglslang.a  ./installed/x64-linux/debug/lib/libMachineIndependent.a  ./installed/x64-linux/debug/lib/libglslang.a  ./installed/x64-linux/debug/lib/libMachineIndependent.a  ./installed/x64-linux/debug/lib/libSPIRV-Tools-opt.a  ./installed/x64-linux/debug/lib/libspirv-cross-glsl.a  ./installed/x64-linux/debug/lib/libspirv-cross-core.a  ./installed/x64-linux/debug/lib/libSPIRV-Tools.a  -lrt  libs/utils/libutils.a  -ldl && :
/usr/bin/ld: warning: matdbg_resources.S.o: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o): in function `filament::matdbg::DebugServer::DebugServer(filament::backend::Backend, int)':
./buildtrees/filament/src/v1.55.0-8c9bcb1d21/libs/matdbg/src/DebugServer.cpp:155:(.text+0x4f6): undefined reference to `CivetServer::CivetServer(char const**, CivetCallbacks const*, void const*)'
/usr/bin/ld: ./buildtrees/filament/src/v1.55.0-8c9bcb1d21/libs/matdbg/src/DebugServer.cpp:166:(.text+0x63a): undefined reference to `CivetServer::addHandler(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, CivetHandler*)'
/usr/bin/ld: ./buildtrees/filament/src/v1.55.0-8c9bcb1d21/libs/matdbg/src/DebugServer.cpp:167:(.text+0x6ae): undefined reference to `CivetServer::addHandler(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, CivetHandler*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o): in function `filament::matdbg::DebugServer::~DebugServer()':
./buildtrees/filament/src/v1.55.0-8c9bcb1d21/libs/matdbg/src/DebugServer.cpp:176:(.text+0x895): undefined reference to `CivetServer::close()'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o): in function `CivetHandler::~CivetHandler()':
./installed/x64-linux/include/CivetServer.h:58:(.text._ZN12CivetHandlerD2Ev[_ZN12CivetHandlerD5Ev]+0xf): undefined reference to `vtable for CivetHandler'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o): in function `CivetHandler::CivetHandler()':
./installed/x64-linux/include/CivetServer.h:51:(.text._ZN12CivetHandlerC2Ev[_ZN12CivetHandlerC5Ev]+0xf): undefined reference to `vtable for CivetHandler'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x28): undefined reference to `CivetHandler::handleGet(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x30): undefined reference to `CivetHandler::handlePost(CivetServer*, mg_connection*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x38): undefined reference to `CivetHandler::handlePost(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x40): undefined reference to `CivetHandler::handleHead(CivetServer*, mg_connection*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x48): undefined reference to `CivetHandler::handleHead(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x50): undefined reference to `CivetHandler::handlePut(CivetServer*, mg_connection*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x58): undefined reference to `CivetHandler::handlePut(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x60): undefined reference to `CivetHandler::handleDelete(CivetServer*, mg_connection*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x68): undefined reference to `CivetHandler::handleDelete(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x70): undefined reference to `CivetHandler::handleOptions(CivetServer*, mg_connection*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x78): undefined reference to `CivetHandler::handleOptions(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x80): undefined reference to `CivetHandler::handlePatch(CivetServer*, mg_connection*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg18FileRequestHandlerE[_ZTVN8filament6matdbg18FileRequestHandlerE]+0x88): undefined reference to `CivetHandler::handlePatch(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(DebugServer.cpp.o):(.data.rel.ro._ZTIN8filament6matdbg18FileRequestHandlerE[_ZTIN8filament6matdbg18FileRequestHandlerE]+0x10): undefined reference to `typeinfo for CivetHandler'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg10ApiHandlerE[_ZTVN8filament6matdbg10ApiHandlerE]+0x28): undefined reference to `CivetHandler::handleGet(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg10ApiHandlerE[_ZTVN8filament6matdbg10ApiHandlerE]+0x38): undefined reference to `CivetHandler::handlePost(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg10ApiHandlerE[_ZTVN8filament6matdbg10ApiHandlerE]+0x40): undefined reference to `CivetHandler::handleHead(CivetServer*, mg_connection*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg10ApiHandlerE[_ZTVN8filament6matdbg10ApiHandlerE]+0x48): undefined reference to `CivetHandler::handleHead(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg10ApiHandlerE[_ZTVN8filament6matdbg10ApiHandlerE]+0x50): undefined reference to `CivetHandler::handlePut(CivetServer*, mg_connection*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg10ApiHandlerE[_ZTVN8filament6matdbg10ApiHandlerE]+0x58): undefined reference to `CivetHandler::handlePut(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg10ApiHandlerE[_ZTVN8filament6matdbg10ApiHandlerE]+0x60): undefined reference to `CivetHandler::handleDelete(CivetServer*, mg_connection*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg10ApiHandlerE[_ZTVN8filament6matdbg10ApiHandlerE]+0x68): undefined reference to `CivetHandler::handleDelete(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg10ApiHandlerE[_ZTVN8filament6matdbg10ApiHandlerE]+0x70): undefined reference to `CivetHandler::handleOptions(CivetServer*, mg_connection*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg10ApiHandlerE[_ZTVN8filament6matdbg10ApiHandlerE]+0x78): undefined reference to `CivetHandler::handleOptions(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg10ApiHandlerE[_ZTVN8filament6matdbg10ApiHandlerE]+0x80): undefined reference to `CivetHandler::handlePatch(CivetServer*, mg_connection*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro._ZTVN8filament6matdbg10ApiHandlerE[_ZTVN8filament6matdbg10ApiHandlerE]+0x88): undefined reference to `CivetHandler::handlePatch(CivetServer*, mg_connection*, int*)'
/usr/bin/ld: libs/matdbg/libmatdbg.a(ApiHandler.cpp.o):(.data.rel.ro._ZTIN8filament6matdbg10ApiHandlerE[_ZTIN8filament6matdbg10ApiHandlerE]+0x10): undefined reference to `typeinfo for CivetHandler'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

@aminya
Copy link
Copy Markdown
Contributor Author

aminya commented Nov 6, 2024

Got a successful build with Clang on Linux! 🎉

image

@aminya aminya force-pushed the filament branch 2 times, most recently from 683740f to 485d852 Compare November 6, 2024 15:49
@aminya aminya marked this pull request as ready for review November 6, 2024 18:25
@aminya aminya force-pushed the filament branch 2 times, most recently from eab8d28 to ea18b6b Compare November 7, 2024 07:54
@aminya
Copy link
Copy Markdown
Contributor Author

aminya commented Nov 7, 2024

Getting Filament to build with gcc is too much work. There are numerous compiler errors that need to be resolved, which is out of the scope of this PR. I have added the clang requirement in the port for Linux.

Comment thread ports/filament/portfile.cmake Outdated
Comment on lines +36 to +37
vcpkg_find_acquire_program(CLANG)
set(COMPILER -DCMAKE_CXX_COMPILER=${CLANG}++ -DCMAKE_C_COMPILER=${CLANG})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ports must not change the compiler like this.
CI can expect it to fail via scripts/ci.baseline.txt.

The portfile can print a message. (If you want a conditional message, you could vcpkg_cmake_get_vars.)

Copy link
Copy Markdown
Contributor Author

@aminya aminya Nov 7, 2024

Choose a reason for hiding this comment

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

Why not? Ports can have compiler requirements, and this line declares that. I patched the original CMake not to error on gcc, but if vcpkg is against that, I will revert that patch. The compilation fails with gcc towards the ends. It is quite wasteful not to error out early and let the users know about the clang requirement.
I'd either keep the original requirement in CMakeLists.txt or here in vcpkg.

Another benefit of keeping this in vcpkg is that we can build filament with clang but link to it from gcc. Not having this, forces the users to use Clang for everything!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The toolchain - including compiler - is controlled by the triplet. Users may use per-port customization in triplet files.

To error out early, use vcpkg_cmake_get_vars to get toolchain information.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What about using gcc with clang built Filament? Not having this makes it unnecessarily hard.

Comment thread ports/filament/usage Outdated
@dg0yt
Copy link
Copy Markdown
Contributor

dg0yt commented Nov 8, 2024

The CMake config package is not provided by upstream. So the package name must be unofficial-filament, the target namespace must be unofficial::filament::, and the config installation dir must be changed accordingly.

@LilyWangLL
Copy link
Copy Markdown
Contributor

Please fix the build error:

CMake Error at CMakeLists.txt:942 (get_target_property):
  get_target_property() called with non-existent target "SPIRV-Headers".


CMake Error at CMakeLists.txt:943 (set_target_properties):
  set_target_properties Can not find target to add properties to:
  SPIRV-Headers


CMake Error at CMakeLists.txt:947 (install):
  install TARGETS given target "SPIRV-Headers" which does not exist.


CMake Error at CMakeLists.txt:948 (export):
  export given target "SPIRV-Headers" which is not built by this project.


CMake Error at CMakeLists.txt:967 (install):
  install TARGETS given target "bluevk" which does not exist.


CMake Error at CMakeLists.txt:968 (export):
  export given target "bluevk" which is not built by this project.

@LilyWangLL LilyWangLL marked this pull request as draft November 12, 2024 09:54
@LilyWangLL LilyWangLL closed this Nov 26, 2024
@LilyWangLL LilyWangLL reopened this Nov 26, 2024
aminya and others added 14 commits June 16, 2025 23:51
* [unofficial-filament] Fix PR issues for vcpkg integration

Key changes to address reviewer feedback:
- Renamed package from 'filament' to 'unofficial-filament' per vcpkg conventions
- Removed hardcoded Clang compiler selection from portfile.cmake
- Updated CMake configuration to use unofficial namespace
- Fixed patch to handle missing external dependencies gracefully
- Updated usage instructions for new package name

Addresses issues raised in microsoft#41916:
- No longer forces specific compiler toolchain
- Uses proper unofficial naming convention
- Improved CMake target handling

* Removes test script for filament port

Deletes the test script for the unofficial-filament port.

The port has been migrated, and this script is no longer relevant.
@aminya aminya marked this pull request as ready for review June 17, 2025 10:03
@LilyWangLL LilyWangLL removed the depends:upstream-changes Waiting on a change to the upstream project label Jun 19, 2025
MachineIndependent/Versions.h)

+ option(INSTALL_PRIVATE_HEADERS "Install private headers" OFF)
+ if(INSTALL_PRIVATE_HEADERS)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you explain why we are adding a feature that does not exist upstream? The correct headers to install shouldn't be something an end user needs to pick.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Google vendors its dependencies and uses private headers not exposed by the vcpkg version of glslang. That's why this is needed.

diff --git a/third_party/basisu/encoder/basisu_comp.h b/third_party/basisu/encoder/basisu_comp.h
index aa5ea6fec..233dd1296 100644
--- a/third_party/basisu/encoder/basisu_comp.h
+++ b/third_party/basisu/encoder/basisu_comp.h
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is patching a component which is disabled entirely later?

Comment thread ports/unofficial-filament/0008-const.patch
Comment on lines +47 to +49
MAYBE_UNUSED_VARIABLES
USE_STATIC_CRT
USE_STATIC_LIBCXX
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you describe how/why these might be unused? In our recent experience unused variables have usually been bugs.

Moreover, it seems likely that if something like this matters a supports:native is missing? (How are those tools being built in a crosscompiling scenario if they might be needed in the build itself?)

endif()

if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_add_to_path("${CURRENT_INSTALLED_DIR}/debug/bin") #so that tools that are self-produced during build process, which might depend on vcpkg-provided shared libraries, do not silently fail due to missing .dlls
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It seems unlikely that this is specific to Windows; I think we might just be not observing it on *nix because the "default" triplets for non-Windows are static.

@BillyONeal BillyONeal added info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. requires:vcpkg-team-review This PR or issue requires someone on the vcpkg team to take a further look. labels Jun 24, 2025
@BillyONeal
Copy link
Copy Markdown
Member

Tagging vcpkg-team-review due to installing private headers.

@BillyONeal
Copy link
Copy Markdown
Member

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@BillyONeal
Copy link
Copy Markdown
Member

BillyONeal commented Jun 26, 2025

Just going to note: It isn't a requirement to patch this to work with gcc as long as it passes on at least one platform our curated registry tests. I need to poke glslang maintainers and see if installing their private headers is OK.

@aminya
Copy link
Copy Markdown
Contributor Author

aminya commented Jun 26, 2025

Just going to note: It isn't a requirement to patch this to work with gcc as long as it passes on at least one platform our curated registry tests. I need to poke glslang maintainers and see if installing their private headers is OK.

I'll update this again soon to fix the failures. Note that I had a feature to guard the installation of glslang headers only for Filament. It seems it's gone after the recent rebase/merge. I'll revert it back and will fix it.

@BillyONeal BillyONeal removed info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. requires:vcpkg-team-review This PR or issue requires someone on the vcpkg team to take a further look. labels Aug 1, 2025
@BillyONeal BillyONeal marked this pull request as draft August 1, 2025 01:07
@vicroms
Copy link
Copy Markdown
Member

vicroms commented Feb 11, 2026

We have closed this PR due to inactivity. Please create a new PR if you're still interested in getting these changes merged.

@vicroms vicroms closed this Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:new-port The issue is requesting a new library to be added; consider making a PR!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[filament] google filament [New Port Request] filament

7 participants