[zeromq-dev] building: Problem with cl bindings

Peter Busser busserpeter at gmail.com
Mon Jan 25 12:49:51 CET 2010


Adrian,

There is nothing to know about Common Lisp that is in any way relevant
for the packaging of the CL bindings.

The FFI (Foreign Function Interface) used by the ZeroMQ Common Lisp
bindings, CFFI, is a smart FFI. The FFIs of other languages require
you to write some interface code in C and to compile and link things.
Not so with CFFI. The whole interface is specified in Common Lisp. So
in theory you don't even need to know how to program C. Newer versions
of CFFI can even parse C header files and (to some extent)
automatically generate CL bindings.

A programmer who wants to use foreign functions instructs CFFI to load
a shared library. Then he can specify foreign data types and
functions. This can all be done from the Lisp prompt (i.e. the so
called REPL, the Read Evaluate Print Loop). You can redefine function
definitions on the fly if they don't work, therefore testing is really
easy and fast.

This Lisp code is automatically compiled when someone instructs the
Lisp environment to load the code. The resulting object files (i.e.
.fasl files) are cached on disk, to prevent them from being
unnecessarily recompiled next time they are used. Linking is done
automatically at run-time.

Debian packages do not use ASDF. They use the so called Common Lisp
Controller. This is needed, because Debian supports a number of
different Common Lisp implementations (at least 4 in Lenny). Each of
these implementations can compile the Common Lisp source code in a
different way. Different versions of CL compilers can be installed at
the same time (in theory at least). And every user can create his/her
own personal Lisp environment.

What if root removes a Common Lisp implementation? It means that all
the cached object files must be deleted. Also every user needs his/her
own cache, because the outcome of the compilation depends on the
environment. CLC deals with the complexity of managing all that.

For the user, it means that he/she can just load libraries without
problems. For root it means that he/she can install and remove CL
compilers without problems. And for the package, it means that he/she
only has to install the files in the right places to make the source
files available. In the case of the stuff under packages/debian, that
is taken care off by the cl-zeromq.* files. It is therefore trivial to
package pure Common Lisp libraries for Debian.

Groetjes,
Peter.

2010/1/25 Adrian von Bidder <avbidder at fortytwo.ch>:
> On Saturday 23 January 2010 08.40:27 Peter Busser wrote:
>> Martin,
>>
>> Oh, I understand. He is trying to solve the same problem I had. The
>> solution is in packages/debian.
>
> Was your solution not calling --with-cl at all?  That's what your packaging
> does, and you just install the sources directly.
>
> I really don't know anything about cl, so I kind of hesitate to just omit
> the --with-cl from the configure - is it really a noop for "make", and only
> affects "make install"?
>
> thanks
> -- vbi
>
>>
>> Groetjes,
>> Peter.
>>
>> 2010/1/23 Martin Sustrik <sustrik at 250bpm.com>:
>> > I would say Adrian haven't specified any directory to install cl files
>> > into:
>> >
>> > ./configure --with-cl
>> >
>> > instead of e.g.:
>> >
>> > ./configure --with-cl=/usr/asdf
>> >
>> > Martin
>> >
>> > Peter Busser wrote:
>> >> Adrian,
>> >>
>> >> Can you be more specific about what you are doing? I do not understand
>> >> what you are doing wrong. I have just pulled the latest Git source and
>> >> built packages against Lenny without any problems at all using the
>> >> packages/debian directory included in the Git repository.
>> >>
>> >> Groetjes,
>> >> Peter.
>> >>
>> >> 2010/1/22 Adrian von Bidder <avbidder at fortytwo.ch>:
>> >>> Heyho!
>> >>>
>> >>> Knowing absolutely nothing about Common Lisp ...
>> >>>
>> >>> Calling configure --with-cl:
>> >>>
>> >>> configure: error: Please, specify ASDF central registry path
>> >>>
>> >>> I guess Peter, at least, can help me here :-)
>> >>>
>> >>> cheers
>> >>> -- vbi
>> >>>
>> >>> --
>> >>> 50% ist nun mal nicht gerade Bier.
>> >>>       -- Alexander Pretschner
>> >>> _______________________________________________
>> >>> zeromq-dev mailing list
>> >>> zeromq-dev at lists.zeromq.org
>> >>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>> >>
>> >> _______________________________________________
>> >> zeromq-dev mailing list
>> >> zeromq-dev at lists.zeromq.org
>> >> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>
>
> --
> Ich kann mir denken, daß ein reiner Dichter einen reinen Kaufmann
> begreift und schätzt sogar; aber nicht umgekehrt.
>                -- Jean Paul
>



More information about the zeromq-dev mailing list