Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#254 command line option h (generate c-header) is not recognized

Stable_release
closed
nobody
None
1
2013-02-28
2013-02-22
Anonymous
No

I've compiled ecl from git (today) because my Ubuntu 12.10 comes with a version of ECL from 2011!!

I'm trying to get it to save the C .h file when compiling the lisp program but it seems the option is not recognized by ECL???

Here's what im getting:

victor@ubuntu:~/exe$ /usr/local/bin/ecl
ECL (Embeddable Common-Lisp) 12.12.1 (git:e725846659f584e5ad048d360e955f6512402eee)
Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya
Copyright (C) 1993 Giuseppe Attardi
Copyright (C) 2000 Juan J. Garcia-Ripoll
ECL is free software, and you are welcome to redistribute it
under certain conditions; see file 'Copyright' for details.
Type :h for Help.  
Top level in: #<process TOP-LEVEL>.
> (quit)
victor@ubuntu:~/exe$ cat hello.lisp 
    (princ "Hello world!")
    (terpri)
    (quit)
victor@ubuntu:~/exe$ /usr/local/bin/ecl --version
ECL 12.12.1
victor@ubuntu:~/exe$ /usr/local/bin/ecl -o hello.o -c hello.c -h hello.h -data hello.data -s -compile hello.lisp
Unknown command line option hello.h.

Usage: ecl [-? | --help]
           [-dir dir] [-load file] [-shell file] [-eval expr] [-rc | -norc] [-hp | -nohp]
           [--c-stack size] [--lisp-stack size] [--heap-size size] [--frame-stack size]
           [[-o ofile] [-c [cfile]] [-h [hfile]] [-data [datafile]] [-s] [-q]
            -compile file]
           [[-o ofile] -link file+]
           [--input-encoding external-format] [--output-encoding external-format]
           [--error-encoding external-format] [--encoding external-format]
victor@ubuntu:~/exe$ /usr/local/bin/ecl -o hello.o -c hello.c -data hello.data -s -compile hello.lisp
;;; Loading #P"/usr/local/lib/ecl-12.12.1/cmp.fas"
;;;
;;; Compiling hello.lisp.
;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0
;;;
;;; End of Pass 1.
;;; Finished compiling hello.lisp.
;;;
victor@ubuntu:~/exe$

Discussion


  • Anonymous
    2013-02-25

    Seems that command argument parsing in ECL is completely broken.

    Found yet another bug.

    According to the help info, parameters for -c or -h args are OPTIONAL, as indicated by square brackets around cfile, hfile, etc.

    So, this is what happens when ECL is ran with -c argument only.

    victor@ubuntu:~/exe$ /usr/local/bin/ecl --help
    
    Usage: ecl [-? | --help]
               [-dir dir] [-load file] [-shell file] [-eval expr] [-rc | -norc] [-hp | -nohp]
               [--c-stack size] [--lisp-stack size] [--heap-size size] [--frame-stack size]
               [[-o ofile] [-c [cfile]] [-h [hfile]] [-data [datafile]] [-s] [-q]
                -compile file]
               [[-o ofile] -link file+]
               [--input-encoding external-format] [--output-encoding external-format]
               [--error-encoding external-format] [--encoding external-format]
    victor@ubuntu:~/exe$ /usr/local/bin/ecl -o hello.o -c -s -compile hello.lisp
    ;;; Loading #P"/usr/local/lib/ecl-12.12.1/cmp.fas"
    ;;;
    ;;; Compiling hello.lisp.
    ;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0
    ;;;
    ;;; End of Pass 1.gcc: fatal error: no input files
    compilation terminated.
    
    ;;; Internal error:
    ;;;   ** Error code 4 when executing
    ;;; (RUN-PROGRAM "gcc" ("-I." "-I/usr/local/include/" "-D_GNU_SOURCE" "-D_FILE_OFFSET_BITS=64" "-g" "-O2" "-fPIC" "-D_THREAD_SAFE" "-Dlinux" "-O2" "-c" "-s" "-o" "hello.o"))victor@ubuntu:~/exe$
    
     
    Last edit: Anonymous 2013-02-25
  • Thanks for reporting this problem. I have fixed both bugs:

    -h is no longer an alias for --help (this was causing headers not to be produced)

    -c, -h and -o take optional arguments (this was not possible before because we changed the code that handles command line options).

    Both fixes are available in git/CVS

     


Anonymous


Cancel   Add attachments