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

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

Open
JonatanSahar opened this issue Feb 22, 2024 · 10 comments
Open

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

JonatanSahar opened this issue Feb 22, 2024 · 10 comments

Comments

@JonatanSahar
Copy link

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
Copy link
Author

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
Copy link

Same issue here

@ayanamists
Copy link

ayanamists commented Apr 26, 2024

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
Copy link

rvf0068 commented May 16, 2024

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
Copy link

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
Copy link

rvf0068 commented May 16, 2024

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 emacs-jupyter/jupyter#527. I had to downgrade emacs-jupyter to commit 487a755 for this to somehow work.

@gmoutso
Copy link

gmoutso commented Jul 4, 2024

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.

@ed9w2in6
Copy link

ed9w2in6 commented Jul 9, 2024

@eginhard (and everyone else on this ticket):

My seeming unrelated issue: #45 (comment)
is in fact sharing the same cause - installation of binaries without confirmation of environment.

When it goes well (happy path), emacs-zmq works like magic. However, when these hidden environment assumptions are NOT matched, the cryptic error messages are confusing to any users that are not used to library linking mechanisms.

So a true fix to this issue and #45 is either:
a. Keep current logic BUT make a clear warning message (e.g. open on help buffer) about such assumptions before downloading
b. Stop delivering any binaries, and rely on self-compilation

@nicolasshu
Copy link

@ayanamists I too compiled emacs myself. Worked like a charm. What @ayanamists said was precisely correct for my system when using snap emacs.

For compiling it yourself,

@hute37
Copy link

hute37 commented Aug 26, 2024

emacs snap on ubuntu 22.04: GLIBC snap 2.31 vs OS GLIBC 2.35.

(pyenv/poetry + pyright/lsp python setup)

Same problem.
I wan't able to solve with the proposed elisp code, but I could make it run in a manually way...

First, You need an absolutely clean package version under your ~/.emacs.d/elpa/zmq-*
The best way is to use list-packages to uninstall zmq and jupyter packages

Then, with list-packages, intall only zmq package, without loading the library

After install, open a vterm and change directory to ~/.emacs.d/elpa/zmq-*

Then configure compiler environment, and build:

cd ~/.emacs.d/elpa

ls -lda zmq*
cd      zmq*


ES=${EMACS_SNAP_DIR:-/snap/emacs/current}
export CC=${ES}/usr/bin/gcc-10
export CXX=${ES}/usr/bin/g++-10
export CFLAGS=--sysroot=${ES}
export LDFLAGS="--sysroot=${ES} -L${ES}/usr/lib"

printenv | grep -i -e ^cc= -e ^cxx= -e ^cflags= -e ^ldflags=
ls -l $CC $CXX

make all

alter library build, exit vterm and install jupyter package

after a restart, jupyter started to work

In the screenshot, my use-package failing tentative

site-pkgs org - GNU Emacs at xt-si701-v01_070

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

9 participants