Re: How to run from command line?

Pascal Bourguignon <[email protected]>
Newsgroups gmane.lisp.clisp.general
Message-ID <[email protected]>
> On 24 Dec 2016, at 12:25, Jean Louis <[email protected]> wrote:
> 
> Dear Pascal,
> 
> Thank you for the answer, and I learn now new things. Imagine I did
> not even look into the .fas and .lib files, but now I did. I like the
> concept so much.
> 
> 
> On Sat, Dec 24, 2016 at 12:04:52PM +0100, Pascal Bourguignon wrote:
>>> clisp file.fas
>>> 
>>> Maybe is this approach here explained, the preferred way to run it
>>> without clisp: https://www.cons.org/cmucl/doc/executable.html
>>> 
>>> I can use that one:
>>> 
>>> # mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
>>> # echo ':lisp:E::fas::/usr/bin/clisp:' >
>>> # /proc/sys/fs/binfmt_misc/register
> 
> I was not reading CLISP Implementation Notes in regards to this and I
> found the way. First I am mounting the binfmt_misc and then applying
> following:
> 
> sudo su - root -c "echo ':CLISP1:E::cl::/usr/bin/clisp:' >> /proc/sys/fs/binfmt_misc/register"
> sudo su - root -c "echo ':CLISP2:E::lisp::/usr/bin/clisp:' >> /proc/sys/fs/binfmt_misc/register"
> sudo su - root -c "echo ':CLISP3:E::fas::/usr/bin/clisp:' >> /proc/sys/fs/binfmt_misc/register"
> 
> And now I can simply run *.lisp and *.cl *.fas files directly from a
> command line or through other programs.
> 
>> Otherwise, you can always generate an executable image, for a
>> stand-alone program.  It would be easier than concatenating .fas
>> files, if there are dependencies.
> 
> How would I create executable image? How do you do it?

http://www.clisp.org/impnotes/image.html <http://www.clisp.org/impnotes/image.html>

(load “your-program.lisp”)
(ext:saveinitmem “your-program” :executable t :norc t :init-function ‘cl-user::main)


But notice that fas files are much smaller in general:

git pull
make clean test
rm -f hw-c hw-pascal hw-lisp-ccl hw-lisp-ecl hw-lisp-clisp hw-lisp-clisp-fas *.o *.fas *.lib *.log
// Generating Executable from C source: hw-c
// Generating Executable from Pascal source: hw-pascal
// Generating Executable from Lisp source: hw-lisp-ccl
// Generating Executable from Lisp source: hw-lisp-ecl
// Generating Executable from Lisp source: hw-lisp-clisp
// Compiling: hw.fas
// Generating Executable from Lisp source: hw-lisp-clisp-fas
hw-c                : Hello World!
hw-pascal           : Hello World!
hw-lisp-ccl         : Hello World!
hw-lisp-ecl         : Hello World!
hw-lisp-clisp       : Hello World!
hw-lisp-clisp-fas   : Hello World!
-rwxr-xr-x  1 pjb  staff      8432 Dec 24 13:33 hw-c
-rwxr-xr-x  1 pjb  staff  29470960 Dec 24 13:33 hw-lisp-ccl
-rwxr-xr-x  1 pjb  staff   8660556 Dec 24 13:33 hw-lisp-clisp
-rwxr-xr-x  1 pjb  staff      1955 Dec 24 13:33 hw-lisp-clisp-fas
-rwxr-xr-x  1 pjb  staff   1630828 Dec 24 13:33 hw-lisp-ecl
-rwxr-xr-x  1 pjb  staff    248376 Dec 24 13:33 hw-pascal

Compilation finished at Sat Dec 24 13:33:21



-- 
__Pascal J. Bourguignon__



------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/intel
_______________________________________________
clisp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.