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 07:38, Jean Louis <[email protected]> wrote:
> 
> I am now interested to run compiled program from a command line
> directly.
> 
> After compiling the file, it still has to be executed with:
> 
> 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
> 
> And it works, I can run *.fas files from command line that way.
> 
> While I am new to CLISP and Lisp, is there any other common way on how
> to run it from command line?
> 
> Am I expected to create each time a new shell script that runs the
> program, like?
> 
> #!/bin/bash
> clisp somefile.fas


If you open the .fas file in an editor, you will notice that it is a text file, an actual lisp source using a dispatching reader macro for the byte code.

In consequence, you may handle .fas files just like .lisp files: concatenate several of them, prefix them with a shebang line and chmod +x them.

You will find an example here:
https://framagit.org/com-informatimago/hw/tree/master

name=your-program
clisp -ansi -q -E utf-8 -norc -c "${name}.lisp"  -o "${name}.fas" 
( echo '#!/usr/local/bin/clisp -ansi -q -E utf-8' ;
  cat "${name}.fas" ;
  echo '(cl-user::main ext:*args*)' ) > "${name}"
chmod 755  "${name}"


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.


-- 
__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.