nnicandro / emacs-zmq

Emacs bindings to ØMQ
GNU General Public License v2.0
48 stars 17 forks source link

version `GLIBC_2.33' not found on ubuntu #48

Open JonatanSahar opened 4 months ago

JonatanSahar commented 4 months ago

Hi I'm running emacs 29 from ubuntu snap. when trying to run emacs-jupyter's jupyter-run-repl I get

Launching python3 kernel... Starting python3 kernel process...done Launching python3 kernel...done Requesting kernel info... Loading /home/yonatan/.config/emacs/.local/straight/build-29.2/zmq/emacs-zmq (module)... byte-code: Module could not be opened: "/home/yonatan/.config/emacs/.local/straight/build-29.2/zmq/emacs-zmq.so", "/snap/emacs/2372/usr/bin/../../lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/yonatan/.config/emacs/.local/straight/build-29.2/zmq/emacs-zmq.so)"

Do you have any idea how to fix this? Many thanks!

JonatanSahar commented 4 months ago

Adding some details: I've installed the package through package-install and chose to compile the module locally - compilation was successful.

I'm on Ubuntu 23.1 which has GLIBC 2.35:

(base) yonatan@Cassiopeia:~/Documents/projects/vaccines/code$ ldd --version ldd (Ubuntu GLIBC 2.35-0ubuntu3.6) 2.35 Copyright (C) 2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Roland McGrath and Ulrich Drepper.

colormotor commented 3 months ago

Same issue here

ayanamists commented 2 months ago

The problem here is that, if you install emacs with snap, emacs will use libc.so.6 from snap:

❯ ldd /snap/emacs/current/usr/bin/emacs-29.3 | grep libc.so
libc.so.6 => /snap/emacs/current/usr/bin/../../lib/x86_64-linux-gnu/libc.so.6 (0x00007fcbab39a000)

And the version here is 2.31:

❯ strings /snap/emacs/current/lib/x86_64-linux-gnu/libc.so.6 | grep GNU
GNU C Library (Ubuntu GLIBC 2.31-0ubuntu9.14) stable release version 2.31.
Compiled by GNU CC version 9.4.0.

I solved this by removing emacs from snap, and compile emacs by myself.

rvf0068 commented 1 month ago

The problem here is that, if you install emacs with snap, emacs will use libc.so.6 from snap:

❯ ldd /snap/emacs/current/usr/bin/emacs-29.3 | grep libc.so
libc.so.6 => /snap/emacs/current/usr/bin/../../lib/x86_64-linux-gnu/libc.so.6 (0x00007fcbab39a000)

And the version here is 2.31:

❯ strings /snap/emacs/current/lib/x86_64-linux-gnu/libc.so.6 | grep GNU
GNU C Library (Ubuntu GLIBC 2.31-0ubuntu9.14) stable release version 2.31.
Compiled by GNU CC version 9.4.0.

I solved this by removing emacs from snap, and compile emacs by myself.

I am also in Uuntu 20.04 and I did just that (uninstalled the snap version and compiled from source), but I still get the error. I would appreciate some advice.

(pycliques-dev) rafael@dell2:~$ which emacs
/usr/local/bin/emacs
(pycliques-dev) rafael@dell2:~$ ldd /usr/local/bin/emacs | grep libc.so
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f98a5c9a000)
(pycliques-dev) rafael@dell2:~$ strings /lib/x86_64-linux-gnu/libc.so.6 | grep GNU
GNU C Library (Ubuntu GLIBC 2.31-0ubuntu9.15) stable release version 2.31.
Compiled by GNU CC version 9.4.0.
(pycliques-dev) rafael@dell2:~$ ldd --version
ldd (Ubuntu GLIBC 2.31-0ubuntu9.15) 2.31
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

I deleted the emacs-jupyter and zmq folders from the straight\build folder and restarted, so that they are recompiled. Still get this when I try to use jupyter-python in an org-mode block.

Executing Jupyter-Python code block at position 1...
Launching python3 kernel...
Starting python3 kernel process...done
Launching python3 kernel...done
Requesting kernel info...
Loading /home/rafael/emacsen/with-org-noter/straight/build/zmq/emacs-zmq (module)...
zmq-load: Module could not be opened: "/home/rafael/emacsen/with-org-noter/straight/build/zmq/emacs-zmq.so", "/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/rafael/emacsen/with-org-noter/straight/build/zmq/emacs-zmq.so)"
eginhard commented 1 month ago

You need to manually build the emacs-zmq.so library, otherwise Emacs will download one from the Github releases page that might be built with a different GLIBC version than Emacs.

rvf0068 commented 1 month ago

You need to manually build the emacs-zmq.so library, otherwise Emacs will download one from the Github releases page that might be built with a different GLIBC version than Emacs.

Thanks. This is indeed some progress. But with emacs-jupyter up to date I got this issue https://github.com/emacs-jupyter/jupyter/issues/527. I had to downgrade emacs-jupyter to commit 487a755 for this to somehow work.

gmoutso commented 1 day ago

Worth compiling from within the snap emacs. First delete the emacs-zmq.so and run

(let* ((emacs-snap-dir (file-name-as-directory "/snap/emacs/current/"))
       (process-environment (append process-environment `(,(concat "CC=" emacs-snap-dir "usr/bin/gcc-10" )
                                                          ,(concat "CXX=" emacs-snap-dir "usr/bin/g++-10")
                                                          ,(concat "CFLAGS=--sysroot=" emacs-snap-dir)
                              ,(concat "CPPFLAGS=--sysroot=" emacs-snap-dir)
                              ,(concat "LDFLAGS=--sysroot=" emacs-snap-dir " -L" emacs-snap-dir "/usr/lib")))))
  ;; load zmq package
  (when (fboundp 'native-compile-async)
    (progn
      (setq native-comp-deferred-compilation t
            native-comp-deferred-compilation-deny-list '("/mu4e.*\\.el$" "jupyter" "zmq" "eaf" "eaf-mode"
                             "emacs-zmq"))
      (custom-set-variables
       '(native-comp-async-report-warnings-errors 'silent))
      ;; (let ((snap (file-name-as-directory "/snap/emacs/current")))
      ;;    (setq-default native-comp-driver-options (list (concat "--sysroot=" snap)
      ;;                                                  (concat "-B" snap "usr/lib/gcc/"))))
      ))
  (load-library "zmq")) ;; will ask to download (no) and compile (yes). 

From here.