Zulip Chat Archive

Stream: lean4

Topic: Lake: linking SDL2 woes


Siddharth Bhat (Mar 23 2023 at 15:41):

I'm building SDL + OpenGL bindings for Lean4. In doing so, I'm trying to debug a lake build failure, but it seems like lake build --verbose prints unrelated info?

master ~/papers/sdl> lake build
Compiling SDLffi.c
error: > cc -c -o ./build/lib/libSDLffi.o SDLffi.c -I /home/bollu/.elan/toolchains/leanprover--lean4---nightly-2023-03-17/include -I ./SDL/include -fPIC
error: stderr:
gcc: warning: : linker input file unused because linking not done
gcc: error: : linker input file not found: No such file or directory
error: external command `cc` exited with code 1
master ~/papers/sdl> lake build --verbose
Compiling SDLffi.c
error: > cc -c -o ./build/lib/libSDLffi.o SDLffi.c -I /home/bollu/.elan/toolchains/leanprover--lean4---nightly-2023-03-17/include -I ./SDL/include -fPIC
error: stderr:
gcc: warning: : linker input file unused because linking not done
gcc: error: : linker input file not found: No such file or directory
error: external command `cc` exited with code 1
> cmake ../ -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DSDL_STATIC=ON    # in directory ./SDL/build
stdout:
-- Could NOT find ALSA (missing: ALSA_LIBRARY ALSA_INCLUDE_DIR)
-- Checking for module 'jack'
--   No package 'jack' found
-- Checking for module 'libpipewire-0.3>=0.3.20'
--   No package 'libpipewire-0.3' found
-- Checking for module 'libpulse-simple'
--   No package 'libpulse-simple' found
-- Checking for module 'sndio'
--   No package 'sndio' found
-- Checking for modules 'bcm_host;brcmegl'
--   No package 'bcm_host' found
--   No package 'brcmegl' found
-- Checking for module 'mali'
--   No package 'mali' found
-- Checking for module 'egl'
--   No package 'egl' found
-- Checking for modules 'libdrm;gbm;egl'
--   No package 'libdrm' found
--   No package 'gbm' found
--   No package 'egl' found
-- Checking for modules 'wayland-client>=1.18;wayland-egl;wayland-cursor;egl;xkbcommon>=0.5.0'
--   No package 'wayland-client' found
--   No package 'wayland-egl' found
--   No package 'wayland-cursor' found
--   No package 'egl' found
--   No package 'xkbcommon' found
-- Checking for one of the modules 'dbus-1;dbus'
-- Checking for one of the modules 'ibus-1.0;ibus'
--
-- SDL3 was configured with the following options:
--
-- Platform: Linux-5.15.96
-- 64-bit:   TRUE
-- Compiler: /run/current-system/sw/bin/cc
-- Revision: SDL-prerelease-3.0.0-1297-g0ef85873a
--
-- 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:
--   SDL_ALSA                    (Wanted: ON): OFF
--   SDL_ALSA_SHARED             (Wanted: ON): OFF
--   SDL_ALTIVEC                 (Wanted: OFF): OFF
--   SDL_ARMNEON                 (Wanted: OFF): OFF
--   SDL_ARMSIMD                 (Wanted: OFF): OFF
--   SDL_ASAN                    (Wanted: OFF): OFF
--   SDL_ASSEMBLY                (Wanted: ON): ON
--   SDL_ASSERTIONS              (Wanted: auto): auto
--   SDL_AVX                     (Wanted: ON): ON
--   SDL_AVX2                    (Wanted: ON): ON
--   SDL_AVX512                  (Wanted: ON): OFF
--   SDL_BACKGROUNDING_SIGNAL    (Wanted: OFF): OFF
--   SDL_CCACHE                  (Wanted: OFF): OFF
--   SDL_CLANG_TIDY              (Wanted: OFF): OFF
--   SDL_CLOCK_GETTIME           (Wanted: ON): ON
--   SDL_COCOA                   (Wanted: OFF): OFF
--   SDL_DBUS                    (Wanted: ON): OFF
--   SDL_DIRECTX                 (Wanted: OFF): OFF
--   SDL_DISABLE_INSTALL         (Wanted: OFF): OFF
--   SDL_DISABLE_UNINSTALL       (Wanted: OFF): OFF
--   SDL_DISKAUDIO               (Wanted: ON): ON
--   SDL_DUMMYAUDIO              (Wanted: ON): ON
--   SDL_DUMMYVIDEO              (Wanted: ON): ON
--   SDL_FOREGROUNDING_SIGNAL    (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_IBUS                    (Wanted: ON): 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_LASX                    (Wanted: OFF): OFF
--   SDL_LIBC                    (Wanted: ON): ON
--   SDL_LIBSAMPLERATE           (Wanted: ON): OFF
--   SDL_LIBSAMPLERATE_SHARED    (Wanted: ON): OFF
--   SDL_LIBUDEV                 (Wanted: ON): OFF
--   SDL_LSX                     (Wanted: OFF): OFF
--   SDL_METAL                   (Wanted: OFF): OFF
--   SDL_MMX                     (Wanted: ON): ON
--   SDL_OFFSCREEN               (Wanted: ON): OFF
--   SDL_OPENGL                  (Wanted: ON): OFF
--   SDL_OPENGLES                (Wanted: ON): OFF
--   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): OFF
--   SDL_PULSEAUDIO_SHARED       (Wanted: ON): OFF
--   SDL_RENDER_D3D              (Wanted: OFF): OFF
--   SDL_RENDER_METAL            (Wanted: OFF): OFF
--   SDL_ROCKCHIP                (Wanted: ON): OFF
--   SDL_RPATH                   (Wanted: ON): ON
--   SDL_RPI                     (Wanted: ON): OFF
--   SDL_SNDIO                   (Wanted: ON): OFF
--   SDL_SNDIO_SHARED            (Wanted: ON): OFF
--   SDL_SSE                     (Wanted: ON): ON
--   SDL_SSE2                    (Wanted: ON): ON
--   SDL_SSE3                    (Wanted: ON): ON
--   SDL_SSE4_1                  (Wanted: ON): ON
--   SDL_SSE4_2                  (Wanted: ON): ON
--   SDL_STATIC_PIC              (Wanted: ON): ON
--   SDL_SYSTEM_ICONV            (Wanted: ON): ON
--   SDL_TESTS                   (Wanted: OFF): OFF
--   SDL_VENDOR_INFO             (Wanted: ): 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): OFF
--   SDL_WAYLAND_LIBDECOR        (Wanted: ON): OFF
--   SDL_WAYLAND_LIBDECOR_SHARED (Wanted: ON): OFF
--   SDL_WAYLAND_QT_TOUCH        (Wanted: ON): OFF
--   SDL_WAYLAND_SHARED          (Wanted: ON): OFF
--   SDL_X11                     (Wanted: ON): OFF
--   SDL_X11_SHARED              (Wanted: ON): OFF
--   SDL_X11_XCURSOR             (Wanted: ON): OFF
--   SDL_X11_XDBE                (Wanted: ON): OFF
--   SDL_X11_XFIXES              (Wanted: ON): OFF
--   SDL_X11_XINPUT              (Wanted: ON): OFF
--   SDL_X11_XRANDR              (Wanted: ON): OFF
--   SDL_X11_XSCRNSAVER          (Wanted: ON): OFF
--   SDL_X11_XSHAPE              (Wanted: ON): OFF
--   SDL_XINPUT                  (Wanted: OFF): OFF
--
--  CMAKE_C_FLAGS:
--  EXTRA DEFS:    -DUSING_GENERATED_CONFIG_H -DMESA_EGL_NO_X11_HEADERS -DEGL_NO_X11
--  EXTRA CFLAGS:  -D_REENTRANT -idirafter "/home/bollu/papers/sdl/SDL/src/video/khronos" -Wall -fno-strict-aliasing $<$<COMPILE_LANGUAGE:C>:-Wdeclaration-after-statement> -Wshadow
--  EXTRA INCDIRS: -I/home/bollu/papers/sdl/SDL/build/include-config-$<LOWER_CASE:$<CONFIG>> -I/home/bollu/papers/sdl/SDL/build/include -I/home/bollu/papers/sdl/SDL/include
--  EXTRA LDFLAGS: -Wl,--version-script=/home/bollu/papers/sdl/SDL/src/dynapi/SDL_dynapi.sym -Wl,--no-undefined -pthread
--  EXTRA LIBS:    m
--
--  Build Shared Library: ON
--  Build Static Library: ON
--  Build Static Library with Position Independent Code: ON
--
-- If something was not detected, although the libraries
-- were installed, then make sure you have set the
-- CFLAGS and LDFLAGS environment variables correctly.
--
-- Configuring done
-- Generating done
-- Build files have been written to: /home/bollu/papers/sdl/SDL/build
> cmake --build .    # in directory ./SDL/build
stdout:
Consolidate compiler generated dependencies of target SDL3-shared
[ 48%] Built target SDL3-shared
Consolidate compiler generated dependencies of target SDL3-static
[ 96%] Built target SDL3-static
Consolidate compiler generated dependencies of target SDL3_test
[100%] Built target SDL3_test
[100%] Built target SDL3_docs
exit 1

Naveen (Mar 23 2023 at 16:11):

Hi, I think most likely you're missing "alsa-tools". You can run apt list alsa-tools to check if it's installed.

Siddharth Bhat (Mar 23 2023 at 18:25):

I am more concerned about the fact that lake build and lake build --verbose fail in different ways. It is unclear to me what is failing, since the command cmake --build run from the directory SDL/build actually succeeds

Anders Christiansen Sørby (Mar 23 2023 at 19:03):

I have made a library binding for SDL2 already if you are interested https://github.com/Anderssorby/SDL.lean

Gabriel Ebner (Mar 23 2023 at 19:38):

Siddharth Bhat said:

I am more concerned about the fact that lake build and lake build --verbose fail in different ways. It is unclear to me what is failing, since the command cmake --build run from the directory SDL/build actually succeeds

I don't think they're failing in different ways. The cmake presumably succeeds without --verbose as well, Lake just doesn't print it.

Siddharth Bhat (Mar 23 2023 at 20:10):

Perfect, thakns!


Last updated: Dec 20 2023 at 11:08 UTC