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

compiling error of "Sample_Tutorial_VulkanExternal" in linux #482

Open
Joilnen opened this issue Nov 27, 2024 · 5 comments
Open

compiling error of "Sample_Tutorial_VulkanExternal" in linux #482

Joilnen opened this issue Nov 27, 2024 · 5 comments
Labels
Vulkan wontfix This will not be worked on

Comments

@Joilnen
Copy link

Joilnen commented Nov 27, 2024

System Information

  • Ogre Version: ❔ 84c07a0
  • Operating System / Platform: ❔ linux (Archlinux)

Detailled description

compiling error of "Sample_Tutorial_VulkanExternal" in linux

Callstack

ld.lld: error: undefined symbol: spvTextToBinary
>>> referenced by spirv_tools_wrapper.cc.o:(shaderc_util::SpirvToolsAssemble(shaderc_util::Compiler::TargetEnv, shaderc_util::Compiler::TargetEnvVersion, shaderc_util::string_piece, spv_binary_t**, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*)) in archive /lib/libshaderc_combined.a

ld.lld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [Samples/2.0/Tutorials/Tutorial_VulkanExternal/CMakeFiles/Sample_Tutorial_VulkanExternal.dir/build.make:122: bin/Sample_Tutorial_VulkanExternal-4.0] Error 1
make[1]: *** [CMakeFiles/Makefile2:4590: Samples/2.0/Tutorials/Tutorial_VulkanExternal/CMakeFiles/Sample_Tutorial_VulkanExternal.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[100%] Building CXX object Samples/2.0/Tutorials/Tutorial_Terrain/CMakeFiles/Sample_Tutorial_Terrain.dir/src/Tutorial_TerrainGameState.cpp.o
[100%] Linking CXX executable ../../../../bin/Sample_Tutorial_Terrain
[100%] Built target Sample_Tutorial_Terrain
make: *** [Makefile:156: all] Error 2
@darksylinc
Copy link
Member

It looks like it's picking up a different shaderc/glslang (e.g. system-installed one), and not the one provided by ogre-next-deps. This can cause more issues than just compiler errors.

How are you building OgreNext? Are you using the build scripts?

You may get more information from running make VERBOSE=1 if you're using makefiles, or ninja -v if you're using ninja build generator.

@Joilnen
Copy link
Author

Joilnen commented Nov 27, 2024

I did "cmake -S . build; cd build; make VERBOSE=1", I have this vulkan packages

/home/joilnen/ogre3d_devel/ogre-next-3.4.x/Samples/2.0/Tutorials/Tutorial_Terrain/src/Terra/Terra.cpp:418:38: warning: implicit conversion from 'uint32' (aka 'unsigned int') to 'float' may lose precision [-Wimplicit-int-float-conversion]
  418 |                 static_cast<uint32>( m_basePixelDimension * m_depthWidthRatio );
      |                                      ^~~~~~~~~~~~~~~~~~~~ ~
[100%] Linking CXX executable ../../../../bin/Sample_TutorialUav01_Setup
cd /home/joilnen/ogre3d_devel/ogre-next-3.4.x/build/Samples/2.0/Tutorials/TutorialUav01_Setup && /usr/bin/cmake -E cmake_link_script CMakeFiles/Sample_TutorialUav01_Setup.dir/link.txt --verbose=1
/usr/bin/clang++ -Wall -Winit-self -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -Wshadow -Wimplicit-fallthrough         -Winconsistent-missing-destructor-override -Wcomma -Wsign-conversion -Wconversion  -msse -msse2 -O2 -g -DNDEBUG -fuse-ld=lld -Xlinker --dependency-file -Xlinker CMakeFiles/Sample_TutorialUav01_Setup.dir/link.d CMakeFiles/Sample_TutorialUav01_Setup.dir/TutorialUav01_Setup.cpp.o CMakeFiles/Sample_TutorialUav01_Setup.dir/TutorialUav01_SetupGameState.cpp.o -o ../../../../bin/Sample_TutorialUav01_Setup-4.0  -Wl,-rpath,/home/joilnen/ogre3d_devel/ogre-next-3.4.x/build/lib: ../../../../lib/libOgreSamplesCommon.a ../../../../lib/libOgreNextOverlay.so.4.0 /usr/lib/libSDL2main.a /usr/lib/libSDL2.so ../../../../lib/libOgreNextHlmsPbs.so.4.0 ../../../../lib/libOgreNextAtmosphere.so.4.0 ../../../../lib/libOgreNextHlmsUnlit.so.4.0 ../../../../lib/libOgreNextMain.so.4.0 /usr/lib/libSM.so /usr/lib/libICE.so /usr/lib/libX11.so /usr/lib/libXext.so /usr/lib/libXt.so /usr/lib/libXaw.so /usr/lib/libXrandr.so -lxcb -lpthread -ldl /usr/lib/libfreeimage.so /usr/lib/libzzip.so /usr/lib/libz.so /usr/local/lib/libfreetype.a
cd /home/joilnen/ogre3d_devel/ogre-next-3.4.x/build/Samples/2.0/Tutorials/TutorialUav01_Setup && /usr/bin/cmake -E cmake_symlink_executable ../../../../bin/Sample_TutorialUav01_Setup-4.0 ../../../../bin/Sample_TutorialUav01_Setup
make[2]: Leaving directory '/home/joilnen/ogre3d_devel/ogre-next-3.4.x/build'
[100%] Built target Sample_TutorialUav01_Setup
1 warning generated.
[100%] Linking CXX executable ../../../../bin/Sample_Tutorial_Terrain
cd /home/joilnen/ogre3d_devel/ogre-next-3.4.x/build/Samples/2.0/Tutorials/Tutorial_Terrain && /usr/bin/cmake -E cmake_link_script CMakeFiles/Sample_Tutorial_Terrain.dir/link.txt --verbose=1
/usr/bin/clang++ -Wall -Winit-self -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -Wshadow -Wimplicit-fallthrough         -Winconsistent-missing-destructor-override -Wcomma -Wsign-conversion -Wconversion  -msse -msse2 -O2 -g -DNDEBUG -fuse-ld=lld -Xlinker --dependency-file -Xlinker CMakeFiles/Sample_Tutorial_Terrain.dir/link.d CMakeFiles/Sample_Tutorial_Terrain.dir/src/Terra/Hlms/OgreHlmsJsonTerra.cpp.o CMakeFiles/Sample_Tutorial_Terrain.dir/src/Terra/Hlms/OgreHlmsTerra.cpp.o CMakeFiles/Sample_Tutorial_Terrain.dir/src/Terra/Hlms/OgreHlmsTerraDatablock.cpp.o CMakeFiles/Sample_Tutorial_Terrain.dir/src/Terra/Hlms/PbsListener/OgreHlmsPbsTerraShadows.cpp.o CMakeFiles/Sample_Tutorial_Terrain.dir/src/Terra/Terra.cpp.o CMakeFiles/Sample_Tutorial_Terrain.dir/src/Terra/TerraShadowMapper.cpp.o CMakeFiles/Sample_Tutorial_Terrain.dir/src/Terra/TerraWorkspaceListener.cpp.o CMakeFiles/Sample_Tutorial_Terrain.dir/src/Terra/TerrainCell.cpp.o CMakeFiles/Sample_Tutorial_Terrain.dir/src/Tutorial_Terrain.cpp.o CMakeFiles/Sample_Tutorial_Terrain.dir/src/Tutorial_TerrainGameState.cpp.o -o ../../../../bin/Sample_Tutorial_Terrain-4.0  -Wl,-rpath,/home/joilnen/ogre3d_devel/ogre-next-3.4.x/build/lib: ../../../../lib/libOgreSamplesCommon.a ../../../../lib/libOgreNextOverlay.so.4.0 ../../../../lib/libOgreNextHlmsPbs.so.4.0 /usr/lib/libSDL2main.a /usr/lib/libSDL2.so ../../../../lib/libOgreNextAtmosphere.so.4.0 ../../../../lib/libOgreNextHlmsUnlit.so.4.0 ../../../../lib/libOgreNextMain.so.4.0 /usr/lib/libSM.so /usr/lib/libICE.so /usr/lib/libX11.so /usr/lib/libXext.so /usr/lib/libXt.so /usr/lib/libXaw.so /usr/lib/libXrandr.so -lxcb -lpthread -ldl /usr/lib/libfreeimage.so /usr/lib/libzzip.so /usr/lib/libz.so /usr/local/lib/libfreetype.a
cd /home/joilnen/ogre3d_devel/ogre-next-3.4.x/build/Samples/2.0/Tutorials/Tutorial_Terrain && /usr/bin/cmake -E cmake_symlink_executable ../../../../bin/Sample_Tutorial_Terrain-4.0 ../../../../bin/Sample_Tutorial_Terrain
make[2]: Leaving directory '/home/joilnen/ogre3d_devel/ogre-next-3.4.x/build'
[100%] Built target Sample_Tutorial_Terrain
make[1]: Leaving directory '/home/joilnen/ogre3d_devel/ogre-next-3.4.x/build'
make: *** [Makefile:156: all] Error 2
extra/glslang 14.3.0-1 [installed]
    OpenGL and OpenGL ES shader front end and validator
[joilnen@sutherland build]$ pacman -Ss  spirv
extra/spirv-headers 1:1.3.283.0-1 [installed]
    SPIR-V Headers
extra/spirv-llvm-translator 18.1.6-1 [installed]
    Tool and a library for bi-directional translation between SPIR-V and LLVM IR
extra/spirv-tools 2024.2-1 (vulkan-devel) [installed]
    API and commands for processing SPIR-V modules

@darksylinc
Copy link
Member

darksylinc commented Nov 27, 2024

Hi!

Please follow building instructions for Linux.

The dependencies package must be present so OgreNext picks shaderc up from there (shaderc from system installed packages is not currently supported at the moment).

You will have to delete your CMake build folder to avoid any lingering issue.

@darksylinc darksylinc added wontfix This will not be worked on and removed Priority: Normal labels Nov 27, 2024
@Joilnen
Copy link
Author

Joilnen commented Nov 28, 2024

maybe a wrong glslang version in my system ?

ld.lld: error: undefined symbol: glslang::TShader::setShiftTextureBinding(unsigned int)

@darksylinc
Copy link
Member

maybe a wrong glslang version in my system ?

Hi. Please delete your CMake build folder and start from scratch following building instructions for Linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Vulkan wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants