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 build point-release/23103 on Linux in release config. #17844

Open
michalpelka opened this issue Apr 26, 2024 · 4 comments
Open

Cannot build point-release/23103 on Linux in release config. #17844

michalpelka opened this issue Apr 26, 2024 · 4 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. sig/build Categorizes an issue or PR as relevant to SIG Build.

Comments

@michalpelka
Copy link
Contributor

michalpelka commented Apr 26, 2024

Describe the bug
I've tried to build the Engine and got some compilation errors.
1st unused variable Uuid modelId in Gems/Meshlets/Code/Source/Meshlets/MeshletsAssets.cpp
2nd error (after commenting out 1st one):

FAILED: bin/profile/libMeshlets.Editor.so 
: && /usr/bin/clang++-14 -fPIC -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -Wno-inconsistent-missing-override -Wrange-loop-analysis -Wno-unknown-warning-option -Wno-parentheses -Wno-reorder -Wno-switch -Wno-undefined-var-template -msse4.1  -O2 -g -fstack-protector-all -fstack-check  -Wl,--no-undefined -fpie -Wl,-z,relro,-z,now -Wl,-z,noexecstack -shared  -o bin/profile/libMeshlets.Editor.so External/Meshlets-44c9c9c6/Code/CMakeFiles/Meshlets.Editor.dir/profile/Meshlets.Editor_autogen/mocs_compilation_profile.cpp.o External/Meshlets-44c9c9c6/Code/CMakeFiles/Meshlets.Editor.dir/profile/Unity/unity_0_cxx.cxx.o  -Wl,-rpath,"\$ORIGIN"  lib/profile/libMeshlets.Editor.Static.a  lib/profile/libAzToolsFramework.a  /home/michalpelka/github_project_centric/3rdparty/-DLY_STRIP_DEBUG_SYMBOLS=ON/packages/SQLite-3.37.2-rev1-linux/SQLite/lib/libsqlite3.a  bin/profile/libAzQtComponents.so  /home/michalpelka/github_project_centric/3rdparty/-DLY_STRIP_DEBUG_SYMBOLS=ON/packages/qt-5.15.2-rev9-linux/qt/lib/libQt5Svg.so.5.15.1  /home/michalpelka/github_project_centric/3rdparty/-DLY_STRIP_DEBUG_SYMBOLS=ON/packages/qt-5.15.2-rev9-linux/qt/lib/libQt5Widgets.so.5.15.1  /home/michalpelka/github_project_centric/3rdparty/-DLY_STRIP_DEBUG_SYMBOLS=ON/packages/qt-5.15.2-rev9-linux/qt/lib/libQt5Gui.so.5.15.1  /home/michalpelka/github_project_centric/3rdparty/-DLY_STRIP_DEBUG_SYMBOLS=ON/packages/qt-5.15.2-rev9-linux/qt/lib/libQt5Xml.so.5.15.1  /home/michalpelka/github_project_centric/3rdparty/-DLY_STRIP_DEBUG_SYMBOLS=ON/packages/qt-5.15.2-rev9-linux/qt/lib/libQt5Core.so.5.15.1  lib/profile/libMeshlets.Static.a  lib/profile/libAtomLyIntegration_CommonFeatures.Static.a  lib/profile/libLmbrCentral.Static.a  lib/profile/libCryCommon.a  lib/profile/libGradientSignal.Static.a  lib/profile/libSurfaceData.Static.a  lib/profile/libAtom_Feature_Common.Static.a  lib/profile/libAtom_Feature_Common.Public.a  lib/profile/libAtom_Utils.Static.a  /home/michalpelka/github_project_centric/3rdparty/-DLY_STRIP_DEBUG_SYMBOLS=ON/packages/png-1.6.37-rev2-linux/png/lib/libpng16.a  bin/profile/libImGui.imguilib.so  /home/michalpelka/github_project_centric/3rdparty/-DLY_STRIP_DEBUG_SYMBOLS=ON/packages/tiff-4.2.0.15-rev3-linux/tiff/lib/libtiff.a  lib/profile/libAtom_RPI.Public.a  lib/profile/libAtom_RHI.Public.a  lib/profile/libAtom_RHI.Reflect.a  lib/profile/libAzFramework.a  /usr/lib/x86_64-linux-gnu/libxcb-xkb.so  /usr/lib/x86_64-linux-gnu/libxcb-xfixes.so  /usr/lib/x86_64-linux-gnu/libxcb.so  /usr/lib/x86_64-linux-gnu/libxkbcommon-x11.so  /usr/lib/x86_64-linux-gnu/libxkbcommon.so  /usr/lib/x86_64-linux-gnu/libX11.so  -lxcb-xinput  lib/profile/libAzNetworking.a  /home/michalpelka/github_project_centric/3rdparty/-DLY_STRIP_DEBUG_SYMBOLS=ON/packages/OpenSSL-1.1.1t-rev1-linux/OpenSSL/lib/libssl.a  /home/michalpelka/github_project_centric/3rdparty/-DLY_STRIP_DEBUG_SYMBOLS=ON/packages/OpenSSL-1.1.1t-rev1-linux/OpenSSL/lib/libcrypto.a  /home/michalpelka/github_project_centric/3rdparty/-DLY_STRIP_DEBUG_SYMBOLS=ON/packages/lz4-1.9.4-rev2-linux/lz4/lib/liblz4.a  lib/profile/libAtomCore.a  lib/profile/libAzCore.a  /usr/lib/x86_64-linux-gnu/libunwind.so  -lpthread  -latomic  -lpthread  -latomic  /home/michalpelka/github_project_centric/3rdparty/-DLY_STRIP_DEBUG_SYMBOLS=ON/packages/Lua-5.4.4-rev1-linux/Lua/lib/release/liblualib.a  -ldl  /home/michalpelka/github_project_centric/3rdparty/-DLY_STRIP_DEBUG_SYMBOLS=ON/packages/zlib-1.2.11-rev5-linux/zlib/lib/libz.a  /usr/lib/x86_64-linux-gnu/libzstd.so  /home/michalpelka/github_project_centric/3rdparty/-DLY_STRIP_DEBUG_SYMBOLS=ON/packages/cityhash-1.1-multiplatform/cityhash/build/linux/clang-3.8/release/libcityhash.a  bin/profile/libO3DEKernel.so && cd /home/michalpelka/github_project_centric/o3de/build/linux/External/Meshlets-44c9c9c6/Code && /usr/bin/cmake -P /home/michalpelka/github_project_centric/o3de/cmake/Platform/Linux/ProcessDebugSymbols.cmake /usr/bin/strip /usr/bin/objcopy /home/michalpelka/github_project_centric/o3de/build/linux/bin/profile/libMeshlets.Editor.so dbg MODULE_LIBRARY DISCARD
/usr/bin/ld: lib/profile/libMeshlets.Static.a(unity_0_cxx.cxx.o): in function `AZ::Meshlets::MeshletsRenderObject::CreateMeshlets(AZ::Meshlets::GeneratorMesh&)':
(.text+0x4a3f): undefined reference to `meshopt_buildMeshletsBound'
/usr/bin/ld: (.text+0x4bef): undefined reference to `meshopt_buildMeshlets'

Assets required
Build script:

git clone https://github.com/o3de/o3de.git --branch point-release/23103

root=$(pwd)
external=$(pwd)/3rdparty/
o3de_dir=$(pwd)/o3de
mkdir -p ${external}
cd ${o3de_dir}
python/get_python.sh
cmake -B build/linux -S . -G "Ninja Multi-Config" -DLY_3RDPARTY_PATH=${external}-DLY_STRIP_DEBUG_SYMBOLS=ON -DLY_DISABLE_TEST_MODULES=ON -DAZ_USE_PHYSX5:BOOL=ON
cmake --build build/linux --target install -j 30

Steps to reproduce
Steps to reproduce the behavior:

  1. Run build script
    Expected behavior
    It should build in release.

Actual behavior
Fails:

  • with unused variables, then fails with linker error

Found in Branch
Name of or link to the branch where the issue occurs.

Commit ID from o3de/o3de Repository
97c9922 (HEAD -> point-release/23103, origin/point-release/23103)

Desktop/Device (please complete the following information):

  • Device: PC
  • OS: Ubuntu
  • Version 22.04
  • CPU Intel I9-9900k
  • GPU NVidia RTX 4080
  • Memory [64]
@michalpelka michalpelka added kind/bug Categorizes issue or PR as related to a bug. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. sig/build Categorizes an issue or PR as relevant to SIG Build. labels Apr 26, 2024
@michalpelka
Copy link
Contributor Author

The release build failed on 2310.2. It went through on 2310.1

@nick-l-o3de
Copy link
Contributor

nick-l-o3de commented Apr 26, 2024

Meshlets are not officially supported on O3DE, and are not available by default in the list of selected gems to enable. To get this gem to work requires quite a bit of work documented in its readme, as well as custom registration and hand-activation of it, else it wont even show up in Project Manager.

I was a able to get it to work on linux ubuntu 22.04 by manually installing the meshoptimizer-dev library from the apt repository, and then adding the dependency meshoptimizer::meshoptimizer to the meshoptimizer PUBLIC BUILD_DEPENDENCIES list of the main static module, and then adding

find_package(meshoptimizer CONFIG REQUIRED)  # use system provided library
# there is only one config shipped in the above library, called "NONE".  Map O3DE configs to it.
set_target_properties(meshoptimizer::meshoptimizer PROPERTIES MAP_IMPORTED_CONFIG_RELEASE NONE)
set_target_properties(meshoptimizer::meshoptimizer PROPERTIES MAP_IMPORTED_CONFIG_DEBUG NONE)
set_target_properties(meshoptimizer::meshoptimizer PROPERTIES MAP_IMPORTED_CONFIG_PROFILE NONE)

to the linux 3rd party package list in cmake/3rdParty/Platform/Linux/...

We should probably fixup this gem and move it to extras...

@spham-amzn
Copy link
Contributor

We should just remove it from the point release then.

@michalpelka michalpelka changed the title Cannot build point-release/23103 on Linux. Cannot build point-release/23103 on Linux in release config. Apr 29, 2024
@lemonade-dm
Copy link
Contributor

lemonade-dm commented May 1, 2024

Well the Meshlets Gem is not part of the engine.json file, so it shouldn't be building in the first place as CMake should not be visiting the CMakeLists.txt for the Gems/Meshlets folder.

We can debug which Gems folders are being added to the build by setting the CMake log level to verbose using the --log-level vebose option when configuring.

There is VERBOSE log messages that outputs all external_subdirectories in Subdirectories.cmake

@lemonade-dm lemonade-dm removed the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. sig/build Categorizes an issue or PR as relevant to SIG Build.
Projects
None yet
Development

No branches or pull requests

4 participants