compilation problem --with-nrnjava

Post Reply
robertpa
Posts: 3
Joined: Sun Mar 16, 2008 10:20 am

compilation problem --with-nrnjava

Post 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.
hines
Site Admin
Posts: 1600
Joined: Wed May 18, 2005 3:32 pm

Post 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.
robertpa
Posts: 3
Joined: Sun Mar 16, 2008 10:20 am

Post 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
hines
Site Admin
Posts: 1600
Joined: Wed May 18, 2005 3:32 pm

Post 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.
robertpa
Posts: 3
Joined: Sun Mar 16, 2008 10:20 am

Post by robertpa »

Thanks a million! Changing the jvmdll reference in nrn.defaults did the trick.
Regards, Patrick
Post Reply