Home > Archive > Prolog > March 2008 > eclipse clp prolog C code generation query
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
eclipse clp prolog C code generation query
|
|
| jitender001001@gmail.com 2008-03-25, 4:42 am |
| Hi Everyone
I am using eclipse clp version 5.10 on fedora core 6.
I want to know that is there any way to see the C code generated by
tkeclipse after compiling prolog file.
| |
| Joachim Schimpf 2008-03-25, 7:23 pm |
| jitender001001@gmail.com wrote:
> Hi Everyone
> I am using eclipse clp version 5.10 on fedora core 6.
> I want to know that is there any way to see the C code generated by
> tkeclipse after compiling prolog file.
ECLiPSe does not generate C code from Prolog.
-- Joachim
| |
| Kish Shen 2008-03-25, 7:23 pm |
| Joachim Schimpf wrote:
> jitender001001@gmail.com wrote:
>
> ECLiPSe does not generate C code from Prolog.
>
>
> -- Joachim
As Joachim says, ECLiPSe does not compile its source programs into C,
which I think is what your question assumes. Instead, ECLiPSe compiles
source ECLiPSe programs into its own abstract machine code. You can view
the code generated for each predicate with als/1. [or you can load
lib(asm) and use wam/1, which produces listings that I find more
readable] This is probably not very helpful unless you have a reasonable
knowledge of WAM-like abstract machines.
-- Kish
| |
| jitender001001@gmail.com 2008-03-26, 4:45 am |
| hi thanks for response
I want to know that how i can use C program in "tkeclipse". Actually
i have tried it in "eclipse" and program got terminated in ec_init()
function, So i want to try it in tkeclipse.
| |
| jitender001001@gmail.com 2008-03-26, 4:45 am |
| i have compiled program doc/examples/eg_c_basic.c like this
[anonymous@localhost Eclipse_5.10_103]$ gcc -g -Iinclude/i386_linux
doc/examples/eg_c_basic.c -Llib/i386_linux -leclipse
and it got terminated in ec_init()
so plz tell how can i compile it in tkeclipse ?
thanks
| |
| Kish Shen 2008-03-26, 8:13 am |
| jitender001001@gmail.com wrote:
> i have compiled program doc/examples/eg_c_basic.c like this
>
> [anonymous@localhost Eclipse_5.10_103]$ gcc -g -Iinclude/i386_linux
> doc/examples/eg_c_basic.c -Llib/i386_linux -leclipse
>
> and it got terminated in ec_init()
>
> so plz tell how can i compile it in tkeclipse ?
>
> thanks
Hi,
You asked about this about a month ago in the comp.constraints
Newsgroup. I replied to you then, and suggested for such
ECLiPSe-specific question, you might want to use the ECLiPSe mailing
list at:
http://www.eclipse-clp.org/mailman/...o/eclipse-users
I asked several questions in my previous reply to you: I asked if you
could run tkeclipse. It seems that you can -- this calls ec_init(), like
in the example program you are compiling above. So it seems that
ec_init() works, so the problem is not with your ECLiPSe system.
From the way you are compiling your example above, and if you run the
resulting a.out from your <ECLiPSe> (where <ECLiPSe> is where you placed
ECLiPSe) toplevel directory, you need to set LD_LIBRARY_PATH environment
variable to include <ECLiPSe>/lib/i386_linux when you run the a.out
executable. This seems to be the most likely reason why you are having
problems running the a.out.
However, you should get an error message if LD_LIBRARY_PATH was not set
correctly:
kish@bodgerix:~/Eclipse> a.out
a.out: error while loading shared libraries: libeclipse.so: cannot open
shared object file: No such file or directory
but in your previous postings, you said you did not get any messages. I
am not sure why this is so.
As for your specific question about `compiling C programs in tkeclipse',
there may be some confusion here -- you can embed ECLiPSe into a C
program, which you compile and run -- this is what the example you are
trying to compile, and also tkeclipse, is doing. So you don't compile a
C program from tkeclipse as such.
On the other hand, you can call C from within ECLiPSe, by calling
`external' predicates that are written in C. You can do this from any
ECLiPSe, but this is not what you are trying to do.
Cheers,
Kish
|
|
|
|
|