R
Robbie Brown
I realise this is a C forum but background is.
I'm interfacing with existing C code from Java using the Java native
interface.
I have my C code for which I have written a driver to test the program
and it all works as expected (usual caveats on 'expected' of course).
I have written the Java interface, generated the header file and written
and compiled the C interface that complies with the header
my makefile is thus
all: jnicalc
jnicalc: calculator.c calcdriver.c
gcc -shared -o libcalc.so -fPIC calculator.c calcdriver.c
Where calculator.c is the original unaltered C code and calcdriver.c is
the jni interface code.
This all works fine, I can call my original C code from the Java
interface and get the hoped for results.
The next step is to interface with C object code.
I tried the following
all: jnicalc
jnicalc: calculator calcdriver
gcc -shared -o libcalc.so -fPIC calculator.o calcdriver.o
calcdriver: calcdriver.o
gcc -std=c99 -pedantic -c calcdriver.c
calculator: calculator.c
gcc -std=c99 -pedantic -c calculator.c
But this fails, the point is I may not always have the code for the C
interfaces, only the Object files. How can I build my Java interface in
C when I don't have access to the original code, only precompiled object
files and header files. Does trying to do this even make sense?
Thanks
--
Rob - not floundering, fishing
========================================================
For every SCoP we generate the polyhedral representation
and transform it back to gimple.
========================================================
Seems perfectly reasonable to me.
I'm interfacing with existing C code from Java using the Java native
interface.
I have my C code for which I have written a driver to test the program
and it all works as expected (usual caveats on 'expected' of course).
I have written the Java interface, generated the header file and written
and compiled the C interface that complies with the header
my makefile is thus
all: jnicalc
jnicalc: calculator.c calcdriver.c
gcc -shared -o libcalc.so -fPIC calculator.c calcdriver.c
Where calculator.c is the original unaltered C code and calcdriver.c is
the jni interface code.
This all works fine, I can call my original C code from the Java
interface and get the hoped for results.
The next step is to interface with C object code.
I tried the following
all: jnicalc
jnicalc: calculator calcdriver
gcc -shared -o libcalc.so -fPIC calculator.o calcdriver.o
calcdriver: calcdriver.o
gcc -std=c99 -pedantic -c calcdriver.c
calculator: calculator.c
gcc -std=c99 -pedantic -c calculator.c
But this fails, the point is I may not always have the code for the C
interfaces, only the Object files. How can I build my Java interface in
C when I don't have access to the original code, only precompiled object
files and header files. Does trying to do this even make sense?
Thanks
--
Rob - not floundering, fishing
========================================================
For every SCoP we generate the polyhedral representation
and transform it back to gimple.
========================================================
Seems perfectly reasonable to me.