Problems making nrn-5.9.39 in G5 PowerPC

Post Reply
jaambros
Posts: 29
Joined: Tue Oct 04, 2005 3:29 pm
Location: Ohio University

Problems making nrn-5.9.39 in G5 PowerPC

Post by jaambros »

Hi,

I'm installing from source on a G5 powerPC
$ uname -a
Darwin firestone.sf.osc.edu 8.5.0 Darwin Kernel Version 8.5.0: Sun Jan 22 10:38:46 PST 2006; root:xnu-792.6.61.obj~1/RELEASE_PPC Power Macintosh powerpc

iv configures and makes OK except for the following warning:

Code: Select all

$ make > make.out
InterViews/tiff.cpp:36:1: warning: "howmany" redefined
In file included from /usr/include/sys/select.h:144,
                 from /usr/include/unistd.h:483,
                 from /usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/gthr-default.h:38,
                 from /usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/gthr.h:98,
                 from /usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/c++io.h:37,
                 from /usr/include/gcc/darwin/3.3/c++/bits/fpos.h:44,
                 from /usr/include/gcc/darwin/3.3/c++/iosfwd:49,
                 from /usr/include/gcc/darwin/3.3/c++/ios:44,
                 from /usr/include/gcc/darwin/3.3/c++/ostream:45,
                 from /usr/include/gcc/darwin/3.3/c++/iostream:45,
                 from ../include/ivstrm.h:23,
                 from ../include/ivstream.h:11,
                 from ../../config.h:212,
                 from InterViews/tiff.cpp:2:
/usr/include/sys/types.h:223:1: warning: this is the location of the previous definition
However, I'm unable to make nrn. Configure works fine, but I get the following error with make

Code: Select all

$ make > make.out
termio.c: In function `emacs_ttopen':
termio.c:213: error: `TCGETA' undeclared (first use in this function)
termio.c:213: error: (Each undeclared identifier is reported only once
termio.c:213: error: for each function it appears in.)
termio.c:215: error: invalid use of undefined type `struct termio'
termio.c:216: error: invalid use of undefined type `struct termio'
termio.c:217: error: invalid use of undefined type `struct termio'
termio.c:218: error: invalid use of undefined type `struct termio'
termio.c:219: error: `TCSETA' undeclared (first use in this function)
termio.c: In function `emacs_ttclose':
termio.c:264: error: `TCSETA' undeclared (first use in this function)
/usr/include/libkern/OSByteOrder.h: At top level:
termio.c:125: error: storage size of `ostate' isn't known
termio.c:126: error: storage size of `nstate' isn't known
make[3]: *** [termio.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Any help in solving this would be greatly appreciated.

Thanks in advance,
jaambros
Posts: 29
Joined: Tue Oct 04, 2005 3:29 pm
Location: Ohio University

Post by jaambros »

I forgot to list the command in make that triggered the error.
Here it is

Code: Select all

 gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../.. -I../../src/oc -I../../src/oc -I../../src/parallel -I../../src/nrnjava -I../../src/nrncvode -I../../src/ivos -I../../src/sundials -I../../src/nrnpython -g -O2 -MT termio.lo -MD -MP -MF .deps/termio.Tpo -c termio.c  -fno-common -DPIC -o .libs/termio.o
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Post by hines »

You did not say what configure lines you used. Did you add the --enable-carbon argument?
The way I would diagnose the problem further would be to look at line 213 of
nrn/src/memacs/termio.c and notice that it presumes that HAVE_TERMIO_H
is defined. From this I see that
#include <termio.h>
is included. Then I check to see if TCGETA is defined anywhere in the /usr/include files
with
find /usr/include -name \*.h -exec grep "TCGETA" \{\} \; -print
Sure enough, (on a LINUX machine) it is in /usr/include/term.h which turns out to be
eventually included by termio.h .


Here are some build recipes I use for darwin
Choose one of the two preparation recipes and then do the build recipe.

# preparation option 1: checkout from the subversion repository
cd $HOME
mkdir neuron
cd neuron
svn checkout http://www.neuron.yale.edu/svn/neuron/iv/trunk iv
svn checkout http://www.neuron.yale.edu/svn/neuron/nrn/trunk nrn
cd iv
sh build.sh
cd ../nrn
sh build.sh

# preparation option 2: or else get and extract the tar.gz files
cd $HOME
mkdir neuron
cd neuron
wget http://www.neuron.yale.edu/ftp/neuron/v ... -17.tar.gz
#look at http://www.neuron.yale.edu/ftp/neuron/versions/alpha to see the latest.
wget http://www.neuron.yale.edu/ftp/neuron/v ... 461.tar.gz
gunzip -c iv*gz|tar xf -
mv iv-17 iv
gunzip -c nrn*gz|tar xf -
mv nrn-5.9 nrn

#after preparation, then build

# configure, make, install iv
cd $HOME/neuron/iv
./configure --prefix=/Applications/NEURON-5.9/iv --enable-carbon
make
make install

# configure, make, install nrn
cd $HOME/neuron/nrn
./configure --prefix=/Applications/NEURON-5.9/nrn \
--with-iv=/Applications/NEURON-5.9/iv --enable-carbon
make
make install
make after_install
###############################################
jaambros
Posts: 29
Joined: Tue Oct 04, 2005 3:29 pm
Location: Ohio University

Post by jaambros »

In the previous attempts I used

Code: Select all

./configure --prefix=`pwd`
because I'm intertested in the X11 version.

I tried using recipe 2 and got the same errors as before.
However, using --enable-carbon produced several new errors when making iv

Code: Select all

$ ./configure --prefix=`pwd` --enable-carbon > configure.out; make > make.out
IV-Mac/bitmap.cpp:44:27: IV-MAC/bitmap.h: No such file or directory
IV-Mac/bitmap.cpp: In constructor `ivBitmap::ivBitmap(const void*, unsigned 
   int, unsigned int, int, int)':
IV-Mac/bitmap.cpp:97: error: invalid use of undefined type `struct ivBitmapRep'
../include/InterViews/bitmap.h:37: error: forward declaration of `struct 
   ivBitmapRep'
... a Lot more like this ....
My initial attempts to locate where TCGETA might be defined in this machine were not succesful. Your search lines yields

Code: Select all

$ find /usr/include -name \*.h -exec grep "TCGETA" \{\} \; -print
#define HAVE_TCGETATTR 1
/usr/include/mysql/my_config.h
#define HAVE_TCGETATTR 1
/usr/include/net-snmp/net-snmp-config.h
#undef  HAVE_TCGETATTR
#define HAVE_TCGETATTR 1
#if HAVE_TERMIOS_H && HAVE_TCGETATTR
#define tcgetattr(fd, arg) ioctl(fd, TCGETA, arg)
/usr/include/term.h
The G5 where I'm trying to install is at the Ohio Supercomputer Center and I have little administrative control. It may be that we don't have the full SDK.
As an alternative to get this installed, how about making the executable in my 10.4 G5 and copying over. Would this be easy to do?

Thanks for all your help
jaambros
Posts: 29
Joined: Tue Oct 04, 2005 3:29 pm
Location: Ohio University

Post by jaambros »

Today I tried to install the nrn-5.9.39-powerpc-apple-darwin8.6.0.dmg on the Ohio Supercomputer center (OSC) G5 OSX 10.4.
I used

Code: Select all

$ hdiutil attach nrn-5.9.39-powerpc-apple-darwin8.6.0.dmg 
to mount the dmg. However, I wasnt able to start the executables.
I get the following error:

Code: Select all

$ /Volumes/NEURON-5.9/NEURON-5.9/nrn/powerpc/bin/nrniv
dyld: Library not loaded: /Applications/NEURON-5.9/nrn/powerpc/lib/libnrnoc.0.dylib
  Referenced from: /Volumes/NEURON-5.9/NEURON-5.9/nrn/powerpc/bin/./nrniv
  Reason: image not found
Trace/BPT trap
It appears that it's attempting to locate the library in the /Applications folder. Is this how its supposed to work?
Do you have to install the dmg image in Applications?

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

Post by hines »

Do you have to install the dmg image in Applications?
No. It is supposed to be position independent. There must be a problem with my mac environment in which it is linking an existing installed /Applications/... library using the full path instead of the intended relative path. I'll have to go back to the drawing board and find out why and put a fixed dmg into the alpha distribution directory. I'll try to fix it before I leave for the European CNS course tomorrow.
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Post by hines »

I'm intertested in the X11 version.
Ok. Let's forget the problems that arose in response to the --enable-carbon option.
how about making the executable in my 10.4 G5 and copying over.
Given that you are copying onto a 10.5 that becomes an experimental question. I'm guessing you will see shared library
incompatibilities but it is worth a try.

I think a promising line is to force HAVE_TERMIO_H in nrnconf.h to be undefined and try building again. Also, if this is to be run on a supercomputer will you only be running in batch mode or interactively? If the former, you can avoid all the termcap stuff with the
--without-memacs configure option.
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Post by hines »

I uploaded a new dmg
http://www.neuron.yale.edu/ftp/neuron/v ... n8.7.0.dmg
which sets the DYLD_LIBRARY_PATH correctly when NEURON is not installed in /Applications/NEURON-5.9 . I assume the problem was only with the mos2nrn icon. The dmg was built under darwin8.7.0 which according to the "about this mac" is 10.4.7. The compiler is gcc version 4.0.0
jaambros
Posts: 29
Joined: Tue Oct 04, 2005 3:29 pm
Location: Ohio University

Post by jaambros »

Code: Select all

-without-memacs configure option
did the trick. I was able to make nrniv with no gui.
Thanks.

PS. I did get a few warnings

Code: Select all

firestone:~/Software/src/Neuron/nrn ohu0256$ make > make.out
In file included from init.c:59:
osxdlfcn.c: In function `dlopen':
osxdlfcn.c:118: warning: passing arg 2 of `_dyld_func_lookup' from incompatible pointer type
osxdlfcn.c: In function `dlsymIntern':
osxdlfcn.c:155: warning: assignment from incompatible pointer type
osxdlfcn.c:172: warning: assignment from incompatible pointer type
osxdlfcn.c:178: warning: assignment from incompatible pointer type
osxdlfcn.c:186: warning: passing arg 1 of `NSAddressOfSymbol' from incompatible pointer type
ld: warning multiple definitions of symbol _dlclose
.libs/init.o definition of _dlclose in section (__TEXT,__text)
/usr/lib/libSystem.dylib(dyldAPIsInLibSystem.o) definition of _dlclose
ld: warning multiple definitions of symbol _dlerror
.libs/init.o definition of _dlerror in section (__TEXT,__text)
/usr/lib/libSystem.dylib(dyldAPIsInLibSystem.o) definition of _dlerror
ld: warning multiple definitions of symbol _dlopen
.libs/init.o definition of _dlopen in section (__TEXT,__text)
/usr/lib/libSystem.dylib(dyldAPIsInLibSystem.o) definition of _dlopen
ld: warning multiple definitions of symbol _dlsym
.libs/init.o definition of _dlsym in section (__TEXT,__text)
/usr/lib/libSystem.dylib(dyldAPIsInLibSystem.o) definition of _dlsym
ld: warning multiple definitions of symbol _dlclose
/usr/lib/libSystem.dylib(dyldAPIsInLibSystem.o) definition of _dlclose
./.libs/libnrnoc.dylib(init.o) definition of _dlclose
ld: warning multiple definitions of symbol _dlerror
/usr/lib/libSystem.dylib(dyldAPIsInLibSystem.o) definition of _dlerror
./.libs/libnrnoc.dylib(init.o) definition of _dlerror
ld: warning multiple definitions of symbol _dlopen
/usr/lib/libSystem.dylib(dyldAPIsInLibSystem.o) definition of _dlopen
./.libs/libnrnoc.dylib(init.o) definition of _dlopen
ld: warning multiple definitions of symbol _dlsym
/usr/lib/libSystem.dylib(dyldAPIsInLibSystem.o) definition of _dlsym
./.libs/libnrnoc.dylib(init.o) definition of _dlsym
ld: warning suggest use of -bind_at_load, as lazy binding may result in errors or different symbols being used
firestone:~/Software/src/Neuron/nrn ohu0256$
Post Reply