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

Failed compilation Windows VSCode & Ubuntu - missing files (bake_transform.cpp bake_transform.hpp) #144

Open
Bad-Developer opened this issue Jan 24, 2025 · 6 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Bad-Developer
Copy link

Bad-Developer commented Jan 24, 2025

The missing code was the major problem. I don't know if any other these other experiences are of interest to you, but there's some partial solutions to work with.

TBF This was my second compilation, so I may have made overlooked some things / fixes. But i'll let you decide. The bake_transform is real though. It's just not there.

Very sad i wasn't able to get this running.

gcc --version
g++ --version
gcc (Ubuntu 11.4.0-1ubuntu122.04) 11.4.0
g++ (Ubuntu 11.4.0-1ubuntu1
22.04) 11.4.0
Ubuntu 22.04.5 LTS (Jammy Jellyfish)

Wasn't able to get this compiled on VSCODE either. Latest error was the bake_transform.cpp not existing (both OS)

CMake Error at cmake/functions.cmake:54 (target_sources):
Cannot find source file:

erhe_geometry/operation/bake_transform.cpp

Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm
.ccm .cxxm .c++m .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90
.f95 .f03 .hip .ispc
Call Stack (most recent call first):
src/erhe/geometry/CMakeLists.txt:4 (erhe_target_sources_grouped)

bake_transform.hpp and bake_transform.cpp dont exist afaik

one does not simply remove these without causing a lot of knock on errors.

it's definitely not where it's supposed to be

~/Downloads/GUI_EXPERIMENTS_COMPILE/erhe-main-3D-stuff/erhe-main/src/erhe/geometry/erhe_geometry/operation$ ls
ambo.cpp gyro.hpp repair.hpp
ambo.hpp intersection.cpp reverse.cpp
catmull_clark_subdivision.cpp intersection.hpp reverse.hpp
catmull_clark_subdivision.hpp join.cpp sqrt3_subdivision.cpp
clone.cpp join.hpp sqrt3_subdivision.hpp
clone.hpp kis.cpp subdivide.cpp
difference.cpp kis.hpp subdivide.hpp
difference.hpp meta.cpp triangulate.cpp
dual.cpp meta.hpp triangulate.hpp
dual.hpp normalize.cpp truncate.cpp
geometry_operation.cpp normalize.hpp truncate.hpp
geometry_operation.hpp octree.hpp union.cpp
gyro.cpp repair.cpp union.hpp

  1. Think this was just a linux problem.

/erhe-main-3D-stuff/erhe-main/src/erhe/gltf/erhe_gltf/gltf_fastgltf.cpp:365:24: error: ‘from_chars’ is not a member of ‘std’
365 | auto result = std::from_chars(number_part.data(), number_part.data() + number_part.size(), integer_value);
| ^~~~~~~~~~
make[2]: *** [src/erhe/gltf/CMakeFiles/erhe_gltf.dir/build.make:104: src/erhe/gltf/CMakeFiles/erhe_gltf.dir/erhe_gltf/gltf_fastgltf.cpp.o] Error 1

Looks like it's solved with this (attached)

gltf_fastgltf_NEW VERSION v1.txt

Linux problem, wasn't a problem on Windows VSCODE, although I was just doing it from BASH at this point.

CMake Error at CMakeLists.txt:339 (add_subdirectory):
add_subdirectory given source
"/home/o/Downloads/GUI_EXPERIMENTS_COMPILE/erhe-main-3D-stuff/erhe-main/build/_deps/joltphysics-src/build"
which is not an existing directory.

cd ~/Downloads/GUI_EXPERIMENTS_COMPILE/erhe-main-3D-stuff/erhe-main/build/_deps && ls
bvh-build glm-subbuild
bvh-src harfbuzz-build
bvh-subbuild harfbuzz-src
concurrentqueue-build harfbuzz-subbuild
concurrentqueue-src joltphysics-build
concurrentqueue-subbuild joltphysics-src
cxxopts-build joltphysics-subbuild

Edit CMakeLists.txt

# Fix line 339:
    #add_subdirectory(${JoltPhysics_SOURCE_DIR}/build ${JoltPhysics_BINARY_DIR})
    
add_subdirectory(
    "${CMAKE_CURRENT_BINARY_DIR}/_deps/joltphysics-src/Build"
    "${CMAKE_CURRENT_BINARY_DIR}/_deps/joltphysics-build"
)
  1. Linux problem - on VSCode at this point. version 1.96.4 - snap

The New Jolt Error: index is used uninitialized (-Werror=uninitialized)

/home/o/Downloads/JoltPhysics/Build/../Jolt/Core/HashTable.h: In member function ‘void JPH::DebugRendererPlayback::Parse(JPH::StreamIn&)’:
/home/o/Downloads/JoltPhysics/Build/../Jolt/Core/HashTable.h:227:30: error: ‘index’ is used uninitialized [-Werror=uninitialized]
227 | return mData[inIndex];

This means your compiler sees a path in Jolt’s code where a variable named index might not be assigned before use. Because all warnings are being treated as errors (-Werror), it aborts compilation.

suppressed with this

cd ~/Downloads/GUI_EXPERIMENTS_COMPILE/erhe-main-3D-stuff/erhe-main
mkdir build
cd build
cmake ..
-DCMAKE_BUILD_TYPE=Release
-DVORPALINE_PLATFORM=Linux64-gcc
-DHERHE_PHYSICS_LIBRARY=jolt
-DCMAKE_CXX_FLAGS="-Wno-error=uninitialized"

  1. Windows problem

Actually dont know if this is a reproducible error - it's probably me being lazy
Didnt test installing dependencies (so that probably woudld've worked)

CMake Error at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.29/Modules/FetchContent.cmake:1714 (message):
Build step for harfbuzz failed: 1
Call Stack (most recent call first):
C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.29/Modules/FetchContent.cmake:1854:EVAL:2 (__FetchContent_directPopulate)
C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.29/Modules/FetchContent.cmake:1854 (cmake_language)
out/build/Configure Empty/cmake/CPM_0.40.5.cmake:1133 (FetchContent_Populate)
out/build/Configure Empty/cmake/CPM_0.40.5.cmake:911 (cpm_fetch_package)
CMakeLists.txt:295 (CPMAddPackage)

I just changed it to -DERHE_TEXT_LAYOUT_LIBRARY=freetype ^

Your project tries to fetch and build freetype or harfbuzz (for text layout/font rasterization). The logs show:

Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
Could NOT find PNG ...
Could NOT find BZip2 ...
Could NOT find BrotliDec ...

  1. Better config script

scripts\configure_vs2022.bat

this configure script worked better for me, the other one wasn't looking for makefile

in the right directory on repeated builds

:: Remove the old build folder if it exists
if exist build (
rmdir build /s /q
)

:: Create the new build folder
mkdir build
cd build

cmake ^
-G "Visual Studio 17 2022" ^
-A x64 ^
-S .. ^
-B . ^

@tksuoran tksuoran added the bug Something isn't working label Jan 24, 2025
@tksuoran tksuoran self-assigned this Jan 24, 2025
@tksuoran tksuoran added this to the priority milestone Jan 24, 2025
@tksuoran
Copy link
Owner

Hi, thanks for the bug report.
I've pushed some fixes, could you please try again after pulling latest, and let me know if this works for you, or if you still have issues. Thanks!.

@tksuoran
Copy link
Owner

tksuoran commented Jan 24, 2025

At least some of the errors you list may still be present. This is (most likely) due to different (older) compiler version; I mostly test only with quite recent versions of MSVC, gcc and clang, and there may be issues with older compiler versions. If you are able to update to newer GCC, or use clang instead, that might help.

@tksuoran
Copy link
Owner

I pushed some more fixes, now it compiles in WSL Ubuntu 22.04 with gcc 11.

@tksuoran tksuoran moved this to 👀 In review in erhe backlog Jan 24, 2025
@Bad-Developer
Copy link
Author

Bad-Developer commented Jan 28, 2025

Thanks for quick response. You fixed the error.
First build was successful without the sed line, but subsequent builds failed despite wiping build dir everytime. Difference was only a matter of hours...
I think it's because Jolt is being actively developed? It would be good to have option to freeze dependencies for some stability.
If this is already a feature, please refer to my username for explanation xD

/home/o/Downloads/GUI_EXPERIMENTS_COMPILE/erhe/build/_deps/joltphysics-src/Build/../Jolt/Core/UnorderedMap.h:41:27: note: ‘index’ was declared here
41 | size_type index;
| ^~~~~
...
cc1plus: all warnings being treated as errors

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-11

cd ~/Downloads/GUI_EXPERIMENTS_COMPILE/erhe
rm -rf build
mkdir build
cd build
CC=gcc-11 CXX=g++-11 cmake ..
-DCMAKE_BUILD_TYPE=Release
-DVORPALINE_PLATFORM=Linux64-gcc
-DHERHE_PHYSICS_LIBRARY=jolt
-DGEOGRAM_WITH_GRAPHICS=ON \ # Not sure what this does, but I used it so I'll leave it
-DGEOGRAM_LIB_ONLY=OFF \ # Not sure what this does, but I used it so I'll leave it

sed -i 's/size_type index;/size_type index = 0;/'
~/Downloads/GUI_EXPERIMENTS_COMPILE/erhe/build/_deps/joltphysics-src/Jolt/Core/UnorderedMap.h

make -j$(nproc) VERBOSE=1

cd ~/Downloads/GUI_EXPERIMENTS_COMPILE/erhe/src/editor/
./editor

@tksuoran
Copy link
Owner

I was able to reproduce the issue, by using the steps you documented. Normally, I use VSCode with C++ and cmake extensions, and I use cmake presets, and using that build method, the issue does not show up.

I have made some fixes, but the issue is not yet fully resolved. Meanwhile, if you install clang sudo apt install clang and use CC=clang CXX=clang++ you should be able to make a build. At least it worked for me locally, after I did recent fixes.

I will try to make the GCC compiler work as well.

@tksuoran
Copy link
Owner

You could you try these commands (they work for me)

CC=gcc-11 CXX=g++-11 cmake -B build_gcc11 -S . --preset="Configure GCC Debug"
cmake --build build_gcc11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 👀 In review
Development

No branches or pull requests

2 participants