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

Build issue on Ubuntu. (Prevented in-tree built of deps/sdl2_ttf-src) #125

Closed
grigory-bogush opened this issue Jan 10, 2023 · 10 comments
Closed

Comments

@grigory-bogush
Copy link

grigory-bogush commented Jan 10, 2023

For whatever reason the game refuses to build.

cmake -DE3D_BACKEND_OPENGL=1 -DNO_COPY_MODS=1 .
Using OpenGL backend
-- Fetching GLEW...
-- Populating glew
-- Configuring done
-- Generating done
-- Build files have been written to: /home/grigory/Documents/projects/symphony-of-empires/_deps/glew-subbuild
[ 11%] Creating directories for 'glew-populate'
[ 22%] Performing download step (download, verify and extract) for 'glew-populate'
-- Downloading...
   dst='/home/grigory/Documents/projects/symphony-of-empires/_deps/glew-subbuild/glew-populate-prefix/src/glew-2.2.0.zip'
   timeout='none'
   inactivity timeout='none'
-- Using src='https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0.zip'
-- [download 0% complete]
...
-- [download 100% complete]
-- verifying file...
       file='/home/grigory/Documents/projects/symphony-of-empires/_deps/glew-subbuild/glew-populate-prefix/src/glew-2.2.0.zip'
-- Downloading... done
-- extracting...
     src='/home/grigory/Documents/projects/symphony-of-empires/_deps/glew-subbuild/glew-populate-prefix/src/glew-2.2.0.zip'
     dst='/home/grigory/Documents/projects/symphony-of-empires/_deps/glew-src'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 33%] No update step for 'glew-populate'
[ 44%] No patch step for 'glew-populate'
[ 55%] No configure step for 'glew-populate'
[ 66%] No build step for 'glew-populate'
[ 77%] No install step for 'glew-populate'
[ 88%] No test step for 'glew-populate'
[100%] Completed 'glew-populate'
[100%] Built target glew-populate
-- Fetching SDL2...
-- Populating sdl2
-- Configuring done
-- Generating done
-- Build files have been written to: /home/grigory/Documents/projects/symphony-of-empires/_deps/sdl2-subbuild
[ 11%] Creating directories for 'sdl2-populate'
[ 22%] Performing download step (git clone) for 'sdl2-populate'
Cloning into 'sdl2-src'...
HEAD is now at 8c9beb0c8 Updated to version Updated to version 2.24.0 for release
[ 33%] Performing update step for 'sdl2-populate'
[ 44%] No patch step for 'sdl2-populate'
[ 55%] No configure step for 'sdl2-populate'
[ 66%] No build step for 'sdl2-populate'
[ 77%] No install step for 'sdl2-populate'
[ 88%] No test step for 'sdl2-populate'
[100%] Completed 'sdl2-populate'
[100%] Built target sdl2-populate
-- dynamic libasound -> libasound.so.2
-- Checking for module 'jack'
--   No package 'jack' found
-- Checking for module 'libpipewire-0.3>=0.3.20'
--   No package 'libpipewire-0.3' found
-- dynamic libpulse-simple -> libpulse-simple.so.0
-- Checking for module 'esound'
--   No package 'esound' found
-- dynamic libsndio -> libsndio.so.7
-- Checking for modules 'bcm_host;brcmegl'
--   No package 'bcm_host' found
--   No package 'brcmegl' found
-- dynamic libX11 -> libX11.so.6
-- dynamic libXext -> libXext.so.6
-- dynamic libXcursor -> libXcursor.so.1
-- dynamic libXi -> libXi.so.6
-- dynamic libXfixes -> libXfixes.so.3
-- dynamic libXrandr -> libXrandr.so.2
-- dynamic libXrender -> libXrender.so.1
-- dynamic libXss -> libXss.so.1
-- Checking for modules 'libdrm;gbm;egl'
--   No package 'gbm' found
-- dynamic libwayland-client -> libwayland-client.so.0
-- dynamic libwayland-egl -> libwayland-egl.so.1
-- dynamic libwayland-cursor -> libwayland-cursor.so.0
-- dynamic libxkbcommon -> libxkbcommon.so.0
-- Checking for module 'libdecor-0'
--   No package 'libdecor-0' found
-- 
-- SDL2 was configured with the following options:
-- 
-- Platform: Linux-6.0.9-060009-generic
-- 64-bit:   TRUE
-- Compiler: /usr/bin/cc
-- Revision: https://github.com/symphony-of-empires/symphony-of-empires.git@c75153cd8fc6524d6dde70397a1c00460da7a381
-- 
-- Subsystems:
--   Atomic:    ON
--   Audio:     ON
--   Video:     ON
--   Render:    ON
--   Events:    ON
--   Joystick:  ON
--   Haptic:    ON
--   Hidapi:    ON
--   Power:     ON
--   Threads:   ON
--   Timers:    ON
--   File:      ON
--   Loadso:    ON
--   CPUinfo:   ON
--   Filesystem:        ON
--   Sensor:    ON
--   Locale:    ON
--   Misc:      ON
-- 
-- Options:
--   SDL2_DISABLE_INSTALL        (Wanted: ON): OFF
--   SDL2_DISABLE_SDL2MAIN       (Wanted: ON): OFF
--   SDL2_DISABLE_UNINSTALL      (Wanted: ON): OFF
--   SDL_3DNOW                   (Wanted: ON): ON
--   SDL_ALSA                    (Wanted: ON): ON
--   SDL_ALSA_SHARED             (Wanted: ON): ON
--   SDL_ALTIVEC                 (Wanted: ON): OFF
--   SDL_ARMNEON                 (Wanted: OFF): OFF
--   SDL_ARMSIMD                 (Wanted: OFF): OFF
--   SDL_ARTS                    (Wanted: ON): OFF
--   SDL_ARTS_SHARED             (Wanted: ON): OFF
--   SDL_ASAN                    (Wanted: OFF): OFF
--   SDL_ASSEMBLY                (Wanted: ON): ON
--   SDL_ASSERTIONS              (Wanted: auto): auto
--   SDL_BACKGROUNDING_SIGNAL    (Wanted: OFF): OFF
--   SDL_CLOCK_GETTIME           (Wanted: ON): ON
--   SDL_COCOA                   (Wanted: OFF): OFF
--   SDL_DIRECTFB                (Wanted: OFF): OFF
--   SDL_DIRECTFB_SHARED         (Wanted: OFF): OFF
--   SDL_DIRECTX                 (Wanted: OFF): OFF
--   SDL_DISKAUDIO               (Wanted: ON): ON
--   SDL_DUMMYAUDIO              (Wanted: ON): ON
--   SDL_DUMMYVIDEO              (Wanted: ON): ON
--   SDL_ESD                     (Wanted: ON): OFF
--   SDL_ESD_SHARED              (Wanted: ON): OFF
--   SDL_FOREGROUNDING_SIGNAL    (Wanted: OFF): OFF
--   SDL_FUSIONSOUND             (Wanted: OFF): OFF
--   SDL_FUSIONSOUND_SHARED      (Wanted: OFF): OFF
--   SDL_GCC_ATOMICS             (Wanted: ON): ON
--   SDL_HIDAPI                  (Wanted: ON): ON
--   SDL_HIDAPI_JOYSTICK         (Wanted: ON): ON
--   SDL_HIDAPI_LIBUSB           (Wanted: OFF): OFF
--   SDL_INSTALL_TESTS           (Wanted: OFF): OFF
--   SDL_JACK                    (Wanted: ON): OFF
--   SDL_JACK_SHARED             (Wanted: ON): OFF
--   SDL_KMSDRM                  (Wanted: ON): OFF
--   SDL_KMSDRM_SHARED           (Wanted: ON): OFF
--   SDL_LIBC                    (Wanted: ON): ON
--   SDL_LIBSAMPLERATE           (Wanted: ON): OFF
--   SDL_LIBSAMPLERATE_SHARED    (Wanted: ON): OFF
--   SDL_METAL                   (Wanted: OFF): OFF
--   SDL_MMX                     (Wanted: ON): ON
--   SDL_NAS                     (Wanted: ON): OFF
--   SDL_NAS_SHARED              (Wanted: ON): OFF
--   SDL_OFFSCREEN               (Wanted: OFF): OFF
--   SDL_OPENGL                  (Wanted: ON): ON
--   SDL_OPENGLES                (Wanted: ON): ON
--   SDL_OSS                     (Wanted: ON): ON
--   SDL_PIPEWIRE                (Wanted: ON): OFF
--   SDL_PIPEWIRE_SHARED         (Wanted: ON): OFF
--   SDL_PTHREADS                (Wanted: ON): ON
--   SDL_PTHREADS_SEM            (Wanted: ON): ON
--   SDL_PULSEAUDIO              (Wanted: ON): ON
--   SDL_PULSEAUDIO_SHARED       (Wanted: ON): ON
--   SDL_RENDER_D3D              (Wanted: OFF): OFF
--   SDL_RENDER_METAL            (Wanted: OFF): OFF
--   SDL_RPATH                   (Wanted: ON): ON
--   SDL_RPI                     (Wanted: ON): OFF
--   SDL_SNDIO                   (Wanted: ON): ON
--   SDL_SNDIO_SHARED            (Wanted: ON): ON
--   SDL_SSE                     (Wanted: ON): ON
--   SDL_SSE2                    (Wanted: ON): ON
--   SDL_SSE3                    (Wanted: ON): ON
--   SDL_SSEMATH                 (Wanted: ON): ON
--   SDL_STATIC_PIC              (Wanted: OFF): OFF
--   SDL_TESTS                   (Wanted: OFF): OFF
--   SDL_VIRTUAL_JOYSTICK        (Wanted: ON): ON
--   SDL_VIVANTE                 (Wanted: ON): OFF
--   SDL_VULKAN                  (Wanted: ON): ON
--   SDL_WASAPI                  (Wanted: OFF): OFF
--   SDL_WAYLAND                 (Wanted: ON): ON
--   SDL_WAYLAND_LIBDECOR        (Wanted: ON): OFF
--   SDL_WAYLAND_LIBDECOR_SHARED (Wanted: ON): OFF
--   SDL_WAYLAND_QT_TOUCH        (Wanted: ON): ON
--   SDL_WAYLAND_SHARED          (Wanted: ON): ON
--   SDL_X11                     (Wanted: ON): ON
--   SDL_X11_SHARED              (Wanted: ON): ON
--   SDL_X11_XCURSOR             (Wanted: ON): ON
--   SDL_X11_XDBE                (Wanted: ON): ON
--   SDL_X11_XFIXES              (Wanted: ON): ON
--   SDL_X11_XINPUT              (Wanted: ON): ON
--   SDL_X11_XRANDR              (Wanted: ON): ON
--   SDL_X11_XSCRNSAVER          (Wanted: ON): ON
--   SDL_X11_XSHAPE              (Wanted: ON): ON
--   SDL_XINPUT                  (Wanted: OFF): OFF
-- 
--  CMAKE_C_FLAGS_DEBUG:   -g
--  CMAKE_CXX_FLAGS_DEBUG: -g
-- 
--  CFLAGS:         -idirafter "/home/grigory/Documents/projects/symphony-of-empires/_deps/sdl2-src/src/video/khronos" -DHAVE_LINUX_VERSION_H
--  EXTRA_CFLAGS:   -Wall -fno-strict-aliasing -Werror=declaration-after-statement -Wdeclaration-after-statement -fvisibility=hidden -Wshadow -mmmx -m3dnow -msse -msse2 -msse3 -D_REENTRANT -I/usr/include
--  EXTRA_LDFLAGS: -pthread -Wl,--no-undefined
--  EXTRA_LIBS:    m;dl;rt
-- 
--  Build Shared Library: ON
--  Build Static Library: OFF
-- 
-- If something was not detected, although the libraries
-- were installed, then make sure you have set the
-- CFLAGS and LDFLAGS environment variables correctly.
-- 
-- Fetching SDL2 TTF...
-- Populating sdl2_ttf
-- Configuring done
-- Generating done
-- Build files have been written to: /home/grigory/Documents/projects/symphony-of-empires/_deps/sdl2_ttf-subbuild
[ 11%] Creating directories for 'sdl2_ttf-populate'
[ 22%] Performing download step (git clone) for 'sdl2_ttf-populate'
Cloning into 'sdl2_ttf-src'...
HEAD is now at 0a652b5 Updated to version 2.20.1 for release
Submodule 'external/freetype' (https://github.com/libsdl-org/freetype.git) registered for path 'external/freetype'
Submodule 'external/harfbuzz' (https://github.com/libsdl-org/harfbuzz.git) registered for path 'external/harfbuzz'
Cloning into '/home/grigory/Documents/projects/symphony-of-empires/_deps/sdl2_ttf-src/external/freetype'...
Cloning into '/home/grigory/Documents/projects/symphony-of-empires/_deps/sdl2_ttf-src/external/harfbuzz'...
Submodule path 'external/freetype': checked out '6fc77cee03e078e97afcee0c0e06a2d3274b9a29'
Submodule 'dlg' (https://github.com/nyorain/dlg.git) registered for path 'external/freetype/subprojects/dlg'
Cloning into '/home/grigory/Documents/projects/symphony-of-empires/_deps/sdl2_ttf-src/external/freetype/subprojects/dlg'...
Submodule path 'external/freetype/subprojects/dlg': checked out 'd142e646e263c89f93663e027c2f0d03739ab42d'
Submodule path 'external/harfbuzz': checked out '6022fe2f68d028ee178284f297b3902ffdf65b03'
[ 33%] Performing update step for 'sdl2_ttf-populate'
[ 44%] No patch step for 'sdl2_ttf-populate'
[ 55%] No configure step for 'sdl2_ttf-populate'
[ 66%] No build step for 'sdl2_ttf-populate'
[ 77%] No install step for 'sdl2_ttf-populate'
[ 88%] No test step for 'sdl2_ttf-populate'
[100%] Completed 'sdl2_ttf-populate'
[100%] Built target sdl2_ttf-populate
CMake Error at _deps/sdl2_ttf-src/CMakeLists.txt:18 (message):
  Prevented in-tree built.  Please create a build directory outside of the
  SDL_ttf source code and call cmake from there
@wxwisiasdf
Copy link
Contributor

wxwisiasdf commented Jan 10, 2023

Don't build on the root of the source code, do:
mkdir -p build
cd build
cmake -DE3D_BACKEND_OPENGL=1 -DNO_COPY_MODS=1 ..

@grigory-bogush
Copy link
Author

Don't build on the root of the source code, do: mkdir -p build cd build cmake -DE3D_BACKEND_OPENGL=1 -DNO_COPY_MODS=1 ..

Oh, thanks! I see. Could readme be updated perhaps to include this detail?

@wxwisiasdf
Copy link
Contributor

Don't build on the root of the source code, do: mkdir -p build cd build cmake -DE3D_BACKEND_OPENGL=1 -DNO_COPY_MODS=1 ..

Oh, thanks! I see. Could readme be updated perhaps to include this detail?

Sure :)

@grigory-bogush
Copy link
Author

grigory-bogush commented Jan 10, 2023

Now I got an issue compiling a file.
Fixed it by adding #include <array> at the top of symphony-of-empires/eng3d/eng3d/utils.hpp

[ 39%] Building CXX object CMakeFiles/SymphonyOfEmpires.dir/game/src/server/lua_api.cpp.o
In file included from /home/grigory/Documents/projects/symphony-of-empires/game/src/server/lua_api.cpp:33:
/home/grigory/Documents/projects/symphony-of-empires/eng3d/eng3d/utils.hpp: In function ‘constexpr T std::byteswap(T)’:
/home/grigory/Documents/projects/symphony-of-empires/eng3d/eng3d/utils.hpp:49:56: error: ‘array’ is not a member of ‘std’
   49 |         auto value_representation = std::bit_cast<std::array<std::byte, sizeof(T)>>(value);
      |                                                        ^~~~~
/home/grigory/Documents/projects/symphony-of-empires/eng3d/eng3d/utils.hpp:35:1: note: ‘std::array’ is defined in header ‘<array>’; did you forget to ‘#include <array>’?
   34 | #   include <algorithm>
  +++ |+#include <array>
   35 | namespace std {
/home/grigory/Documents/projects/symphony-of-empires/eng3d/eng3d/utils.hpp:49:42: error: parse error in template argument list
   49 |         auto value_representation = std::bit_cast<std::array<std::byte, sizeof(T)>>(value);

@grigory-bogush
Copy link
Author

Another error :(

[ 46%] Built target luac
[ 46%] Building CXX object _deps/tbb-build/src/tbbmalloc/CMakeFiles/tbbmalloc.dir/backend.cpp.o
[ 46%] Building CXX object _deps/tbb-build/src/tbbmalloc/CMakeFiles/tbbmalloc.dir/backref.cpp.o
[ 46%] Building CXX object _deps/tbb-build/src/tbbmalloc/CMakeFiles/tbbmalloc.dir/frontend.cpp.o
[ 46%] Building CXX object _deps/tbb-build/src/tbbmalloc/CMakeFiles/tbbmalloc.dir/large_objects.cpp.o
[ 46%] Building CXX object _deps/tbb-build/src/tbbmalloc/CMakeFiles/tbbmalloc.dir/tbbmalloc.cpp.o
[ 46%] Building CXX object _deps/tbb-build/src/tbbmalloc/CMakeFiles/tbbmalloc.dir/__/tbb/itt_notify.cpp.o
[ 46%] Linking C shared library ../../../../gnu_12.2_cxx20_64_relwithdebinfo/libtbbmalloc.so
[ 46%] Built target tbbmalloc
[ 47%] Building CXX object _deps/tbb-build/src/tbbmalloc_proxy/CMakeFiles/tbbmalloc_proxy.dir/function_replacement.cpp.o
[ 47%] Building CXX object _deps/tbb-build/src/tbbmalloc_proxy/CMakeFiles/tbbmalloc_proxy.dir/proxy.cpp.o
[ 47%] Linking CXX shared library ../../../../gnu_12.2_cxx20_64_relwithdebinfo/libtbbmalloc_proxy.so
[ 47%] Built target tbbmalloc_proxy
[ 47%] Building CXX object _deps/tbb-build/test/CMakeFiles/test_tick_count.dir/tbb/test_tick_count.cpp.o
In file included from /home/grigory/Documents/exp-projects/symphony-of-empires/build/_deps/tbb-src/src/tbb/../../include/oneapi/tbb/concurrent_vector.h:24,
                 from /home/grigory/Documents/exp-projects/symphony-of-empires/build/_deps/tbb-src/src/tbb/../../include/oneapi/tbb/enumerable_thread_specific.h:26,
                 from /home/grigory/Documents/exp-projects/symphony-of-empires/build/_deps/tbb-src/test/common/utils_concurrency_limit.h:25,
                 from /home/grigory/Documents/exp-projects/symphony-of-empires/build/_deps/tbb-src/test/tbb/test_tick_count.cpp:19:
/home/grigory/Documents/exp-projects/symphony-of-empires/build/_deps/tbb-src/src/tbb/../../include/oneapi/tbb/detail/_segment_table.h: In instantiation of ‘tbb::detail::d1::segment_table<T, Allocator, DerivedType, PointersPerEmbeddedTable>::segment_table(const allocator_type&) [with T = tbb::detail::d0::padded<tbb::detail::d1::ets_element<bool>, 128>; Allocator = tbb::detail::d1::cache_aligned_allocator<tbb::detail::d0::padded<tbb::detail::d1::ets_element<bool>, 128> >; DerivedType = tbb::detail::d1::concurrent_vector<tbb::detail::d0::padded<tbb::detail::d1::ets_element<bool>, 128>, tbb::detail::d1::cache_aligned_allocator<tbb::detail::d0::padded<tbb::detail::d1::ets_element<bool>, 128> > >; long unsigned int PointersPerEmbeddedTable = 3; allocator_type = tbb::detail::d1::cache_aligned_allocator<tbb::detail::d0::padded<tbb::detail::d1::ets_element<bool>, 128> >]’:
/home/grigory/Documents/exp-projects/symphony-of-empires/build/_deps/tbb-src/src/tbb/../../include/oneapi/tbb/concurrent_vector.h:284:26:   required from ‘tbb::detail::d1::concurrent_vector<T, Allocator>::concurrent_vector(const allocator_type&) [with T = tbb::detail::d0::padded<tbb::detail::d1::ets_element<bool>, 128>; Allocator = tbb::detail::d1::cache_aligned_allocator<tbb::detail::d0::padded<tbb::detail::d1::ets_element<bool>, 128> >; allocator_type = tbb::detail::d1::cache_aligned_allocator<tbb::detail::d0::padded<tbb::detail::d1::ets_element<bool>, 128> >]’
/home/grigory/Documents/exp-projects/symphony-of-empires/build/_deps/tbb-src/src/tbb/../../include/oneapi/tbb/concurrent_vector.h:281:61:   required from ‘tbb::detail::d1::concurrent_vector<T, Allocator>::concurrent_vector() [with T = tbb::detail::d0::padded<tbb::detail::d1::ets_element<bool>, 128>; Allocator = tbb::detail::d1::cache_aligned_allocator<tbb::detail::d0::padded<tbb::detail::d1::ets_element<bool>, 128> >]’
/home/grigory/Documents/exp-projects/symphony-of-empires/build/_deps/tbb-src/src/tbb/../../include/oneapi/tbb/enumerable_thread_specific.h:843:5:   required from ‘tbb::detail::d1::enumerable_thread_specific<T, Allocator, ETS_key_type>::enumerable_thread_specific() [with T = bool; Allocator = tbb::detail::d1::cache_aligned_allocator<bool>; tbb::detail::d1::ets_key_usage_type ETS_key_type = tbb::detail::d1::ets_no_key]’
/home/grigory/Documents/exp-projects/symphony-of-empires/build/_deps/tbb-src/test/common/utils_concurrency_limit.h:247:92:   required from here
/home/grigory/Documents/exp-projects/symphony-of-empires/build/_deps/tbb-src/src/tbb/../../include/oneapi/tbb/detail/_segment_table.h:63:63: error: member ‘tbb::detail::d1::segment_table<tbb::detail::d0::padded<tbb::detail::d1::ets_element<bool>, 128>, tbb::detail::d1::cache_aligned_allocator<tbb::detail::d0::padded<tbb::detail::d1::ets_element<bool>, 128> >, tbb::detail::d1::concurrent_vector<tbb::detail::d0::padded<tbb::detail::d1::ets_element<bool>, 128>, tbb::detail::d1::cache_aligned_allocator<tbb::detail::d0::padded<tbb::detail::d1::ets_element<bool>, 128> > >, 3>::my_embedded_table’ is used uninitialized [-Werror=uninitialized]
   63 |         : my_segment_table_allocator(alloc), my_segment_table(my_embedded_table)
      |                                                               ^~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
cc1plus: all warnings being treated as errors
make[2]: *** [_deps/tbb-build/test/CMakeFiles/test_tick_count.dir/build.make:76: _deps/tbb-build/test/CMakeFiles/test_tick_count.dir/tbb/test_tick_count.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1367: _deps/tbb-build/test/CMakeFiles/test_tick_count.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

@grigory-bogush
Copy link
Author

Perhaps I have a different compiler version or some of the depenencies?

@wxwisiasdf
Copy link
Contributor

Perhaps I have a different compiler version or some of the depenencies?

-Werror is enabled, -Werror shouldn't be enabled hmm

@wxwisiasdf
Copy link
Contributor

Perhaps I have a different compiler version or some of the depenencies?

The solution seems to be to use gcc-10, aka cmake -DCMAKE_C_COMPILER="gcc-10"

source: oneapi-src/oneTBB#370

@grigory-bogush
Copy link
Author

Thanks. It appears that downgrading gcc and g++ to 10 worked for me

@wxwisiasdf
Copy link
Contributor

Good that it's solved now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants