nrnjava on fedora 7 in order to use neuroconstruct
Posted: Fri Dec 21, 2007 6:00 am
When installing nrn with nrnjava (in order to user NeuroConstruct) we fail: what is proper java version to use in this case ?
Other option: Is there any patch to apply, or any advice to adapt this part of the code ? This is simply the jni wrapper.
Thanks !
Detailled report:
When installing nrn on Fedora core 7 with :
./configure --with-nrnjava
we get:
Build the nrnjava interface
checking for javac... /usr/bin/javac
checking symlink for /usr/bin/javac... /etc/alternatives/javac
checking symlink for /etc/alternatives/javac... /usr/lib/jvm/java-1.5.0-gcj/bin/javac
checking symlink for /usr/lib/jvm/java-1.5.0-gcj/bin/javac... /usr/lib/jvm/java-1.5.0-gcj/bin/../../../../bin/ecj
configure: error: cannot find java include files in /usr/lib/jvm/java-1.5.0-gcj/bin/../../../..
we can avoid this by patching the configure file and introduce:
_JTOPDIR=/usr/lib/jvm/java-1.5.0-gcj
at line 21553 of the configure file and get:
Build the nrnjava interface
checking for javac... /usr/bin/javac
checking symlink for /usr/bin/javac... /etc/alternatives/javac
checking symlink for /etc/alternatives/javac... /usr/lib/jvm/java-1.5.0-gcj/bin/javac
checking symlink for /usr/lib/jvm/java-1.5.0-gcj/bin/javac... /usr/lib/jvm/java-1.5.0-gcj/bin/../../../../bin/ecj
JDKDIR=/usr/lib/jvm/java-1.5.0-gcj
Found a path to the libjvm
/usr/lib/jvm/java-1.5.0-gcj/jre/lib/i386/client/libjvm.so
Determined JVMLIBDIR=/usr/lib/jvm/java-1.5.0-gcj/jre/lib/i386/client
JLIBDIR=/usr/lib/jvm/java-1.5.0-gcj/jre/lib/i386
Using JNI_INCLUDE_FLAGS=" -I/usr/lib/jvm/java-1.5.0-gcj/include -I/usr/lib/jvm/java-1.5.0-gcj/include/linux"
Using JVM_LIB_FLAGS="-L/usr/lib/jvm/java-1.5.0-gcj/jre/lib/i386 -L/usr/lib/jvm/java-1.5.0-gcj/jre/lib/i386/client -ljvm -lpthread"
checking checking whether the java 2 virtual machine can be created... JNI_CreateJavaVM returned 0
The present configuration allows initialization of the java 2 virtual
machine to succeed.
JCFLAGS= -I/usr/lib/jvm/java-1.5.0-gcj/include -I/usr/lib/jvm/java-1.5.0-gcj/include/linux
JLFLAGS=-L/usr/lib/jvm/java-1.5.0-gcj/jre/lib/i386 -L/usr/lib/jvm/java-1.5.0-gcj/jre/lib/i386/client -ljvm -lpthread
configure: Use the dlopen technique to load the jvm
You have no CLASSPATH, I hope it is good
checking if javac works... yes
checking for uudecode... no
configure: WARNING: I have to compile Test.class from scratch
checking if java works... yes
however the compilation fails:
make[5]: Entering directory `/home/vthierry/Desktop/nrn-6.1/src/nrnjava'
javah -classpath . -jni neuron.Neuron
javah -classpath . -jni neuron.Redirect
if /bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../.. -I../../src/oc -I../../src/oc -I../../src/parallel -I. -I../../src/nrncvode -I../../src/ivos -I../../src/sundials -I../../src/nrnpython -I../../src/nrniv -I../../src/CVODE -I../../src/nrncvode -I../../src/sparse13 -I../../src/gnu -I. -I../../src/ivoc -I../../src/nrnoc -I../oc -I../../src/oc -I/usr/local/iv/include -DOOP=1 -DCABLE=1 -DUSECVODE=1 -DUSEMATRIX=1 -DUSEBBS=1 -I/usr/lib/jvm/java-1.5.0-gcj/include -I/usr/lib/jvm/java-1.5.0-gcj/include/linux -g -O2 -MT nrnjni.lo -MD -MP -MF ".deps/nrnjni.Tpo" -c -o nrnjni.lo nrnjni.cpp; \
then mv -f ".deps/nrnjni.Tpo" ".deps/nrnjni.Plo"; else rm -f ".deps/nrnjni.Tpo"; exit 1; fi
g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../.. -I../../src/oc -I../../src/oc -I../../src/parallel -I. -I../../src/nrncvode -I../../src/ivos -I../../src/sundials -I../../src/nrnpython -I../../src/nrniv -I../../src/CVODE -I../../src/nrncvode -I../../src/sparse13 -I../../src/gnu -I. -I../../src/ivoc -I../../src/nrnoc -I../oc -I../../src/oc -I/usr/local/iv/include -DOOP=1 -DCABLE=1 -DUSECVODE=1 -DUSEMATRIX=1 -DUSEBBS=1 -I/usr/lib/jvm/java-1.5.0-gcj/include -I/usr/lib/jvm/java-1.5.0-gcj/include/linux -g -O2 -MT nrnjni.lo -MD -MP -MF .deps/nrnjni.Tpo -c nrnjni.cpp -fPIC -DPIC -o .libs/nrnjni.o
njreg.h:2: error: 'env' was not declared in this scope
njreg.h:2: error: 'Java_neuron_Neuron_getHocStringArg' was not declared in this scope
njreg.h:2: error: expected primary-expression before 'void'
njreg.h:2: error: expected `)' before 'void'
njreg.h:2: error: expected `}' before ';' token
njreg.h:2: error: expected declaration before '}' token
Other option: Is there any patch to apply, or any advice to adapt this part of the code ? This is simply the jni wrapper.
Thanks !
Detailled report:
When installing nrn on Fedora core 7 with :
./configure --with-nrnjava
we get:
Build the nrnjava interface
checking for javac... /usr/bin/javac
checking symlink for /usr/bin/javac... /etc/alternatives/javac
checking symlink for /etc/alternatives/javac... /usr/lib/jvm/java-1.5.0-gcj/bin/javac
checking symlink for /usr/lib/jvm/java-1.5.0-gcj/bin/javac... /usr/lib/jvm/java-1.5.0-gcj/bin/../../../../bin/ecj
configure: error: cannot find java include files in /usr/lib/jvm/java-1.5.0-gcj/bin/../../../..
we can avoid this by patching the configure file and introduce:
_JTOPDIR=/usr/lib/jvm/java-1.5.0-gcj
at line 21553 of the configure file and get:
Build the nrnjava interface
checking for javac... /usr/bin/javac
checking symlink for /usr/bin/javac... /etc/alternatives/javac
checking symlink for /etc/alternatives/javac... /usr/lib/jvm/java-1.5.0-gcj/bin/javac
checking symlink for /usr/lib/jvm/java-1.5.0-gcj/bin/javac... /usr/lib/jvm/java-1.5.0-gcj/bin/../../../../bin/ecj
JDKDIR=/usr/lib/jvm/java-1.5.0-gcj
Found a path to the libjvm
/usr/lib/jvm/java-1.5.0-gcj/jre/lib/i386/client/libjvm.so
Determined JVMLIBDIR=/usr/lib/jvm/java-1.5.0-gcj/jre/lib/i386/client
JLIBDIR=/usr/lib/jvm/java-1.5.0-gcj/jre/lib/i386
Using JNI_INCLUDE_FLAGS=" -I/usr/lib/jvm/java-1.5.0-gcj/include -I/usr/lib/jvm/java-1.5.0-gcj/include/linux"
Using JVM_LIB_FLAGS="-L/usr/lib/jvm/java-1.5.0-gcj/jre/lib/i386 -L/usr/lib/jvm/java-1.5.0-gcj/jre/lib/i386/client -ljvm -lpthread"
checking checking whether the java 2 virtual machine can be created... JNI_CreateJavaVM returned 0
The present configuration allows initialization of the java 2 virtual
machine to succeed.
JCFLAGS= -I/usr/lib/jvm/java-1.5.0-gcj/include -I/usr/lib/jvm/java-1.5.0-gcj/include/linux
JLFLAGS=-L/usr/lib/jvm/java-1.5.0-gcj/jre/lib/i386 -L/usr/lib/jvm/java-1.5.0-gcj/jre/lib/i386/client -ljvm -lpthread
configure: Use the dlopen technique to load the jvm
You have no CLASSPATH, I hope it is good
checking if javac works... yes
checking for uudecode... no
configure: WARNING: I have to compile Test.class from scratch
checking if java works... yes
however the compilation fails:
make[5]: Entering directory `/home/vthierry/Desktop/nrn-6.1/src/nrnjava'
javah -classpath . -jni neuron.Neuron
javah -classpath . -jni neuron.Redirect
if /bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../.. -I../../src/oc -I../../src/oc -I../../src/parallel -I. -I../../src/nrncvode -I../../src/ivos -I../../src/sundials -I../../src/nrnpython -I../../src/nrniv -I../../src/CVODE -I../../src/nrncvode -I../../src/sparse13 -I../../src/gnu -I. -I../../src/ivoc -I../../src/nrnoc -I../oc -I../../src/oc -I/usr/local/iv/include -DOOP=1 -DCABLE=1 -DUSECVODE=1 -DUSEMATRIX=1 -DUSEBBS=1 -I/usr/lib/jvm/java-1.5.0-gcj/include -I/usr/lib/jvm/java-1.5.0-gcj/include/linux -g -O2 -MT nrnjni.lo -MD -MP -MF ".deps/nrnjni.Tpo" -c -o nrnjni.lo nrnjni.cpp; \
then mv -f ".deps/nrnjni.Tpo" ".deps/nrnjni.Plo"; else rm -f ".deps/nrnjni.Tpo"; exit 1; fi
g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../.. -I../../src/oc -I../../src/oc -I../../src/parallel -I. -I../../src/nrncvode -I../../src/ivos -I../../src/sundials -I../../src/nrnpython -I../../src/nrniv -I../../src/CVODE -I../../src/nrncvode -I../../src/sparse13 -I../../src/gnu -I. -I../../src/ivoc -I../../src/nrnoc -I../oc -I../../src/oc -I/usr/local/iv/include -DOOP=1 -DCABLE=1 -DUSECVODE=1 -DUSEMATRIX=1 -DUSEBBS=1 -I/usr/lib/jvm/java-1.5.0-gcj/include -I/usr/lib/jvm/java-1.5.0-gcj/include/linux -g -O2 -MT nrnjni.lo -MD -MP -MF .deps/nrnjni.Tpo -c nrnjni.cpp -fPIC -DPIC -o .libs/nrnjni.o
njreg.h:2: error: 'env' was not declared in this scope
njreg.h:2: error: 'Java_neuron_Neuron_getHocStringArg' was not declared in this scope
njreg.h:2: error: expected primary-expression before 'void'
njreg.h:2: error: expected `)' before 'void'
njreg.h:2: error: expected `}' before ';' token
njreg.h:2: error: expected declaration before '}' token