Stephen Westfold | 4 Mar 2008 21:19
Favicon

Using SLIME on windows revisited

A little over a year ago I posted about problems with using sbcl with  
SLIME on windows. I did get some help, but was still not able to get  
our system working then, so I gave up and have just recently turned to  
it.

The problem seems to be with sb-bsd-sockets and save-lisp-and-die. I  
give a transcript below that loads sb-bsd-sockets and everything is  
working fine, but after save-lisp-and-die and running the saved  
executable, get-protocol-by-name now fails. I checked that this works  
on Mac OS X. It also works if sb-bsd-sockets is loaded after  
restarting a saved executable, but we really want to deliver  
executables that don't have to load anything.

Is there something that needs to be reinitialized after starting a  
saved executable? Any suggestions?

Thanks,
Stephen Westfold
Kestrel Institute

C:\>sbcl
sbcl
This is SBCL 1.0.9, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.

(Continue reading)

Rudi Schlatte | 5 Mar 2008 03:08
Picon
Gravatar

Re: Using SLIME on windows revisited


On 05.03.2008, at 04:19, Stephen Westfold wrote:

> A little over a year ago I posted about problems with using sbcl with
> SLIME on windows. I did get some help, but was still not able to get
> our system working then, so I gave up and have just recently turned to
> it.
>
> The problem seems to be with sb-bsd-sockets and save-lisp-and-die. I
> give a transcript below that loads sb-bsd-sockets and everything is
> working fine, but after save-lisp-and-die and running the saved
> executable, get-protocol-by-name now fails. I checked that this works
> on Mac OS X. It also works if sb-bsd-sockets is loaded after
> restarting a saved executable, but we really want to deliver
> executables that don't have to load anything.
>
> Is there something that needs to be reinitialized after starting a
> saved executable? Any suggestions?

Just a guess - try funcalling sockint::*wsa-startup-call* when  
starting your saved core.  I don't see this being called anywhere in  
sb-bsd-sockets itself, but calling WSAStartup is necessary for using  
sockets on win32 iianm.

Cheers,

Rudi

Attachment (smime.p7s): application/pkcs7-signature, 2419 bytes
(Continue reading)

Stephen Westfold | 5 Mar 2008 23:36
Favicon

Re: Using SLIME on windows revisited

Thanks Rudi,
That was close, and I have it working now. In win32-sockets.lisp I  
changed

(defvar *wsa-startup-call*
   (wsa-startup (make-wsa-version 2 2)))

to

(defun wsa-init ()
   (wsa-startup (make-wsa-version 2 2)))

(push 'swa-init sb-ext:*init-hooks*)

(defvar *wsa-startup-call*
   (wsa-init))

stephen

On Mar 4, 2008, at 6:08 PM, Rudi Schlatte wrote:

>
> On 05.03.2008, at 04:19, Stephen Westfold wrote:
>
>> A little over a year ago I posted about problems with using sbcl with
>> SLIME on windows. I did get some help, but was still not able to get
>> our system working then, so I gave up and have just recently turned  
>> to
>> it.
>>
(Continue reading)

Gabriel Dos Reis | 15 Mar 2008 00:03

foreign function from a static library

Hi,

  I'm wondering whether SBCL has provision for calling
a foreign function from a static library archive.
Thanks in advance,

-- Gaby

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Juho Snellman | 15 Mar 2008 01:43
Picon
Picon
Favicon

Re: foreign function from a static library

"Gabriel Dos Reis" <gdr <at> integrable-solutions.net> writes:

> Hi,
> 
>   I'm wondering whether SBCL has provision for calling
> a foreign function from a static library archive.
> Thanks in advance,

No. IIRC that functionality existed in CMUCL, but was removed due to
maintainability concerns.

--

-- 
Juho Snellman

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Brian Mastenbrook | 15 Mar 2008 03:27

Re: foreign function from a static library

Gabriel Dos Reis wrote:
> Hi,
> 
>   I'm wondering whether SBCL has provision for calling
> a foreign function from a static library archive.

Why not just compile the static archive into a dynamic library?

--

-- 
Brian Mastenbrook
brian <at> mastenbrook.net
http://brian.mastenbrook.net/

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Gabriel Dos Reis | 15 Mar 2008 04:34

Re: foreign function from a static library

On Fri, Mar 14, 2008 at 9:27 PM, Brian Mastenbrook
<brian <at> mastenbrook.net> wrote:
> Gabriel Dos Reis wrote:
>  > Hi,
>  >
>  >   I'm wondering whether SBCL has provision for calling
>  > a foreign function from a static library archive.
>
>  Why not just compile the static archive into a dynamic library?

For libraries whose source files I have access to, yes that is what I do.
On the system I'm using there are some libraries that are installed
only in static archive form.  I wish all systems where like solaris.

-- Gaby

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Gabriel Dos Reis | 15 Mar 2008 04:34

Re: foreign function from a static library

On 15 Mar 2008 02:43:03 +0200, Juho Snellman <jsnell <at> iki.fi> wrote:
>
> "Gabriel Dos Reis" <gdr <at> integrable-solutions.net> writes:
>
>  > Hi,
>  >
>  >   I'm wondering whether SBCL has provision for calling
>  > a foreign function from a static library archive.
>  > Thanks in advance,
>
>  No. IIRC that functionality existed in CMUCL, but was removed due to
>  maintainability concerns.

OK.  Many thanks.

-- Gaby

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Nikodemus Siivola | 15 Mar 2008 08:45
Gravatar

Re: foreign function from a static library

On Sat, Mar 15, 2008 at 1:03 AM, Gabriel Dos Reis
<gdr <at> integrable-solutions.net> wrote:

>   I'm wondering whether SBCL has provision for calling
>  a foreign function from a static library archive.

I *think* that with sufficient linker magic you should be able to
produce a .so that exports all symbols from your .a. I think.

Cheers,

 -- Nikodemus

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Russell McManus | 15 Mar 2008 22:03
Picon
Favicon

Re: foreign function from a static library

"Nikodemus Siivola" <nikodemus <at> random-state.net> writes:

> I *think* that with sufficient linker magic you should be able to
> produce a .so that exports all symbols from your .a. I think.

How can this work if the code in the library was not compiled -fPIC?

-russ

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

Gmane