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

Meson support #2807

Closed
QWERTIOX opened this issue Nov 16, 2024 · 2 comments
Closed

Meson support #2807

QWERTIOX opened this issue Nov 16, 2024 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request nonfix closed without a successful fix (invalid, wontfix)

Comments

@QWERTIOX
Copy link

QWERTIOX commented Nov 16, 2024

Hi, i trying to add meson support QWERTIOX@87df127 so i can add it to wrapdb but i get weird linking errors

I'm confused how even cmake based builds see these functions from different translation units without including headers. My configuration:

The Meson build system
Version: 1.6.0
Source dir: /home/qwertiox/Projects/notcurses
Build dir: /home/qwertiox/Projects/notcurses/builddir
Build type: native build
Project name: notcurses
Project version: 3.0.11
C compiler for the host machine: ccache clang-18 (clang 18.1.8 "Debian clang version 18.1.8 (++20240731024826+3b5b5c1ec4a3-1~exp1~20240731144843.145)")
C linker for the host machine: clang-18 ld.mold 1.10.1
C++ compiler for the host machine: ccache clang++-18 (clang 18.1.8 "Debian clang version 18.1.8 (++20240731024826+3b5b5c1ec4a3-1~exp1~20240731144843.145)")
C++ linker for the host machine: clang++-18 ld.mold 1.10.1
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: YES (/usr/bin/pkg-config) 1.8.1
Run-time dependency curses found: YES 6.4.20221231
Library unistring found: YES
Build targets in project: 2

notcurses 3.0.11

  User defined options
    Native files: ccache-clang-mold.ini

Found ninja-1.11.1 at /usr/bin/ninja

And linker errors:

INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/bin/ninja -C /home/qwertiox/Projects/notcurses/builddir
ninja: Entering directory `/home/qwertiox/Projects/notcurses/builddir'
[38/40] Linking target libnotcurses.so
FAILED: libnotcurses.so 
clang-18  -o libnotcurses.so libnotcurses.so.p/src_lib_gpm.c.o libnotcurses.so.p/src_lib_in.c.o libnotcurses.so.p/src_lib_kitty.c.o libnotcurses.so.p/src_lib_layout.c.o libnotcurses.so.p/src_lib_linux.c.o libnotcurses.so.p/src_lib_menu.c.o libnotcurses.so.p/src_lib_metric.c.o libnotcurses.so.p/src_lib_mice.c.o libnotcurses.so.p/src_lib_notcurses.c.o libnotcurses.so.p/src_lib_plot.c.o libnotcurses.so.p/src_lib_progbar.c.o libnotcurses.so.p/src_lib_reader.c.o libnotcurses.so.p/src_lib_reel.c.o libnotcurses.so.p/src_lib_render.c.o libnotcurses.so.p/src_lib_selector.c.o libnotcurses.so.p/src_lib_sixel.c.o libnotcurses.so.p/src_lib_sprite.c.o libnotcurses.so.p/src_lib_stats.c.o libnotcurses.so.p/src_lib_tabbed.c.o libnotcurses.so.p/src_lib_termdesc.c.o libnotcurses.so.p/src_lib_tree.c.o libnotcurses.so.p/src_lib_unixsig.c.o libnotcurses.so.p/src_lib_util.c.o libnotcurses.so.p/src_lib_visual.c.o libnotcurses.so.p/src_lib_windows.c.o -Wl,--as-needed -Wl,--no-undefined -fuse-ld=mold -shared -fPIC -Wl,-soname,libnotcurses.so -Wl,--start-group /usr/lib/x86_64-linux-gnu/libncursesw.so /usr/lib/x86_64-linux-gnu/libtinfo.so -lunistring -Wl,--end-group
mold: error: undefined symbol: lookup_blitset
>>> referenced by plot.c
>>>               libnotcurses.so.p/src_lib_plot.c.o:(create_uint64_t)>>> referenced by plot.c
>>>               libnotcurses.so.p/src_lib_plot.c.o:(create_double)>>> referenced by notcurses.c
>>>               libnotcurses.so.p/src_lib_notcurses.c.o:(ncplane_as_rgba_internal)>>> referenced 1 more times

mold: error: undefined symbol: set_fd_nonblocking
>>> referenced by in.c
>>>               libnotcurses.so.p/src_lib_in.c.o:(create_inputctx)>>> referenced by in.c
>>>               libnotcurses.so.p/src_lib_in.c.o:(stop_inputlayer)
mold: error: undefined symbol: fesetround
>>> referenced by metric.c
>>>               libnotcurses.so.p/src_lib_metric.c.o:(ncnmetric)
mold: error: undefined symbol: deflateBound
>>> referenced by kitty.c
>>>               libnotcurses.so.p/src_lib_kitty.c.o:(deflate_buf)
mold: error: undefined symbol: deflate
>>> referenced by kitty.c
>>>               libnotcurses.so.p/src_lib_kitty.c.o:(deflate_buf)
mold: error: undefined symbol: get_tty_fd
>>> referenced by in.c
>>>               libnotcurses.so.p/src_lib_in.c.o:(create_inputctx)>>> referenced by termdesc.c
>>>               libnotcurses.so.p/src_lib_termdesc.c.o:(interrogate_terminfo)
mold: error: undefined symbol: round
>>> referenced by sixel.c
>>>               libnotcurses.so.p/src_lib_sixel.c.o:(ss)>>> referenced by visual.c
>>>               libnotcurses.so.p/src_lib_visual.c.o:(rotate_point)>>> referenced by visual.c
>>>               libnotcurses.so.p/src_lib_visual.c.o:(rotate_point)
mold: error: undefined symbol: log
>>> referenced by plot.c
>>>               libnotcurses.so.p/src_lib_plot.c.o:(redraw_plot_uint64_t)>>> referenced by plot.c
>>>               libnotcurses.so.p/src_lib_plot.c.o:(redraw_plot_uint64_t)>>> referenced by plot.c
>>>               libnotcurses.so.p/src_lib_plot.c.o:(redraw_plot_uint64_t)>>> referenced 13 more times

mold: error: undefined symbol: inputctx_add_cflow
>>> referenced by in.c
>>>               libnotcurses.so.p/src_lib_in.c.o:(build_cflow_automaton)>>> referenced by in.c
>>>               libnotcurses.so.p/src_lib_in.c.o:(build_cflow_automaton)>>> referenced by in.c
>>>               libnotcurses.so.p/src_lib_in.c.o:(build_cflow_automaton)>>> referenced 1 more times

mold: error: undefined symbol: sin
>>> referenced by visual.c
>>>               libnotcurses.so.p/src_lib_visual.c.o:(ncvisual_rotate)
mold: error: undefined symbol: pthread_condmonotonic_init
>>> referenced by in.c
>>>               libnotcurses.so.p/src_lib_in.c.o:(create_inputctx)>>> referenced by in.c
>>>               libnotcurses.so.p/src_lib_in.c.o:(create_inputctx)
mold: error: undefined symbol: deflateEnd
>>> referenced by kitty.c
>>>               libnotcurses.so.p/src_lib_kitty.c.o:(deflate_buf)>>> referenced by kitty.c
>>>               libnotcurses.so.p/src_lib_kitty.c.o:(deflate_buf)>>> referenced by kitty.c
>>>               libnotcurses.so.p/src_lib_kitty.c.o:(deflate_buf)
mold: error: undefined symbol: loglevel
>>> referenced by menu.c
>>>               libnotcurses.so.p/src_lib_menu.c.o:(ncmenu_create)>>> referenced by render.c
>>>               libnotcurses.so.p/src_lib_render.c.o:(nccell_duplicate)>>> referenced by menu.c
>>>               libnotcurses.so.p/src_lib_menu.c.o:(ncmenu_create)>>> referenced 494 more times

mold: error: undefined symbol: walk_automaton
>>> referenced by in.c
>>>               libnotcurses.so.p/src_lib_in.c.o:(process_escape)
mold: error: undefined symbol: ncplane_gradient2x1
>>> referenced by progbar.c
>>>               libnotcurses.so.p/src_lib_progbar.c.o:(progbar_redraw)
mold: error: undefined symbol: inputctx_add_input_escape
>>> referenced by in.c
>>>               libnotcurses.so.p/src_lib_in.c.o:(prep_special_keys)>>> referenced by in.c
>>>               libnotcurses.so.p/src_lib_in.c.o:(prep_special_keys)>>> referenced by in.c
>>>               libnotcurses.so.p/src_lib_in.c.o:(prep_windows_special_keys)>>> referenced 2 more times

mold: error: undefined symbol: set_pixel_blitter
>>> referenced by termdesc.c
>>>               libnotcurses.so.p/src_lib_termdesc.c.o:(setup_sixel_bitmaps)>>> referenced by termdesc.c
>>>               libnotcurses.so.p/src_lib_termdesc.c.o:(setup_kitty_bitmaps)>>> referenced by termdesc.c
>>>               libnotcurses.so.p/src_lib_termdesc.c.o:(setup_kitty_bitmaps)>>> referenced 2 more times

mold: error: undefined symbol: pow
>>> referenced by plot.c
>>>               libnotcurses.so.p/src_lib_plot.c.o:(redraw_plot_uint64_t)>>> referenced by plot.c
>>>               libnotcurses.so.p/src_lib_plot.c.o:(redraw_plot_uint64_t)>>> referenced by plot.c
>>>               libnotcurses.so.p/src_lib_plot.c.o:(redraw_plot_uint64_t)>>> referenced 9 more times

mold: error: undefined symbol: init_banner
>>> referenced by notcurses.c
>>>               libnotcurses.so.p/src_lib_notcurses.c.o:(notcurses_core_init)
mold: error: undefined symbol: input_free_esctrie
>>> referenced by in.c
>>>               libnotcurses.so.p/src_lib_in.c.o:(create_inputctx)>>> referenced by in.c
>>>               libnotcurses.so.p/src_lib_in.c.o:(free_inputctx)
mold: error: undefined symbol: cos
>>> referenced by visual.c
>>>               libnotcurses.so.p/src_lib_visual.c.o:(ncvisual_rotate)
mold: error: undefined symbol: ncplane_gradient
>>> referenced by progbar.c
>>>               libnotcurses.so.p/src_lib_progbar.c.o:(progbar_redraw)
mold: error: undefined symbol: deflateInit_
>>> referenced by kitty.c
>>>               libnotcurses.so.p/src_lib_kitty.c.o:(deflate_buf)
clang-18: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
@QWERTIOX QWERTIOX added documentation Improvements or additions to documentation enhancement New feature or request labels Nov 16, 2024
@dankamongmen
Copy link
Owner

i'm not sure what your question is? i'm sorry, but i know very little about meson.

@dankamongmen
Copy link
Owner

dankamongmen commented Dec 28, 2024

so this is the command that's blowing up:

clang-18  -o libnotcurses.so libnotcurses.so.p/src_lib_gpm.c.o libnotcurses.so.p/src_lib_in.c.o libnotcurses.so.p/src_lib_kitty.c.o libnotcurses.so.p/src_lib_layout.c.o libnotcurses.so.p/src_lib_linux.c.o libnotcurses.so.p/src_lib_menu.c.o libnotcurses.so.p/src_lib_metric.c.o libnotcurses.so.p/src_lib_mice.c.o libnotcurses.so.p/src_lib_notcurses.c.o libnotcurses.so.p/src_lib_plot.c.o libnotcurses.so.p/src_lib_progbar.c.o libnotcurses.so.p/src_lib_reader.c.o libnotcurses.so.p/src_lib_reel.c.o libnotcurses.so.p/src_lib_render.c.o libnotcurses.so.p/src_lib_selector.c.o libnotcurses.so.p/src_lib_sixel.c.o libnotcurses.so.p/src_lib_sprite.c.o libnotcurses.so.p/src_lib_stats.c.o libnotcurses.so.p/src_lib_tabbed.c.o libnotcurses.so.p/src_lib_termdesc.c.o libnotcurses.so.p/src_lib_tree.c.o libnotcurses.so.p/src_lib_unixsig.c.o libnotcurses.so.p/src_lib_util.c.o libnotcurses.so.p/src_lib_visual.c.o libnotcurses.so.p/src_lib_windows.c.o -Wl,--as-needed -Wl,--no-undefined -fuse-ld=mold -shared -fPIC -Wl,-soname,libnotcurses.so -Wl,--start

it looks like you're trying to compile notcurses in your own way? i don't understand why this is necessary: a meson project can just link against the prebuilt notcurses, no?

mold: error: undefined symbol: pow
>>> referenced by plot.c
>>>               libnotcurses.so.p/src_lib_plot.c.o:(redraw_plot_uint64_t)>>> referenced by plot.c
>>>               libnotcurses.so.p/src_lib_plot.c.o:(redraw_plot_uint64_t)>>> referenced by plot.c
>>>               libnotcurses.so.p/src_lib_plot.c.o:(redraw_plot_uint64_t)>>> referenced 9 more times

this probably needs -lm, but again, why are you trying to compile it using a non-standard means? is cmake unavailable to you? i'm going to close this, but feel free to ask further questions.

@dankamongmen dankamongmen self-assigned this Dec 28, 2024
@dankamongmen dankamongmen added the nonfix closed without a successful fix (invalid, wontfix) label Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request nonfix closed without a successful fix (invalid, wontfix)
Projects
None yet
Development

No branches or pull requests

2 participants