o3de / o3de-extras

Other
63 stars 63 forks source link

MySimulationProject tutorial does not compile: #797

Open fjnn opened 2 days ago

fjnn commented 2 days ago

Describe the bug I am trying to start a ROS2 project by following this tutorial: https://docs.o3de.org/docs/user-guide/interactivity/robotics/project-configuration/ I have freshly installed O3DE into my Ubuntu 24.04 from source and registered the engine. I have ROS2 Jazzy installed. I have added ROS2 gem into the project. When I run cmake -B build/linux -G "Ninja Multi-Config" -DLY_DISABLE_TEST_MODULES=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DLY_STRIP_DEBUG_SYMBOLS=ON, the build process fails.

Failed Jenkins Job Information: CMake Error at /home/gizem2404/o3de/cmake/LYWrappers.cmake:561 (target_link_libraries): Target "ROS2.Static" links to:

Gem::Atom_Feature_Common.Static

but the target was not found. Possible reasons include:

* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.

Call Stack (most recent call first): /home/gizem2404/o3de/CMakeLists.txt:120 (ly_delayed_target_link_libraries)

CMake Error at /home/gizem2404/o3de/cmake/LYWrappers.cmake:561 (target_link_libraries): Target "ROS2" links to:

Gem::Atom_Feature_Common.Static

but the target was not found. Possible reasons include:

* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.

Call Stack (most recent call first): /home/gizem2404/o3de/CMakeLists.txt:120 (ly_delayed_target_link_libraries)

CMake Error at /home/gizem2404/o3de/cmake/LYWrappers.cmake:561 (target_link_libraries): Target "ROS2.Editor" links to:

Gem::Atom_Feature_Common.Static

but the target was not found. Possible reasons include:

* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.

Call Stack (most recent call first): /home/gizem2404/o3de/CMakeLists.txt:120 (ly_delayed_target_link_libraries)

CMake Error at /home/gizem2404/o3de/cmake/LYWrappers.cmake:561 (target_link_libraries): Target "MySimulationProject.Editor" links to:

Gem::Atom_Feature_Common.Static

but the target was not found. Possible reasons include:

* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.

Call Stack (most recent call first): /home/gizem2404/o3de/CMakeLists.txt:120 (ly_delayed_target_link_libraries)

-- Generating done (5.9s) CMake Generate step failed. Build files cannot be regenerated correctly.

fjnn commented 2 days ago

By the way, I have Atom gem (?) is under the installation folder. image

I tried to manually register it by running ${O3DE_HOME}/scripts/o3de.sh register --gem-path $HOME/o3de/Gems/Atom/Feature/Common/, but I still get the same error.

jhanca-robotecai commented 2 days ago

I am not able to reproduce your problem, but I saw you tried using the binary package earlier (#796). Please verify you cleaned your environment before running the build, as there might be some conflicts between your binary and the source code. Please double-check if you use the same (2409.1) version of o3de and o3de-extras repositories; please double-check if you initialized git lfs.

In my tests (I tested #796 a moment ago) I completely removed o3de binary installation, removed ~/.o3de, and ~/O3DE folders. Next, I did the following:

#!/bin/zsh

export O3DE_HOME=${HOME}/devroot/2409/o3de
export O3DE_EXTRAS_HOME=${HOME}/devroot/2409/o3de-extras
export PROJECT_NAME=R2RM
export PROJECT_PATH=${HOME}/devroot/projects/${PROJECT_NAME}

${O3DE_HOME}/python/get_python.sh 
${O3DE_HOME}/scripts/o3de.sh register -ep ${O3DE_HOME}
${O3DE_HOME}/scripts/o3de.sh register -agp ${O3DE_EXTRAS_HOME}/Gems/

${O3DE_HOME}/scripts/o3de.sh create-project --project-path $PROJECT_PATH --template-path ${O3DE_EXTRAS_HOME}/Templates/Ros2RoboticManipulationTemplate/
cd $PROJECT_PATH
cmake -B build/linux -G "Ninja Multi-Config" -DLY_STRIP_DEBUG_SYMBOLS=ON -DLY_UNITY_BUILD=ON -DLY_DISABLE_TEST_MODULES=ON
cmake --build build/linux --config profile --target ${PROJECT_NAME} Editor ${PROJECT_NAME}.Assets ${PROJECT_NAME}.GameLauncher -j 16
fjnn commented 13 hours ago

Thank you so much! I will try. I thought that I did clean everything before downloading and building from source, but I might be missing some.

By the way, is there a way to check the installed version of o3de and o3de-extras before I redo the installation?