public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* how to build gsl dll
@ 2008-02-17 20:49 Mirko Vukovic
  2008-02-17 22:18 ` Brian Dessent
  2008-02-18 17:04 ` Reini Urban
  0 siblings, 2 replies; 9+ messages in thread
From: Mirko Vukovic @ 2008-02-17 20:49 UTC (permalink / raw)
  To: cygwin

Hi,

I am trying to build a dll for gsl.  I want to link it to clisp.

However, when after downloading the gsl source (and I saw it being
downloaded), I cannot find it (/usr/src is completely empty, and find
did not return much other than many *.h files, dll's etc).

On the other hand the gsl executable contains the *.a, *.dll.a and
*.la files. Is there a way to convert them to the dll.a

Frankly, I started dealing with libraries only about a week ago, and
while I understand the .a, .so, .dll types (I think), I'm not sure
about dll.a and .la.

Thank you,

Mirko

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how to build gsl dll
  2008-02-17 20:49 how to build gsl dll Mirko Vukovic
@ 2008-02-17 22:18 ` Brian Dessent
  2008-02-18  1:12   ` Mirko Vukovic
  2008-02-18 17:04 ` Reini Urban
  1 sibling, 1 reply; 9+ messages in thread
From: Brian Dessent @ 2008-02-17 22:18 UTC (permalink / raw)
  To: cygwin

Mirko Vukovic wrote:

> I am trying to build a dll for gsl.  I want to link it to clisp.

Why?  The Cygwin gsl packages already contains everything you need,
including both shared and static versions.  Install the 'gsl' package
for the runtime files (the DLL) and install 'gsl-devel' for the
developer files (headers, import library, static library, libtool
library.)  You don't have to do anything.

> On the other hand the gsl executable contains the *.a, *.dll.a and
> *.la files. Is there a way to convert them to the dll.a

That doesn't make any sense.  There is no need to convert anything, not
that that's even possible.

> Frankly, I started dealing with libraries only about a week ago, and
> while I understand the .a, .so, .dll types (I think), I'm not sure
> about dll.a and .la.

For a package 'foo' cygfoo-n.dll is the shared library, it goes in
/usr/bin since it must be in the PATH.  This is the only file that is
actually used at runtime[1], as opposed to link time.  n is the ABI
version, if present.  libfoo.dll.a is the import library for
cygfoo-n.dll and it goes in /usr/lib.  An import library is just an aide
for the linker, it contains no actual code.  libfoo.a is the static
version of the library, and also goes in /usr/lib.  Sometimes import
libraries are also named libfoo.a too but this practice is discouraged,
it's mostly legacy things like all the w32api import libs that are still
named this way.  Import libraries can also be renamed as foo.lib if they
are to be used by the MS toolchain.  libfoo.la is the libtool library,
it's just a text file that describes aspects of the library and is used
by libtool if you use that to link.

Brian

[1] Okay technically the libtool .la file could be read at runtime if
the library is dlopened with libltdl, but that's probably not relevant
here.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how to build gsl dll
  2008-02-17 22:18 ` Brian Dessent
@ 2008-02-18  1:12   ` Mirko Vukovic
  0 siblings, 0 replies; 9+ messages in thread
From: Mirko Vukovic @ 2008-02-18  1:12 UTC (permalink / raw)
  To: cygwin

On Sun, Feb 17, 2008 at 2:19 PM, Brian Dessent <brian@dessent.net> wrote:
> Mirko Vukovic wrote:
>
>  > I am trying to build a dll for gsl.  I want to link it to clisp.
>
>  Why?  The Cygwin gsl packages already contains everything you need,
>  including both shared and static versions.  Install the 'gsl' package
>  for the runtime files (the DLL) and install 'gsl-devel' for the
>  developer files (headers, import library, static library, libtool
>  library.)  You don't have to do anything.
>
>
>  > On the other hand the gsl executable contains the *.a, *.dll.a and
>  > *.la files. Is there a way to convert them to the dll.a
>
>  That doesn't make any sense.  There is no need to convert anything, not
>  that that's even possible.
>
>
>  > Frankly, I started dealing with libraries only about a week ago, and
>  > while I understand the .a, .so, .dll types (I think), I'm not sure
>  > about dll.a and .la.
>
>  For a package 'foo' cygfoo-n.dll is the shared library, it goes in
>  /usr/bin since it must be in the PATH.  This is the only file that is
>  actually used at runtime[1], as opposed to link time.  n is the ABI
>  version, if present.  libfoo.dll.a is the import library for
>  cygfoo-n.dll and it goes in /usr/lib.  An import library is just an aide
>  for the linker, it contains no actual code.  libfoo.a is the static
>  version of the library, and also goes in /usr/lib.  Sometimes import
>  libraries are also named libfoo.a too but this practice is discouraged,
>  it's mostly legacy things like all the w32api import libs that are still
>  named this way.  Import libraries can also be renamed as foo.lib if they
>  are to be used by the MS toolchain.  libfoo.la is the libtool library,
>  it's just a text file that describes aspects of the library and is used
>  by libtool if you use that to link.
>
>  Brian
>
>  [1] Okay technically the libtool .la file could be read at runtime if
>  the library is dlopened with libltdl, but that's probably not relevant
>  here.
>

Thank you.  I found it: cyggsl-0.dll, cyggslcblas-0.dll in /usr/bin.
Thank you very much for the explanation.

Mirko
>  --
>  Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>  Problem reports:       http://cygwin.com/problems.html
>  Documentation:         http://cygwin.com/docs.html
>  FAQ:                   http://cygwin.com/faq/
>
>

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how to build gsl dll
  2008-02-17 20:49 how to build gsl dll Mirko Vukovic
  2008-02-17 22:18 ` Brian Dessent
@ 2008-02-18 17:04 ` Reini Urban
  2008-02-18 17:58   ` Mirko Vukovic
  1 sibling, 1 reply; 9+ messages in thread
From: Reini Urban @ 2008-02-18 17:04 UTC (permalink / raw)
  To: cygwin

Hi Mirko

2008/2/17, Mirko Vukovic <mirko.vukovic@gmail.com>:
> I am trying to build a dll for gsl.  I want to link it to clisp.

I would suggest not to use a static clisp module, just use the FFI.
This is much simplier, smaller and easier to test. See libsvm or matlab,
or pari for a more optimized binding.

I want to do this for my gdi module also, but had no time yet.
And we still have no header parser, which could construct the
FFI binding automatically. cffi might be useful.
-- 
Reini Urban
http://phpwiki.org/              http://murbreak.at/
http://spacemovie.mur.at/   http://helsinki.at/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how to build gsl dll
  2008-02-18 17:04 ` Reini Urban
@ 2008-02-18 17:58   ` Mirko Vukovic
  2008-02-18 22:21     ` Reini Urban
  0 siblings, 1 reply; 9+ messages in thread
From: Mirko Vukovic @ 2008-02-18 17:58 UTC (permalink / raw)
  To: cygwin

On Mon, Feb 18, 2008 at 11:01 AM, Reini Urban <rurban@x-ray.at> wrote:
> Hi Mirko
>
>  2008/2/17, Mirko Vukovic <mirko.vukovic@gmail.com>:
>
> > I am trying to build a dll for gsl.  I want to link it to clisp.
>
>  I would suggest not to use a static clisp module, just use the FFI.
>  This is much simplier, smaller and easier to test. See libsvm or matlab,
>  or pari for a more optimized binding.
>
>  I want to do this for my gdi module also, but had no time yet.
>  And we still have no header parser, which could construct the
>  FFI binding automatically. cffi might be useful.
>  --
>  Reini Urban
>  http://phpwiki.org/              http://murbreak.at/
>  http://spacemovie.mur.at/   http://helsinki.at/
>
>
>
>  --
>  Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>  Problem reports:       http://cygwin.com/problems.html
>  Documentation:         http://cygwin.com/docs.html
>  FAQ:                   http://cygwin.com/faq/
>
>
Reini,

The reason why I need cffi is that I am trying to get nlisp to work on
clisp+cygwin.  And nlisp is using cffi.  I have nlisp running at work
on linux+sbcl, but my laptop has only cygwin.

I posted a message on the cffi mailing list, and Luis is helping me there.

Mirko

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how to build gsl dll
  2008-02-18 17:58   ` Mirko Vukovic
@ 2008-02-18 22:21     ` Reini Urban
  2008-02-18 22:47       ` [cffi-devel] " Mirko Vukovic
  2008-02-19  1:57       ` Luís Oliveira
  0 siblings, 2 replies; 9+ messages in thread
From: Reini Urban @ 2008-02-18 22:21 UTC (permalink / raw)
  To: cygwin; +Cc: cffi-devel

Mirko Vukovic schrieb:
> On Mon, Feb 18, 2008 at 11:01 AM, Reini Urban  wrote:
>>  2008/2/17, Mirko Vukovic:
>>> I am trying to build a dll for gsl.  I want to link it to clisp.
>>  I would suggest not to use a static clisp module, just use the FFI.
>>  This is much simplier, smaller and easier to test. See libsvm or matlab,
>>  or pari for a more optimized binding.
>>
>>  I want to do this for my gdi module also, but had no time yet.
>>  And we still have no header parser, which could construct the
>>  FFI binding automatically. cffi might be useful.

> Reini,
> The reason why I need cffi is that I am trying to get nlisp to work on
> clisp+cygwin.  And nlisp is using cffi.  I have nlisp running at work
> on linux+sbcl, but my laptop has only cygwin.

$ cygcheck /bin/cyggsl-0.dll
f:\cygwin\bin\cyggsl-0.dll
   f:\cygwin\lib\lapack\cygblas.dll

Are you sure you have /lib/lapack or /usr/lib/lapack added to your path?

> I posted a message on the cffi mailing list, and Luis is helping me there.

I see.
$ clisp -q
(ASDF:OOS 'ASDF:LOAD-OP :ASDF-INSTALL)
(ASDF-INSTALL:INSTALL :nlisp)

Oops...
So I had to create a small patch
http://sourceforge.net/tracker/index.php?func=detail&aid=1896345&group_id=174776&atid=870580

nlisp.lisp:
(cffi:define-foreign-library libgslcblas
   (:darwin "libgslcblas.dylib")
   (:unix (:or "cyggslcblas-0.dll" "libgslcblas.so.0" "libgslcblas.so"))
...
(cffi:define-foreign-library libgsl
   (:darwin "libgsl.dylib")
   (:unix (:or "cyggsl-0.dll" "libgsl.so.0" "libgsl.so"))
...
(cffi:define-foreign-library libsndfile
   (:darwin "libsndfile.dylib")
   (:unix (:or "cygsndfile-1.dll" "libsndfile.so.1" "libsndfile.so"))

Luís, cannot this be a bit simplified for :cygwin?
I've always have to do this.
"libsndfile.so.1" can be automatically translated to "cygsndfile-1.dll". 
Unfortunately :cygwin is no define-foreign-library target, just :unix.

nlisp-core.lisp:
fixnum and double-float just name clisp types, no classes yet. This is 
just for cmucl/sbcl so far. CLHS does not require those.
The clisp numeric classes are listed in the impnotes Chapter 4.4. 
(NUMBER, COMPLEX, REAL, FLOAT, RATIONAL, RATIO, INTEGER)

Now (ASDF:OOS 'ASDF:LOAD-OP :NLISP) prints tons of 
FFI::FOREIGN-LIBRARY-FUNCTION warnings, but works fine.
-- 
Reini Urban
http://phpwiki.org/  http://murbreak.at/
http://helsinki.at/  http://spacemovie.mur.at/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [cffi-devel] Re: how to build gsl dll
  2008-02-18 22:21     ` Reini Urban
@ 2008-02-18 22:47       ` Mirko Vukovic
  2008-02-19  1:57       ` Luís Oliveira
  1 sibling, 0 replies; 9+ messages in thread
From: Mirko Vukovic @ 2008-02-18 22:47 UTC (permalink / raw)
  To: Reini Urban; +Cc: cygwin, cffi-devel

On Mon, Feb 18, 2008 at 1:52 PM, Reini Urban <rurban@x-ray.at> wrote:
> Mirko Vukovic schrieb:
>  > On Mon, Feb 18, 2008 at 11:01 AM, Reini Urban  wrote:
>  >>  2008/2/17, Mirko Vukovic:
>
> >>> I am trying to build a dll for gsl.  I want to link it to clisp.
>  >>  I would suggest not to use a static clisp module, just use the FFI.
>  >>  This is much simplier, smaller and easier to test. See libsvm or matlab,
>  >>  or pari for a more optimized binding.
>  >>
>  >>  I want to do this for my gdi module also, but had no time yet.
>  >>  And we still have no header parser, which could construct the
>  >>  FFI binding automatically. cffi might be useful.
>
>
> > Reini,
>  > The reason why I need cffi is that I am trying to get nlisp to work on
>  > clisp+cygwin.  And nlisp is using cffi.  I have nlisp running at work
>  > on linux+sbcl, but my laptop has only cygwin.
>
>  $ cygcheck /bin/cyggsl-0.dll
>  f:\cygwin\bin\cyggsl-0.dll
>    f:\cygwin\lib\lapack\cygblas.dll
>
>  Are you sure you have /lib/lapack or /usr/lib/lapack added to your path?
>
>
>  > I posted a message on the cffi mailing list, and Luis is helping me there.
>
>  I see.
>  $ clisp -q
>  (ASDF:OOS 'ASDF:LOAD-OP :ASDF-INSTALL)
>  (ASDF-INSTALL:INSTALL :nlisp)
>
>  Oops...
>  So I had to create a small patch
>  http://sourceforge.net/tracker/index.php?func=detail&aid=1896345&group_id=174776&atid=870580
>
>  nlisp.lisp:
>  (cffi:define-foreign-library libgslcblas
>    (:darwin "libgslcblas.dylib")
>    (:unix (:or "cyggslcblas-0.dll" "libgslcblas.so.0" "libgslcblas.so"))
>  ...
>  (cffi:define-foreign-library libgsl
>    (:darwin "libgsl.dylib")
>    (:unix (:or "cyggsl-0.dll" "libgsl.so.0" "libgsl.so"))
>  ...
>  (cffi:define-foreign-library libsndfile
>    (:darwin "libsndfile.dylib")
>    (:unix (:or "cygsndfile-1.dll" "libsndfile.so.1" "libsndfile.so"))
>
>  Luís, cannot this be a bit simplified for :cygwin?
>  I've always have to do this.
>  "libsndfile.so.1" can be automatically translated to "cygsndfile-1.dll".
>  Unfortunately :cygwin is no define-foreign-library target, just :unix.
>
>  nlisp-core.lisp:
>  fixnum and double-float just name clisp types, no classes yet. This is
>  just for cmucl/sbcl so far. CLHS does not require those.
>  The clisp numeric classes are listed in the impnotes Chapter 4.4.
>  (NUMBER, COMPLEX, REAL, FLOAT, RATIONAL, RATIO, INTEGER)
>
>  Now (ASDF:OOS 'ASDF:LOAD-OP :NLISP) prints tons of
>  FFI::FOREIGN-LIBRARY-FUNCTION warnings, but works fine.
>  --
>
> Reini Urban
>  http://phpwiki.org/  http://murbreak.at/
>  http://helsinki.at/  http://spacemovie.mur.at/
>  _______________________________________________
>  cffi-devel mailing list
>  cffi-devel@common-lisp.net
>  http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel
>

Reini,

I was using that your format as well.

You can see from Luis' post that he can load the library as well.
I'll keep digging to see why I cannot link to it (even though I can
probe it - meaning clisp can see it)

Thanks for your comments and help

Mirko

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [cffi-devel] Re: how to build gsl dll
  2008-02-18 22:21     ` Reini Urban
  2008-02-18 22:47       ` [cffi-devel] " Mirko Vukovic
@ 2008-02-19  1:57       ` Luís Oliveira
  2008-02-19 20:43         ` Mirko Vukovic
  1 sibling, 1 reply; 9+ messages in thread
From: Luís Oliveira @ 2008-02-19  1:57 UTC (permalink / raw)
  To: Reini Urban; +Cc: cygwin, cffi-devel

On 18/02/2008, Reini Urban <rurban@x-ray.at> wrote:
> Luís, cannot this be a bit simplified for :cygwin?
> I've always have to do this.
> "libsndfile.so.1" can be automatically translated to "cygsndfile-1.dll".
> Unfortunately :cygwin is no define-foreign-library target, just :unix.

Maybe. Do all cygwin Lisps push :CYGWIN onto their *FEATURES* like CLISP?

Regarding the naming convention, I suppose we could add a library
designator (or change :DEFAULT) that handles that. E.g.: (:lib "foo"
2) would translate to "libfoo.so.2", "libfoo.2.dylib", "cygfoo-2.dll",
etc.

-- 
Luís Oliveira
http://student.dei.uc.pt/~lmoliv/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [cffi-devel] Re: how to build gsl dll
  2008-02-19  1:57       ` Luís Oliveira
@ 2008-02-19 20:43         ` Mirko Vukovic
  0 siblings, 0 replies; 9+ messages in thread
From: Mirko Vukovic @ 2008-02-19 20:43 UTC (permalink / raw)
  To: Luís Oliveira; +Cc: Reini Urban, cffi-devel, cygwin

On Mon, Feb 18, 2008 at 5:18 PM, Luís Oliveira <luismbo@gmail.com> wrote:
> On 18/02/2008, Reini Urban <rurban@x-ray.at> wrote:
>  > Luís, cannot this be a bit simplified for :cygwin?
>  > I've always have to do this.
>  > "libsndfile.so.1" can be automatically translated to "cygsndfile-1.dll".
>  > Unfortunately :cygwin is no define-foreign-library target, just :unix.
>
>  Maybe. Do all cygwin Lisps push :CYGWIN onto their *FEATURES* like CLISP?
>
>  Regarding the naming convention, I suppose we could add a library
>  designator (or change :DEFAULT) that handles that. E.g.: (:lib "foo"
>  2) would translate to "libfoo.so.2", "libfoo.2.dylib", "cygfoo-2.dll",
>  etc.
>
>  --
>  Luís Oliveira
>  http://student.dei.uc.pt/~lmoliv/
>
>
> _______________________________________________
>  cffi-devel mailing list
>  cffi-devel@common-lisp.net
>  http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel
>

As far as I know, clisp is the only lisp running on cygwin.  I tried
compiling sbcl, and that got me nowhere.


Mirko

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-02-18 22:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-17 20:49 how to build gsl dll Mirko Vukovic
2008-02-17 22:18 ` Brian Dessent
2008-02-18  1:12   ` Mirko Vukovic
2008-02-18 17:04 ` Reini Urban
2008-02-18 17:58   ` Mirko Vukovic
2008-02-18 22:21     ` Reini Urban
2008-02-18 22:47       ` [cffi-devel] " Mirko Vukovic
2008-02-19  1:57       ` Luís Oliveira
2008-02-19 20:43         ` Mirko Vukovic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).