Discussion:
how to compile jni code which contains "mpi.h"
(too old to reply)
Kamran Hameed
2008-04-30 16:12:05 UTC
Permalink
folks.. i am trying to compile a JNI code. it has header file "mpi.h"
since it has to call MPI_COMM_WORLD. but when i compile the code using
command

gcc code.c -o libcode.so -shared -I/path/to/java -I/path/to/java/
include/linux

it says that "Cant Find "mpi.h:: No Such File or Directory""

whereas when i compile the normal C code of MPI using gcc, it works
fine (as mpich2 is in my PATH).

Can any one tell whats the matter?
Michael Hofmann
2008-05-02 16:08:52 UTC
Permalink
Post by Kamran Hameed
folks.. i am trying to compile a JNI code. it has header file "mpi.h"
since it has to call MPI_COMM_WORLD. but when i compile the code using
command
gcc code.c -o libcode.so -shared -I/path/to/java -I/path/to/java/
include/linux
Normally, one uses "mpicc" to compile MPI C code. "mpicc" invokes "gcc" with the appropriate flags. If you want to use "gcc", you may need something like "-I/path/to/mpi/include" and "-L/path/to/mpi/lib".
Post by Kamran Hameed
it says that "Cant Find "mpi.h:: No Such File or Directory""
whereas when i compile the normal C code of MPI using gcc, it works
fine (as mpich2 is in my PATH).
This makes no sense to me. It's fine that mpich2 is in your PATH, but this has nothing to do with a missing "mpi.h" file. And what is "the normal C code of MPI"?
Post by Kamran Hameed
Can any one tell whats the matter?
It's hard to tell from your description.


Michael
Kamran Hameed
2008-05-02 16:56:37 UTC
Permalink
thanx for ur reply. i used mpicc and it was working... thanks

Loading...