Skip to content

kernel won't start / undefined symbol: zmq_msg_init #22

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

Open
tttaaannnggg opened this issue Jul 9, 2020 · 2 comments
Open

kernel won't start / undefined symbol: zmq_msg_init #22

tttaaannnggg opened this issue Jul 9, 2020 · 2 comments

Comments

@tttaaannnggg
Copy link

(my environment is Ubuntu via WSL 2 )

So far, I haven't been able to locally install the mit-scheme kernel. I've successfully installed MIT Scheme from source, ZeroMQ, and this repo, but when I run the last step of

jupyter console --kernel mit-scheme

I get the following:

;The primitive dld-load-file, while executing the dlopen system call, received the error: /usr/local/lib/mit-scheme-x86-64/zmq-shim.so: undefined symbol: zmq_msg_init.
;To continue, call RESTART with an option number:
; (RESTART 1) => Return to read-eval-print level 1.

2 error>
End of input stream reached.
@tttaaannnggg tttaaannnggg changed the title undefined symbol: zmq_msg_init kernel won't start / undefined symbol: zmq_msg_init Jul 9, 2020
@ivanberry
Copy link

I also get this problem, Did u fix it?

@githubdudu
Copy link

githubdudu commented Jul 15, 2023

I got the same problem and I fixed in this way.
(my env: WSL2 - Ubuntu 18.04)

  1. Run sudo apt install pkg-config
  2. Do this again
$ git clone https://github.com/joeltg/mit-scheme-kernel
$ cd mit-scheme-kernel
$ make
$ sudo make install

Why and what happened?

I examine the step make carefully, and found /bin/sh: 1: pkg-config: not found

echo '(generate-shim "zmq" "#include <zmq.h>")' | /usr/local/bin/mit-scheme --batch-mode
;Including zmq.cdecl... done
;Generating "zmq-shim.c"...
;Warning: Unknown type: zmq_timer_fn
;... done
;Generating "zmq-const.c"... done
;Dumping "zmq-types.bin"... done
cc -I/usr/local/lib/mit-scheme-x86-64 -Wall -fPIC `pkg-config --cflags libzmq` -o zmq-shim.o -c zmq-shim.c
/bin/sh: 1: pkg-config: not found
cc -shared -fPIC -o zmq-shim.so zmq-shim.o `pkg-config --libs libzmq`
/bin/sh: 1: pkg-config: not found
cc `pkg-config --cflags libzmq`  -o zmq-const.o -c zmq-const.c
/bin/sh: 1: pkg-config: not found
cc  -o zmq-const zmq-const.o  `pkg-config --libs libzmq`
/bin/sh: 1: pkg-config: not found
./zmq-const
echo '(sf "zmq-const")' | /usr/local/bin/mit-scheme --batch-mode
;Generating SCode for file: "zmq-const.scm" => "zmq-const.bin"... done

zmq_msg_init is a function in Zeromq. The error "undefined symbol: zmq_msg_init" implies that zeromq may not link to the binary file successfully when compiling. Ref: https://stackoverflow.com/questions/21381993/makefile-issue-linking-zeromq-libs-on-linux.
The makefile use the flag pkg-config to help link the libzmq, see http://wiki.zeromq.org/bindings:c.
How to fix the pkg-config: not found issue, just install pkg-config : https://stackoverflow.com/questions/21381993/makefile-issue-linking-zeromq-libs-on-linux.

After fix the mit-scheme kernel launched. So please check your log carefully, here is a no error log for your reference:

echo '(generate-shim "zmq" "#include <zmq.h>")' | /usr/local/bin/mit-scheme --batch-mode
;Including zmq.cdecl... done
;Generating "zmq-shim.c"...
;Warning: Unknown type: zmq_timer_fn
;... done
;Generating "zmq-const.c"... done
;Dumping "zmq-types.bin"... done
cc -I/usr/local/lib/mit-scheme-x86-64 -Wall -fPIC `pkg-config --cflags libzmq` -o zmq-shim.o -c zmq-shim.c
cc -shared -fPIC -o zmq-shim.so zmq-shim.o `pkg-config --libs libzmq`
cc `pkg-config --cflags libzmq`  -o zmq-const.o -c zmq-const.c
cc  -o zmq-const zmq-const.o  `pkg-config --libs libzmq`
./zmq-const
echo '(sf "zmq-const")' | /usr/local/bin/mit-scheme --batch-mode
;Generating SCode for file: "zmq-const.scm" => "zmq-const.bin"... done

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

3 participants