Page 1 of 1

compilation problem --with-nrnjava

Posted: Sun Mar 16, 2008 10:42 am
by robertpa
I need to call java classes from NEURON, but I have been unable to compile nrn with the java option. I have attempted several installation types, carbonized or x-windows, NEURON versions 6.1 and 6.2 (alpha). The configure stage runs smoothly. I each case I get the following error during make of nrn:

Applications/NEURON-6.1/iv/include -DOOP=1 -DCABLE=1 -DUSECVODE=1 -DUSEMATRIX=1 -DUSEBBS=1 -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -g -O2 -MT nrnjava.lo -MD -MP -MF .deps/nrnjava.Tpo -c nrnjava.cpp -fno-common -DPIC -o .libs/nrnjava.o
./mk_njreg.sh neuron_Neuron.h njreg
./mk_njreg.sh neuron_Redirect.h njredirreg
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/Applications/NEURON-6.1/iv/include -DOOP=1 -DCABLE=1 -DUSECVODE=1 -DUSEMATRIX=1 -DUSEBBS=1 -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -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/Applications/NEURON-6.1/iv/include -DOOP=1 -DCABLE=1 -DUSECVODE=1 -DUSEMATRIX=1 -DUSEBBS=1 -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -g -O2 -MT nrnjni.lo -MD -MP -MF .deps/nrnjni.Tpo -c nrnjni.cpp -fno-common -DPIC -o .libs/nrnjni.o
/bin/sh ../../libtool --tag=CXX --mode=link g++ -g -O2 -o libnrnjava.la -rpath /Applications/NEURON-6.1/nrn/i686/lib njvm.lo nrnjava.lo nrnjni.lo
g++ -dynamiclib -single_module ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/libnrnjava.0.0.0.dylib .libs/njvm.o .libs/nrnjava.o .libs/nrnjni.o -install_name /Applications/NEURON-6.1/nrn/i686/lib/libnrnjava.0.dylib -Wl,-compatibility_version -Wl,1 -Wl,-current_version -Wl,1.0
(cd .libs && rm -f libnrnjava.0.dylib && ln -s libnrnjava.0.0.0.dylib libnrnjava.0.dylib)
(cd .libs && rm -f libnrnjava.dylib && ln -s libnrnjava.0.0.0.dylib libnrnjava.dylib)
creating libnrnjava.la
(cd .libs && rm -f libnrnjava.la && ln -s ../libnrnjava.la libnrnjava.la)
(cd . ; \
jar cf nrnclsld.jar neuron/NrnClassLoader.class \
)
( cd . ; \
mv neuron/NrnClassLoader.class NrnClassLoader.class ; \
jar cf neuron.jar neuron/*.class ; \
mv NrnClassLoader.class neuron/NrnClassLoader.class ; \
)
make[5]: *** No rule to make target `nrnccmb.jar', needed by `all-am'. Stop.
make[4]: *** [all-recursive] Error 1
make[3]: *** [all] Error 2
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

I am running Mac OS X 10.5.2 on a MacBook with 1.8GHz Intel Core 2 Duo. I have a standard installation of the developer package using gcc i686-apple-darwin9-gcc-4.0.1. The most recent version of NEURON compiles fine without Java.

Let me know if you have any other tests I can try.
Thank you for your help.

Posted: Mon Mar 17, 2008 10:56 am
by hines

Code: Select all

make[5]: *** No rule to make target `nrnccmb.jar', needed by `all-am'. Stop.
Things MIGHT work if you put the old
catacomb ccmb.jar file in your $HOME
directory. You can get a copy from
http://www.neuron.yale.edu/ftp/hines/tmp/ccmb.jar

If that does not work then the easiest
fix is to edit the nrn/src/nrnjava/Makefile.am and whenever you see the string nrnccmb or nrnccmb.jar, remove it.

I don't do anything with java anymore in favor of fully supporting Python.

Posted: Tue Mar 18, 2008 6:19 pm
by robertpa
Thank you, both of your suggestions allow 'make' to finish it's business (I had to remove several other references to nrnccmb in other make files).

Unfortunately, I'm not yet able to load java classes. load_java("java.lang.String") returns 0, as do calls to my custom classes. I have attempted to add to my library paths, so that in the latest state:
% echo $LD_LIBRARY_PATH /Users/robertpa/nrn/powerpc/lib:/Users/robertpa/iv/powerpc/lib:/Library/Java/Home/lib/:/Applications/NEURON-6.2/nrn/i686/lib:/Applications/NEURON-6.2/iv/i686/lib
Do you have any suggestions?
Thanks you, Patrick

Posted: Tue Mar 18, 2008 8:39 pm
by hines
look near the end of your installed nrn/share/nrn/lib/nrn.defaults file and
uncomment the appropriate jvmdll line. You may have to update the
path on that line as well.

Posted: Wed Mar 19, 2008 12:01 pm
by robertpa
Thanks a million! Changing the jvmdll reference in nrn.defaults did the trick.
Regards, Patrick