Closed shiner-chen closed 6 months ago
This is also reproducible with cesium-native v0.30.0 & v0.32.0, from the latest osgEarth master back to commit c4ca2a4ea48a85a69135b4ea9ae80b937ba56d49
Using cesium-native v0.29.0 and prior fail to compile with error: unknown target 'osgEarthCesium'
.
osgEarth prior to c4ca2a4ea48a85a69135b4ea9ae80b937ba56d49 fails with error: use of undeclared identifier 'GL_R'
.
It seems there is no combination of versions currently which will build the cesium-native node kit on Linux.
Would it be possible to enable the cesium node kit for CI builds?
@jasonbeverage how to fix this build issue, I tried some method, but still failed :(
when I build the cesium-native with command:cmake -DCMAKE_INSTALL_PREFIX=/opt/cesium-native -DCMAKE_CXX_FLAGS="-fPIC" -DCMAKE_C_FLAGS="-fPIC" -DBUILD_SHARED_LIBS=ON -DCESIUM_TESTS_ENABLED=OFF ..
, and then compiled the osgearth, get the error as below.
[ 80%] Linking CXX executable ../../../bin/osgearth_imgui
/usr/bin/ld: ../../../lib/libosgEarthCesium.so.3.5.0: undefined reference to `CesiumAsync::CesiumImpl::QueuedScheduler::schedule(async::task_run_handle)'
/usr/bin/ld: ../../../lib/libosgEarthCesium.so.3.5.0: undefined reference to `CesiumAsync::CesiumImpl::TaskScheduler::schedule(async::task_run_handle)'
/usr/bin/ld: ../../../lib/libosgEarthCesium.so.3.5.0: undefined reference to `Cesium3DTilesSelection::ViewState::create(glm::vec<3, double, (glm::qualifier)0> const&, glm::vec<3, double, (glm::qualifier)0> const&, glm::vec<3, double, (glm::qualifier)0> const&, glm::vec<2, double, (glm::qualifier)0> const&, double, double, CesiumGeospatial::Ellipsoid const&)'
/usr/bin/ld: ../../../lib/libosgEarthCesium.so.3.5.0: undefined reference to `CesiumGltfContent::GltfUtilities::applyRtcCenter(CesiumGltf::Model const&, glm::mat<4, 4, double, (glm::qualifier)0> const&)'
/usr/bin/ld: ../../../lib/libosgEarthCesium.so.3.5.0: undefined reference to `CesiumGltfContent::GltfUtilities::applyGltfUpAxisTransform(CesiumGltf::Model const&, glm::mat<4, 4, double, (glm::qualifier)0> const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [src/applications/osgearth_imgui/CMakeFiles/application_osgearth_imgui.dir/build.make:223: bin/osgearth_imgui] Error 1
make[1]: *** [CMakeFiles/Makefile2:1998: src/applications/osgearth_imgui/CMakeFiles/application_osgearth_imgui.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
Thanks for the report. I've looked into this and pushed a fix to the master in 49f989ccedfd6cd6e9d78337c97e628334b397f6. It was an issue with the order of static libraries being very particular on linux as well as having to ensure that the same GLM preprocessor definitions were defined in osgEarthCesium as what was used in cesium-native.
I also found that instead of specifying -fPIC as a CMAKE_CXX_FLAGS you can define -DCMAKE_POSITION_INDEPENDENT_CODE=ON instead which I didn't realize.
I haven't tried running it on Linux yet, just getting it built. Let us know if it works for you!
@shiner-chen have you managed to build osgearth with cesium native support? in the end, which were the tags that you built using which build flags? I'm encountering similar fPIC - related problems.
Thanks you!
Try the master, it should be ok now. Make sure you build cesium-native by passing in the -DCMAKE_POSITION_INDEPENDENT_CODE=ON setting when you run cmake configure.
Describe the bug In Ubuntu 22.04.3 aarch64 os, the latest master code compile error with cesium-native v0.31.0.
To Reproduce Steps to reproduce the behavior:
Build the cesium-native git clone https://github.com/CesiumGS/cesium-native.git --recurse-submodules git checkout v0.31.0 cmake -B build -S . cmake --build build --config RelWithDebInfo -j 8 sudo cmake --install build
build and install the OpenSceneGraph
Build osgearth git clone --recurse-submodules https://github.com/gwaldron/osgearth.git osgearth cd osgearth/ mkdir build cd build/ cmake -DCESIUM_NATIVE_DIR=/usr/local -DOSGEARTH_BUILD_CESIUM_NODEKIT=ON ..
Expected behavior should build successfully.
Screenshots compile failled, the log, please see above.
Desktop (please complete the following information):