Kevin Smith | 2 Aug 2010 22:31
Picon

sbcl threaded + mac os + slime

I seem to have a problem when running a program (using cl-opengl, cl-glut) under slime on the threaded version of sbcl for mac os.  Whenever I execute a compile/load file from slime,  slime disconnects from the process. The message is:


------
Lisp connection closed unexpectedly: connection broken by remote peer

Error during redisplay: (error Connection closed.)
------


However, when I run the lisp program from the repl in sbcl, it loads fine. 

 I seem to think it is a problem with cl-opengl.  when I evaluate this region in the file from slime (with as little as cl-opengl included in the list), it disconnects:

(eval-when (:compile-toplevel :load-toplevel :execute)
  (require :cl-opengl)
  (require :cl-glu)   
  (require :cl-glut)
  (require :cl-opencv))

However, when I evaluate other functions (that can be evaluated independently), it doesn't disconnect.  Also, running this code from the repl doesn't cause any problems - only from slime.

I am using the latest slime version as well as the macports of sbcl (threaded) which I dowloaded via:

sudo port install sbcl +threads

btw, NON-threaded is not a problem;  slime works fine with all the above code.

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Sbcl-help mailing list
Sbcl-help <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help
Tamas K Papp | 5 Aug 2010 11:46
Picon

querying proclaimed optimization settings

Hi,

Is there a way to query the (proclaimed) optimization settings in
effect?  Eg if there was a top-level (declaim (optimize ...)) before,
is there a way to ask SBCL what speed, debug, etc were set to?

Thanks,

Tamas

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
Stas Boukarev | 5 Aug 2010 12:28
Picon

Re: querying proclaimed optimization settings

Tamas K Papp <tkpapp <at> gmail.com> writes:

> Hi,
>
> Is there a way to query the (proclaimed) optimization settings in
> effect?  Eg if there was a top-level (declaim (optimize ...)) before,
> is there a way to ask SBCL what speed, debug, etc were set to?
(sb-cltl2:declaration-information 'optimize)

--

-- 
With Best Regards, Stas.

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
Nikodemus Siivola | 5 Aug 2010 12:46
Gravatar

Re: querying proclaimed optimization settings

On 5 August 2010 13:28, Stas Boukarev <stassats <at> gmail.com> wrote:
> Tamas K Papp <tkpapp <at> gmail.com> writes:
>
>> Hi,
>>
>> Is there a way to query the (proclaimed) optimization settings in
>> effect?  Eg if there was a top-level (declaim (optimize ...)) before,
>> is there a way to ask SBCL what speed, debug, etc were set to?
> (sb-cltl2:declaration-information 'optimize)

Also: (sb-ext:describe-compiler-policy)

Cheers,

 -- Nikodemus

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Sbcl-help mailing list
Sbcl-help <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help
Kevin Smith | 7 Aug 2010 06:26
Picon

Re: sbcl threaded + mac os + slime

I didn't get a response to this, but I found a solution that seems to work.


Add:

(setf swank:*communication-style* :fd-handler)

to your  ~/.swank.lisp  file   (or create this file and add it in if you don't have one...)


On Mon, Aug 2, 2010 at 1:31 PM, Kevin Smith <k2msmith <at> gmail.com> wrote:
I seem to have a problem when running a program (using cl-opengl, cl-glut) under slime on the threaded version of sbcl for mac os.  Whenever I execute a compile/load file from slime,  slime disconnects from the process. The message is:

------
Lisp connection closed unexpectedly: connection broken by remote peer

Error during redisplay: (error Connection closed.)
------


However, when I run the lisp program from the repl in sbcl, it loads fine. 

 I seem to think it is a problem with cl-opengl.  when I evaluate this region in the file from slime (with as little as cl-opengl included in the list), it disconnects:

(eval-when (:compile-toplevel :load-toplevel :execute)
  (require :cl-opengl)
  (require :cl-glu)   
  (require :cl-glut)
  (require :cl-opencv))

However, when I evaluate other functions (that can be evaluated independently), it doesn't disconnect.  Also, running this code from the repl doesn't cause any problems - only from slime.

I am using the latest slime version as well as the macports of sbcl (threaded) which I dowloaded via:

sudo port install sbcl +threads

btw, NON-threaded is not a problem;  slime works fine with all the above code.


------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Sbcl-help mailing list
Sbcl-help <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help
Adam Majewski | 10 Aug 2010 22:11
Picon
Favicon

Apollonian gasket / sbcl/ vecto

Hi,

Here is program for drawing Apollonian gasket :
http://fraktal.republika.pl/doc/apollonian_3.lisp
and here some doc :
http://en.wikibooks.org/wiki/Fractals/Apollonian_fractals

Regards

Adam Majewski
fraktal.republika.pl

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
Kevin Smith | 11 Aug 2010 17:03
Picon

load shared libraries on initial thread

Sorry if I asked this already, but is there any way to insure foreign libraries are loaded on the initial thread for sbcl built with threads ?  There is a problem with certain MAC OSX libraries (in 10.6, snow leopard) in this regard (like OpenGL, for example).  They can only be loaded in initial thread or cause breakpoint exceptions otherwise. Maybe sbcl already takes care of this ?


Thank You..

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Sbcl-help mailing list
Sbcl-help <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help
Nikodemus Siivola | 15 Aug 2010 12:19
Gravatar

Re: load shared libraries on initial thread

On 11 August 2010 18:03, Kevin Smith <k2msmith <at> gmail.com> wrote:

> Sorry if I asked this already, but is there any way to insure foreign
> libraries are loaded on the initial thread for sbcl built with threads ?
> There is a problem with certain MAC OSX libraries (in 10.6, snow leopard)
> in this regard (like OpenGL, for example).  They can only be loaded in
> initial thread or cause breakpoint exceptions otherwise. Maybe sbcl already
> takes care of this ?

No, unfortunately there isn't a convenient mechanism to automatically
do this for all foreign libraries.

Options available:

* If an application, just take care to load all foreign code in the
initial thread.

* If a library, document the need to be loaded in the initial thread.
(And make sure you're not doing any lazy loading!)

That said, there is one option that you _could_ use, but which is
really bad and I STRONGLY recommend against it. Grab a reference to
the initial thread and use INTERRUPT-THREAD to call LOAD-SHARED-OBJECT
there. Don't do this, really.

Apropos, can you post a snippet of code that shows how to provoke the error?

Cheers,

 -- Nikodemus

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Sbcl-help mailing list
Sbcl-help <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help
Kevin Smith | 16 Aug 2010 01:05
Picon

Re: load shared libraries on initial thread

Yes, but how do I load the libraries in the initial OS thread if sbcl is running under a different thread as
with slime or swank ?

Sent from my iPad

On Aug 15, 2010, at 3:19 AM, Nikodemus Siivola <nikodemus <at> random-state.net> wrote:

> On 11 August 2010 18:03, Kevin Smith <k2msmith <at> gmail.com> wrote:
> 
>> Sorry if I asked this already, but is there any way to insure foreign
>> libraries are loaded on the initial thread for sbcl built with threads ?
>> There is a problem with certain MAC OSX libraries (in 10.6, snow leopard)
>> in this regard (like OpenGL, for example).  They can only be loaded in
>> initial thread or cause breakpoint exceptions otherwise. Maybe sbcl already
>> takes care of this ?
> 
> No, unfortunately there isn't a convenient mechanism to automatically
> do this for all foreign libraries.
> 
> Options available:
> 
> * If an application, just take care to load all foreign code in the
> initial thread.
> 
> * If a library, document the need to be loaded in the initial thread.
> (And make sure you're not doing any lazy loading!)
> 
> That said, there is one option that you _could_ use, but which is
> really bad and I STRONGLY recommend against it. Grab a reference to
> the initial thread and use INTERRUPT-THREAD to call LOAD-SHARED-OBJECT
> there. Don't do this, really.
> 
> Apropos, can you post a snippet of code that shows how to provoke the error?
> 
> Cheers,
> 
> -- Nikodemus

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
Nikodemus Siivola | 16 Aug 2010 10:11
Gravatar

Re: load shared libraries on initial thread

On 16 August 2010 02:05, Kevin Smith <k2msmith <at> gmail.com> wrote:

> Yes, but how do I load the libraries in the initial OS thread
> if sbcl is running under a different thread as with slime or swank?

Huh, good question.

A quick answer is "don't use :spawn on OS X, use :fd-handler instead".
...which is what I actually do, hence I don't know off the cuff how to
evaluate stuff in a specific thread in Slime.

slime-devel is probably the right place to ask.

Cheers,

 -- Nikodemus

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 

Gmane