4

I am working some lisp code on sbcl in order to run function in mode daemon. The problem is when I use the function sb-thred:make-thread, for instance as follow:

(sb-thread:make-thread (lambda () (progn (sleep 1) (when t (print "background action")))))

I get the following error message:

Not supported in unithread builds. [Condition of type SIMPLE-ERROR]

What is wrong ? ... thanks for help.

yannics
  • 179
  • 10
  • 4
    It looks like your SBCL was built without multi-threading support. Are you running MacOS X? If so, [this article](http://haminhvuong.tumblr.com/post/22109095116/compile-sbcl-with-multi-thread-enabled-on-os-x) may help you. – Frédéric Hamidi Jan 22 '14 at 16:25
  • I don't know enough about MacPorts to tell you, but it looks like a source-based package manager, so building from source should be part of the process, and you only have to find out how to specify options for the build. For what it's worth, the Linux distribution I use (Gentoo) is based on the same principle, and I can make SBCL multi-threaded by setting the `threads` USE flag. – Frédéric Hamidi Jan 22 '14 at 20:15
  • It sounds like you are right about that. I am running Mac OS X mavericks. I have used macports to install sbcl (version 1.1.14). What should I do. Maybe I have to remove sbcl with macports (???), then install sbcl "manually" like explained in your link ? ... I hope it exists another way to do it ... – yannics Jan 22 '14 at 20:41
  • OK. I try to find out and I will keep you informed. – yannics Jan 22 '14 at 20:48
  • Don't remove it yet (as SBCL needs a CL implementation to bootstrap itself from) download SBCL from source and modifiy the features.lisp (IIRC) to add threads which is disabled by default) – PuercoPop Jan 22 '14 at 21:43

1 Answers1

5

SBCL has threads disabled by default on Mac OS X. To check if SBCL is build with threads run in the repl

(member :sb-thread *features*)

If not, compile it from source (using your current SBCL). From the INSTALL

sh make.sh --with-sb-thread
PuercoPop
  • 6,707
  • 4
  • 30
  • 40
  • No way. In the end of the compilation this message:`WARNING! Some of the contrib modules did not build successfully or pass their self-test. Failed contribs: sb-posix` – yannics Jan 22 '14 at 22:32
  • I have reported the problem (see [https://bugs.launchpad.net/sbcl/+bug/1272398](https://bugs.launchpad.net/sbcl/+bug/1272398)). I have to say that I did not find the right settings, and I still can not build sbcl with sb-thread. – yannics Jan 25 '14 at 10:19