Compiling NEURON on Solaris 9

Post Reply
eperfa

Compiling NEURON on Solaris 9

Post by eperfa »

Hello,

I'd like to compile NEURON on a Sun supercomputer (SunFire 15k, Solaris 9) but I can't figure out why make gives me an error.

I used this command to configure

Code: Select all

./configure --prefix=`pwd` --without-iv --without-x --without-memacs CXXFLAGS="" LDFLAGS="" CFLAGS=""> conf.txt
I am of course aware of the fact that this is a serial compilation but I also had some problems with the MPI libraries on the computer so I contacted the sysadmins and now I just try to compile the rest while I'm waiting for the answer.

The error given by make is:

Code: Select all

source='ockludge.c' object='ockludge.o' libtool=no \
DEPDIR=.deps depmode=none /bin/bash ../../depcomp \
cc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../.. -I../../src/nrnoc -I. -I. -I. -I../../src/parallel -I../../src/nrnjava -I../../src/nrncvode -I../../src/ivos -I../../src/sundials -I../../src/nrnpython -I../../src/memacs -I../../src/sparse  -DOOP=1 -DINTERVIEWS=1 -DHOC=1  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64   -c ockludge.c
/bin/bash ../../libtool --tag=CC --mode=link cc      -o oc  ocmain.o ocnoiv.o nocable.o  modlreg.o ockludge.o libocxt.la liboc.la  ../nrnmpi/libnrnmpi.la -lm
cc -o .libs/oc ocmain.o ocnoiv.o nocable.o modlreg.o ockludge.o  ./.libs/libocxt.so ./.libs/liboc.so ../nrnmpi/.libs/libnrnmpi.so -lm  -R/home/eperfa/neuron/nrnalpha/sparc/lib
creating oc
Making all in nrnoc
(MODLUNIT=../../share/lib/nrnunits.lib ; \
	export MODLUNIT ; ../nmodl/nocmodl ./ )
Can't open input file: ./.mod
*** Error code 1
make: Fatal error: Command failed for target `hh.c'
Current working directory /home/eperfa/neuron/nrnalpha/src/nrnoc
*** Error code 1
make: Fatal error: Command failed for target `all-recursive'
Current working directory /home/eperfa/neuron/nrnalpha/src
*** Error code 1
make: Fatal error: Command failed for target `all-recursive'
Current working directory /home/eperfa/neuron/nrnalpha
*** Error code 1
make: Fatal error: Command failed for target `all'
I can't find any previous errors that could cause this and I don't really understand it either so any help would be greatly appreciated.

The output of config and make can be viewed here (they were too long to be copied here)
http://users.itk.ppke.hu/~divad/config_serial.log
http://users.itk.ppke.hu/~divad/make_serial.log

(I did see the posts about compilation on other supercomputers, like BlueGene, and that they required a two-step config-make-make install round, but as far as I understand, those were cross-compilations. I do everything on the server itself, so this is not necessary - is this right? When I tried doing things that way I got a different error which I can't recall now. If it has any relevance I'll reproduce it.)

(Mod: I did try using both the stable and the alpha version.)

Thank you,
Adam
hines
Site Admin
Posts: 1600
Joined: Wed May 18, 2005 3:32 pm

Re: Compiling NEURON on Solaris 9

Post by hines »

(MODLUNIT=../../share/lib/nrnunits.lib ; \
export MODLUNIT ; ../nmodl/nocmodl ./ )
Can't open input file: ./.mod
The problem is that the arg to nocmodl is incorrect. There should have been a series of *.mod translations with the first being:

Code: Select all

(MODLUNIT=../../share/lib/nrnunits.lib ; \
                export MODLUNIT ; ../nmodl/nocmodl ./hh )
Translating ./hh.mod into ./hh.c
...
I just tried this with the new standard distribution
http://www.neuron.yale.edu/ftp/neuron/v ... 7.1.tar.gz
using
./configure --prefix=`pwd` --without-x --without-memacs
(--without-x also invokes --without-iv and was there a reason to specify CFLAGS, etc?)

I would try again with a fresh set of sources and also look into nrn-7.1/src/nrnoc and make sure hh.mod is
present. If the error persists, does nrn-7.1/src/nmod/nocmodl exist?
eperfa

Re: Compiling NEURON on Solaris 9

Post by eperfa »

I downloaded the fresh sources and did the whole thing again just to make sure, but the error is the same. Both of the files you asked about exist.
The CFLAGS etc. were included to temporarily bypass some machine-specific optimizations, otherwise they're irrelevant.

(The problem with the MPI library was solved in the meantime, so the config now looks a bit different, but it didn't make any difference, the error is the same)

Code: Select all

./configure --prefix=`pwd` --without-iv --without-x --without-memacs --with-paranrn CXXFLAGS="-mt -lmpi" LDFLAGS="" CFLAGS="-lmpi" CC="mpcc" CXX="mpCC"
Do you happen to have any other ideas?

Thanks,
Adam
hines
Site Admin
Posts: 1600
Joined: Wed May 18, 2005 3:32 pm

Re: Compiling NEURON on Solaris 9

Post by hines »

Which version of 'make' is being used. If it is not a gnu version, I'd try that.
More directly, you can edit the src/nrnoc/Makefile and change all $(*F) with
the proper mod prefix i.e the fragment

hh.c: hh.mod $(NMODL)
(MODLUNIT=$(top_srcdir)/share/lib/nrnunits.lib ; \
export MODLUNIT ; $(NMODL) $(srcdir)/$(*F) )
sed "s/_reg()/_reg_()/" $(srcdir)/$(*F).c > $*.tmp
mv $*.tmp $(srcdir)/$(*F).c

would be made to look like:

hh.c: hh.mod $(NMODL)
(MODLUNIT=$(top_srcdir)/share/lib/nrnunits.lib ; \
export MODLUNIT ; $(NMODL) $(srcdir)/hh )
sed "s/_reg()/_reg_()/" $(srcdir)/hh.c > $*.tmp
mv $*.tmp $(srcdir)/hh.c

There are about a dozen of these with different prefixes such as feature, passive, stim, etc.
eperfa

Re: Compiling NEURON on Solaris 9

Post by eperfa »

It was Sun's own version of make (which doesn't even provide version information as far as I can see...).
Doing the substitutions in the Makefile did make a difference, the files in nrnoc are now compiled but libnrnoc itself could still not be linked.

I then tried GNU make (on a fresh source, just to make sure) and it yields the same result

Code: Select all

bash-2.05$ /opt/sfw/bin/gmake -v
GNU Make version 3.79.1, by Richard Stallman and Roland McGrath.
Built for sparc-sun-solaris2.9

Code: Select all

source='ocnoiv.c' object='ocnoiv.o' libtool=no \
DEPDIR=.deps depmode=none /bin/bash ../../depcomp \
mpcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../.. -I. -I../../src/oc -I../../src/o
c -I../../src/oc -I../../src/parallel -I../../src/nrnjava -I../../src/nrncvode -I../.
./src/ivos -I../../src/sundials -I../../src/nrnpython -I../../src/oc -I../../src/oc -
I../../src/scopmath -I../../src/sparse13 -DCABLE=1 -DOOP=1  -D_REENTRANT  -lmpi -c oc
noiv.c
...
(warnings here)
...
source='cprop.c' object='cprop.o' libtool=no \
DEPDIR=.deps depmode=none /bin/bash ../../depcomp \
mpcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../.. -I. -I../../src/oc -I../../src/o
c -I../../src/oc -I../../src/parallel -I../../src/nrnjava -I../../src/nrncvode -I../.
./src/ivos -I../../src/sundials -I../../src/nrnpython -I../../src/oc -I../../src/oc -
I../../src/scopmath -I../../src/sparse13 -DCABLE=1 -DOOP=1  -D_REENTRANT  -lmpi -c cp
rop.c
"cprop.c", line 17: warning: implicit function declaration: hoc_malchk
/bin/bash ../../libtool --tag=CC --mode=link mpcc -D_REENTRANT  -lmpi   -o nrnoc  ocm
ain.o nrnnoiv.o ocnoiv.o cprop.o ../oc/modlreg.o libnrnoc.la ../oc/liboc.la ../scopma
th/libscopmath.la ../sparse13/libsparse13.la ../nrnmpi/libnrnmpi.la -lpthread -lm
mpcc -D_REENTRANT -o .libs/nrnoc ocmain.o nrnnoiv.o ocnoiv.o cprop.o ../oc/modlreg.o
 ./.libs/libnrnoc.so ../oc/.libs/liboc.so ../scopmath/.libs/libscopmath.so ../sparse1
3/.libs/libsparse13.so ../nrnmpi/.libs/libnrnmpi.so -lmpi -lpthread -lm  -R/home/eper
fa/neuron/nrn/sparc/lib
Undefined                       first referenced
 symbol                             in file
sched_setaffinity                   ./.libs/libnrnoc.so
ld: fatal: Symbol referencing errors. No output written to .libs/nrnoc
gmake[4]: *** [nrnoc] Error 1
gmake[4]: Leaving directory `/home/eperfa/neuron/nrn/src/nrnoc'
The full log can be accessed here: http://users.itk.ppke.hu/~divad/gmake.log

I included /usr/include in my $LD_LIBRARY_PATH just to make sure it was not the cause of failure (it is where Solaris keeps sched.h) but it didn't make any difference.
After a bit of googling I found that sched_setaffinity is a function provided by the Linux kernel but not Solaris so I guess it's not something to be used in an environment like this.
Both Linux and the Solaris OS support the notion of binding a process or thread to a processor. Linux allows binding to a set of processors for non-exclusive use of those processors. The Solaris OS allows binding to a set of processors for exclusive use, (that is, CPU fencing), but does not allow binding to a group for non-exclusive use (except via Solaris Zones?). Linux does not have a mechanism for CPU fencing, though implementations can be found on the web (see, for example, the CPUSETS for Linux page on the bullopensource.org site). The Linux system calls that are processor affinity based are sched_setaffinity(2) and sched_getaffinity(2). The Solaris OS has the following:
processor_bind(2) to bind/unbind LWPs or processes to a processor
pset_create(2) to set up a processor set
pbind(1) and psrset(1), which are command-line interfaces
From: http://developers.sun.com/solaris/artic ... x_app.html

I'm no expert in these fields but I found only one call to the sched_setaffinity function, in src/nrnoc/multicore.c, in the following function

Code: Select all

void setaffinity(int i) {
	int mask;
return;
#if 0
	cpu_set_t mask;
	CPU_ZERO(&mask);
	CPU_SET(i, &mask);
#endif
	mask = (1 << i);
	sched_setaffinity(0, 4, &mask);
}
The return statement in the second line, to my understanding, means that the sched_setaffinity function will never actually get called - so I temporarily removed (commented) it and tried to compile the whole thing yet again.

Code: Select all

source='Binomial.cpp' object='Binomial.lo' libtool=yes \
DEPDIR=.deps depmode=none /bin/bash ../../depcomp \
/bin/bash ../../libtool --tag=CXX --mode=compile mpCC -DHAVE_CONFIG_H -I. -I. -I../..
 -I../.. -I../.. -I../../src/nrnoc -I../../src/oc -I../../src/oc -I../../src/oc -I../
../src/parallel -I../../src/nrnjava -I../../src/nrncvode -I../../src/ivos -I../../src
/sundials -I../../src/nrnpython -I../../src/ivos    -mt -lmpi -c -o Binomial.lo Binom
ial.cpp
 mpCC -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../.. -I../../src/nrnoc -I../../src/o
c -I../../src/oc -I../../src/oc -I../../src/parallel -I../../src/nrnjava -I../../src/
nrncvode -I../../src/ivos -I../../src/sundials -I../../src/nrnpython -I../../src/ivos
 -mt -lmpi -c Binomial.cpp  -DPIC -o .libs/Binomial.o
"./neuron_gnu_builtin.h", line 112: Error: std::abs(float) already had a body defined.
"./neuron_gnu_builtin.h", line 123: Error: std::abs(long) already had a body defined.
2 Error(s) detected.
gmake[3]: *** [Binomial.lo] Error 1
gmake[3]: Leaving directory `/home/eperfa/neuron/nrn/src/gnu'
Right now I'm way too tired to find the cause of this but I'll take another look at it tomorrow - though I'd really appreciate any ideas if you still have a few moments for this.

Thanks,
Adam
hines
Site Admin
Posts: 1600
Joined: Wed May 18, 2005 3:32 pm

Re: Compiling NEURON on Solaris 9

Post by hines »

I hate the (f)abs function. It is hard to make portable. Sometimes the system defines it as a macro, sometimes as a real function, sometimes
in a namespace. In this case it seems promising merely to comment out the two implementations.
eperfa

Re: Compiling NEURON on Solaris 9

Post by eperfa »

Commenting out the implementations did the trick for that error and paved the road for the next one..

Code: Select all

/bin/bash ../../libtool --tag=CXX --mode=link mpCC  -mt -lmpi   -o libivoc.la -rpath /home/eperfa/neuron/nrn/sparc/lib  ivoc.lo xmenu.lo graph.lo rubband.lo grmanip.lo apwindow.lo pwman.lo scene.lo xyview.lo rect.lo mymath.lo axis.lo utility.lo idraw.lo symchoos.lo htlist.lo ocpicker.lo scenepic.lo oclist.lo ocbrowsr.lo objcmd.lo ocbox.lo ocfile.lo hocmark.lo oc2iv.lo epsprint.lo ivocvect.lo ivocrand.lo octimer.lo ocdeck.lo bndedval.lo ochelp.lo checkpnt.lo graphvec.lo strfun.lo ocobserv.lo fourier.lo cbwidget.lo matrix.lo ocmatrix.lo ocpointer.lo gifimage.lo ocnoiv1.lo grglyph.lo mlinedit.lo xdep.lo field.lo ivocman1.lo  -lm
(cd .libs && rm -f libivoc.so.0 && ln -s libivoc.so.0.0.0 libivoc.so.0)
(cd .libs && rm -f libivoc.so && ln -s libivoc.so.0.0.0 libivoc.so)
creating libivoc.la
(cd .libs && rm -f libivoc.la && ln -s ../libivoc.la libivoc.la)
source='nrnmain.cpp' object='nrnmain.o' libtool=no \
DEPDIR=.deps depmode=none /bin/bash ../../depcomp \
mpCC -Dmotif_kit -Dsgi_motif_kit -Dopenlook_kit -Dbw_kit -Ddefault_kit=SMFKit -DUSEGNU=1 -DUSEMATRIX -I. -I. -I../.. -I../.. -I../.. -I../../src/nrnoc -I../../src/oc -I../../src/oc -I../../src/oc -I../../src/parallel -I../../src/nrnjava -I../../src/nrncvode -I../../src/ivos -I../../src/sundials -I../../src/nrnpython -I../../src/gnu -I../../src/mesch -I../../src/oc -I../../src/oc -I../../src/ivos     -mt -lmpi -c -o nrnmain.o nrnmain.cpp
source='ivocmain.cpp' object='ivocmain.o' libtool=no \
DEPDIR=.deps depmode=none /bin/bash ../../depcomp \
mpCC -Dmotif_kit -Dsgi_motif_kit -Dopenlook_kit -Dbw_kit -Ddefault_kit=SMFKit -DUSEGNU=1 -DUSEMATRIX -I. -I. -I../.. -I../.. -I../.. -I../../src/nrnoc -I../../src/oc -I../../src/oc -I../../src/oc -I../../src/parallel -I../../src/nrnjava -I../../src/nrncvode -I../../src/ivos -I../../src/sundials -I../../src/nrnpython -I../../src/gnu -I../../src/mesch -I../../src/oc -I../../src/oc -I../../src/ivos     -mt -lmpi -c -o ivocmain.o ivocmain.cpp
"ivocmain.cpp", line 448: Warning: String literal converted to char* in assignment.
1 Warning(s) detected.
source='classreg.cpp' object='classreg.o' libtool=no \
DEPDIR=.deps depmode=none /bin/bash ../../depcomp \
mpCC -Dmotif_kit -Dsgi_motif_kit -Dopenlook_kit -Dbw_kit -Ddefault_kit=SMFKit -DUSEGNU=1 -DUSEMATRIX -I. -I. -I../.. -I../.. -I../.. -I../../src/nrnoc -I../../src/oc -I../../src/oc -I../../src/oc -I../../src/parallel -I../../src/nrnjava -I../../src/nrncvode -I../../src/ivos -I../../src/sundials -I../../src/nrnpython -I../../src/gnu -I../../src/mesch -I../../src/oc -I../../src/oc -I../../src/ivos     -mt -lmpi -c -o classreg.o classreg.cpp
source='datapath.cpp' object='datapath.o' libtool=no \
DEPDIR=.deps depmode=none /bin/bash ../../depcomp \
mpCC -Dmotif_kit -Dsgi_motif_kit -Dopenlook_kit -Dbw_kit -Ddefault_kit=SMFKit -DUSEGNU=1 -DUSEMATRIX -I. -I. -I../.. -I../.. -I../.. -I../../src/nrnoc -I../../src/oc -I../../src/oc -I../../src/oc -I../../src/parallel -I../../src/nrnjava -I../../src/nrncvode -I../../src/ivos -I../../src/sundials -I../../src/nrnpython -I../../src/gnu -I../../src/mesch -I../../src/oc -I../../src/oc -I../../src/ivos     -mt -lmpi -c -o datapath.o datapath.cpp
source='ocjump.cpp' object='ocjump.o' libtool=no \
DEPDIR=.deps depmode=none /bin/bash ../../depcomp \
mpCC -Dmotif_kit -Dsgi_motif_kit -Dopenlook_kit -Dbw_kit -Ddefault_kit=SMFKit -DUSEGNU=1 -DUSEMATRIX -I. -I. -I../.. -I../.. -I../.. -I../../src/nrnoc -I../../src/oc -I../../src/oc -I../../src/oc -I../../src/parallel -I../../src/nrnjava -I../../src/nrncvode -I../../src/ivos -I../../src/sundials -I../../src/nrnpython -I../../src/gnu -I../../src/mesch -I../../src/oc -I../../src/oc -I../../src/ivos     -mt -lmpi -c -o ocjump.o ocjump.cpp
"ocjump.cpp", line 245: Warning (Anachronism): Assigning void(*)() to extern "C" void(*)().
1 Warning(s) detected.
source='symdir.cpp' object='symdir.o' libtool=no \
DEPDIR=.deps depmode=none /bin/bash ../../depcomp \
mpCC -Dmotif_kit -Dsgi_motif_kit -Dopenlook_kit -Dbw_kit -Ddefault_kit=SMFKit -DUSEGNU=1 -DUSEMATRIX -I. -I. -I../.. -I../.. -I../.. -I../../src/nrnoc -I../../src/oc -I../../src/oc -I../../src/oc -I../../src/parallel -I../../src/nrnjava -I../../src/nrncvode -I../../src/ivos -I../../src/sundials -I../../src/nrnpython -I../../src/gnu -I../../src/mesch -I../../src/oc -I../../src/oc -I../../src/ivos     -mt -lmpi -c -o symdir.o symdir.cpp
"symdir.cpp", line 109: Warning (Anachronism): Formal argument 4 of type extern "C" int(*)(const void*,const void*) in call to std::qsort(void*, unsigned, unsigned, extern "C" int(*)(const void*,const void*)) is being passed int(*)(const void*,const void*).
"symdir.cpp", line 362: Warning: String literal converted to char* in formal argument 2 in call to SymbolItem::concat(char*, char*).
2 Warning(s) detected.
/bin/bash ../../libtool --tag=CXX --mode=link mpCC  -mt -lmpi   -o ivoc  nrnmain.o ivocmain.o classreg.o datapath.o ocjump.o symdir.o ../oc/nocable.o ../oc/modlreg.o ../oc/libocxt.la ../oc/liboc.la libivoc.la ../nrnmpi/libnrnmpi.la ../mesch/libmeschach.la ../gnu/libneuron_gnu.la ../ivos/libivos.la    -lm
mpCC -mt -o .libs/ivoc nrnmain.o ivocmain.o classreg.o datapath.o ocjump.o symdir.o ../oc/nocable.o ../oc/modlreg.o  ../oc/.libs/libocxt.so ../oc/.libs/liboc.so ./.libs/libivoc.so ../nrnmpi/.libs/libnrnmpi.so ../mesch/.libs/libmeschach.so ../gnu/.libs/libneuron_gnu.so ../ivos/.libs/libivos.so -lmpi -lm 
ld: fatal: file ./.libs/libivoc.so: open failed: No such file or directory
ld: fatal: file ../gnu/.libs/libneuron_gnu.so: open failed: No such file or directory
ld: fatal: file ../ivos/.libs/libivos.so: open failed: No such file or directory
ld: fatal: File processing errors. No output written to .libs/ivoc
gmake[3]: *** [ivoc] Error 1
gmake[3]: Leaving directory `/home/eperfa/neuron/nrn/src/ivoc'
I didn't see any errors regarding the compilation of any of the missing libraries but none of them exists. I'm not a makefile guru at all but I fail to see where these libs should have been built. (The beginning of the snippet is the first occurrence of 'libivoc', so I really don't see where lobivoc.so should have been created)

I'm really sorry to bother you with all these.
hines
Site Admin
Posts: 1600
Joined: Wed May 18, 2005 3:32 pm

Re: Compiling NEURON on Solaris 9

Post by hines »

libtool seems to be having problems. What are the contents of nrn/src/ivoc/.libs ?
Since there could be a flurry of messages to diagnose this, let's take it to email and
when it is fixed we can summarize here.
Send to michael dot hines at yale dot edu
hines
Site Admin
Posts: 1600
Joined: Wed May 18, 2005 3:32 pm

Re: Compiling NEURON on Solaris 9

Post by hines »

Some experimentation revealed that configure gets confused on this machine when CXX is defined as mpCC.
A working configure statement is:
$ ./configure --prefix=`pwd` --without-x --with-paranrn MPICC=mpcc MPICXX=mpCC CC=cc CXX=CC LDFLAGS='-lmpi'
gmake
gmake install

Also some minor fixes and configure tests were necessary to avoid some compile errors for sparc-sun-solaris2.9. See
http://www.neuron.yale.edu/hg/neuron/nr ... 76737394d5

gmake is required.
eperfa

Re: Compiling NEURON on Solaris 9

Post by eperfa »

Thanks again Michael.
eperfa

Re: Compiling NEURON on Solaris 9

Post by eperfa »

One more bit to add:
After running nrnivmodl, calling nrniv on that model will not work. You should directly execute sparc/special instead

Michael provided the solution for this one as well, thanks.
Post Reply