GodotECS / godex

Godex is a Godot Engine ECS library.
MIT License
1.23k stars 68 forks source link

Fails to compile on Arch Linux #290

Open abramsba opened 2 years ago

abramsba commented 2 years ago

g++/gcc version: 12.1.0 scons version: 4.3.0

Following the instructions on the README, I've cloned both the godot and godex repositores and applied the patch.

When using scons I get an error that it's not able to find initialize_godex_module and so forth:

 > scons -j$(nproc) platform=linuxbsd target=release_debug custom_modules="../godex"  

scons: Reading SConscript files ...
Warning: Speech Dispatcher development libraries not found. Disabling Text-to-Speech support.
This file `./systems/system_structs.gen.h` is already generated.
This file `./systems/system_exe_funcs.gen.h` is already generated.
This file `./systems/system_dispatcher_exe_funcs.gen.h` is already generated.
This file `./systems/temporary_system_exe_funcs.gen.h` is already generated.
Checking for C header file mntent.h... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
[Initial build] run(["core/object/gdvirtual.gen.inc"], ["core/object/make_virtuals.py"])
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/skeleton.glsl.gen.h"
Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/particles.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/particles_copy.glsl.gen.h"
[Initial build] Compiling platform/linuxbsd/joypad_linux.cpp ...
[Initial build] Compiling platform/linuxbsd/freedesktop_screensaver.cpp ...
[Initial build] Compiling platform/linuxbsd/detect_prime_x11.cpp ...
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/blit.glsl.gen.h"
[Initial build] Compiling platform/linuxbsd/os_linuxbsd.cpp ...
[Initial build] Compiling platform/linuxbsd/crash_handler_linuxbsd.cpp ...
Compiling platform/linuxbsd/godot_linuxbsd.cpp ...
[Initial build] Compiling platform/linuxbsd/gl_manager_x11.cpp ...
[Initial build] Building GLES3 GLSL header: "drivers/gles3/shaders/canvas.glsl.gen.h"
[Initial build] Building GLES3 GLSL header: "drivers/gles3/shaders/cubemap_filter.glsl.gen.h"
[Initial build] Building GLES3 GLSL header: "drivers/gles3/shaders/scene.glsl.gen.h"
[Initial build] Building GLES3 GLSL header: "drivers/gles3/shaders/copy.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/canvas.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/canvas_occlusion.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/voxel_gi_sdf.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/canvas_sdf.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/volumetric_fog.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/volumetric_fog_process.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/scene_forward_mobile.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/cube_to_dp.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/cubemap_downsampler.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/cubemap_downsampler_raster.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/cubemap_filter.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/cubemap_filter_raster.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/cubemap_roughness.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/cubemap_roughness_raster.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/fsr_upscale.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/luminance_reduce.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/luminance_reduce_raster.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/resolve.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/roughness_limiter.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/screen_space_reflection.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/screen_space_reflection_filter.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/screen_space_reflection_scale.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/sort.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/specular_merge.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/ssao.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/ssao_blur.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/ssao_importance_map.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/ssao_interleave.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/subsurface_scattering.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/cluster_debug.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/cluster_render.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/cluster_store.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/gi.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/sdfgi_debug.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/sdfgi_debug_probes.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/sdfgi_direct_light.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/sdfgi_integrate.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/sdfgi_preprocess.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/voxel_gi.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/voxel_gi_debug.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/sky.glsl.gen.h"
[Initial build] Compiling platform/linuxbsd/display_server_x11.cpp ...
platform/linuxbsd/display_server_x11.cpp:1185:2: warning: #warning Need to get from proper window [-Wcpp]
 1185 | #warning Need to get from proper window
      |  ^~~~~~~
[Initial build] Compiling platform/linuxbsd/key_mapping_x11.cpp ...
[Initial build] Compiling platform/linuxbsd/vulkan_context_x11.cpp ...
[Initial build] Compiling platform/linuxbsd/libudev-so_wrap.c ...
[Initial build] Generating enabled modules header.
[Initial build] Compiling main/main.cpp ...
[Initial build] Compiling main/main_timer_sync.cpp ...
[Initial build] Compiling main/performance.cpp ...
[Initial build] Compiling modules/register_module_types.gen.cpp ...
modules/register_module_types.gen.cpp: In function 'void initialize_modules(ModuleInitializationLevel)':
modules/register_module_types.gen.cpp:198:9: error: 'initialize_godex_module' was not declared in this scope; did you mean 'initialize_regex_module'?
  198 |         initialize_godex_module(p_level);
      |         ^~~~~~~~~~~~~~~~~~~~~~~
      |         initialize_regex_module
modules/register_module_types.gen.cpp:201:9: error: 'initialize_bullet_physics_module' was not declared in this scope; did you mean 'initialize_freetype_module'?
  201 |         initialize_bullet_physics_module(p_level);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |         initialize_freetype_module
modules/register_module_types.gen.cpp:204:9: error: 'initialize_godot_module' was not declared in this scope; did you mean 'initialize_mono_module'?
  204 |         initialize_godot_module(p_level);
      |         ^~~~~~~~~~~~~~~~~~~~~~~
      |         initialize_mono_module
modules/register_module_types.gen.cpp: In function 'void uninitialize_modules(ModuleInitializationLevel)':
modules/register_module_types.gen.cpp:349:9: error: 'uninitialize_godex_module' was not declared in this scope; did you mean 'uninitialize_regex_module'?
  349 |         uninitialize_godex_module(p_level);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~
      |         uninitialize_regex_module
modules/register_module_types.gen.cpp:352:9: error: 'uninitialize_bullet_physics_module' was not declared in this scope; did you mean 'uninitialize_freetype_module'?
  352 |         uninitialize_bullet_physics_module(p_level);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |         uninitialize_freetype_module
modules/register_module_types.gen.cpp:355:9: error: 'uninitialize_godot_module' was not declared in this scope; did you mean 'uninitialize_mono_module'?
  355 |         uninitialize_godot_module(p_level);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~
      |         uninitialize_mono_module
[Initial build] scons: *** [modules/register_module_types.gen.linuxbsd.opt.tools.64.o] Error 1

According to issue https://github.com/GodotECS/godex/issues/284 it's only compatible with a certain commit, but that gives me different errors. I'm not sure if I'm missing a step or using the wrong commit.

abramsba commented 2 years ago

Looked at the readme and noticed it should be commit 391633760b0ea292af079287faf79c1aee6d9254, but I'm still receiving errors:

/home/bryan/Repositories/godex/modules/godot/nodes/ecs_world.cpp: In member function 'void WorldECS::sync_3d_transforms()':
/home/bryan/Repositories/godex/modules/godot/nodes/ecs_world.cpp:744:65: error: 'as_const' is not a member of 'std'; did you mean 'is_const'?
  744 |         const Storage<const TransformComponent> *storage = std::as_const(world)->get_storage<const TransformComponent>();
      |                                                                 ^~~~~~~~
      |                                                                 is_const
/home/bryan/Repositories/godex/modules/godot/nodes/ecs_world.cpp:744:94: error: expected primary-expression before 'const'
  744 |         const Storage<const TransformComponent> *storage = std::as_const(world)->get_storage<const TransformComponent>();
      |                                                                                              ^~~~~
[Initial build] Compiling /home/bryan/Repositories/godex/modules/godot/nodes/entity.cpp ...
AndreaCatania commented 2 years ago

The compiler versions is fine, but also the scons command you used seems ok. Just a minor thing I noticed on your scons command: the custom_modules= accept a directory that contains the modules and not a directory to a module.

Try to move godex into a direcotry, maybe call it modules, and change your scons command to this:

scons -j$(nproc) platform=linuxbsd target=release_debug custom_modules="../modules" 
AndreaCatania commented 2 years ago

In addition to the above, can you please try dev=yes? It should enable the verbose mode. Then, can you please paste the full log here?

scons -j$(nproc) platform=linuxbsd target=release_debug custom_modules="../modules" dev=yes

Here to know more about these compiling options https://github.com/godotengine/godot/blob/master/SConstruct#L184-L191

Zundrium commented 1 year ago

Sorry to revive this old issue but the linux builds are still failing. Is there any motivation to get it working again?

Qrt42 commented 1 year ago

I successfully compiled godot (8c729f0f34a92b92a1a8204e1d56b6ad05cfd27b) and the godex fork Beliar83/godex (f919dff8e53f49e6ef9473c3fe3a0098a8d6ee42) on manjaro after applying the fix from Issue 293