nrnjava on fedora 7 in order to use neuroconstruct

Post Reply
ThierryVieville
Posts: 1
Joined: Fri Dec 21, 2007 5:56 am
Contact:

nrnjava on fedora 7 in order to use neuroconstruct

Post by ThierryVieville »

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
pgleeson
Posts: 6
Joined: Wed Oct 26, 2005 1:43 pm
Location: UCL
Contact:

nrnjava and neuroconstruct

Post by pgleeson »

You don't need to have java enabled in NEURON to get neuroConstruct to work. The Java interface was put in a few years back to use Robert Cannon's Channel Builder I believe, but that was eventually re written in hoc. I tried using the java interface initially (4 years ago...) for interaction with neuroConstruct and it was a bit unstable and there were install issues. I don't know of anyone else using it at the moment, and am pretty sure it hasn't been looked at recently.

If you do need to interface external code with NEURON, the Python interface is much better and is being actively worked on.

Regards,
Padraig
Post Reply