Mac OS X Build error

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
gartland

Mac OS X Build error

Post by gartland »

Hi,
can somebody spot me some help with building NEURON-6.0 on a Mac OS X? I have a good installation of python2.5 with numpy and scipy. I can build NEURON without the '--with-nrnpython' parameter. When I add that and try to run configure i get the output below. It looks like a simple problem of not finding a certain library or something, but I'm no expert in linux or mac osx or python so i can't seem to solve the problem. It looks like the PYINCDIR is right though. I attached the config.log too if that helps. thanks for any help you can offer!

i guess i can't attach the config.log but i will happily email it along if you think it will help.

-Andrew Gartland



./configure --with-nrnpython=/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5 --prefix=/home/peterdetwiler/neuron/nrn-6.0 --with-iv=/home/peterdetwiler/neuron/iv --enable-carbon
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking build system type... powerpc-apple-darwin8.10.0
checking host system type... powerpc-apple-darwin8.10.0
checking for style of include used by make... GNU
checking for g++... g++
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
Not trying to build rpms for your system (use --enable-rpm-rules to override)
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for gawk... (cached) awk
checking for a BSD-compatible install... /usr/bin/install -c
checking for flex... flex
checking for yywrap in -lfl... yes
checking lex output file root... lex.yy
checking whether yytext is a pointer... yes
checking for bison... bison -y
checking whether ln -s works... yes
checking for a sed that does not truncate output... /usr/bin/sed
checking for egrep... grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -p
checking how to recognise dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... g++ -E
checking for g77... g77
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether g77 accepts -g... yes
checking the maximum length of command line arguments... 65536
checking command to parse /usr/bin/nm -p output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc static flag works... yes
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fno-common
checking if gcc PIC flag -fno-common works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin8.10.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking for dlopen in -ldl... yes
checking whether a program can dlopen itself... yes
checking whether a statically linked program can dlopen itself... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fno-common
checking if g++ PIC flag -fno-common works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin8.10.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking for dlopen in -ldl... (cached) yes
checking whether a program can dlopen itself... (cached) yes
checking whether a statically linked program can dlopen itself... (cached) yes
appending configuration tag "F77" to libtool
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for g77 option to produce PIC... -fno-common
checking if g77 PIC flag -fno-common works... yes
checking if g77 supports -c -o file.o... yes
checking whether the g77 linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin8.10.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
configure: Use the NRNMECH_DLL_STYLE for "special"
checking for tgetent in -lncurses... yes
checking which library has the termcap functions... using libncurses
checking checking compilation with -lreadline... ok
Do not compile neosim specific code.
Not building the nrnjava interface
Make the carbon version on max os x
Python binary found (/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5)
checking nrnpython configuration... VERSION 2.5
INCLUDEDIR /Library/Frameworks/Python.framework/Versions/2.5/include
LIBS -ldl
LINKFORSHARED -u _PyMac_Error Python.framework/Versions/2.5/Python
checking if python include files and libraries work... configure: error: could not run a test that used the python library.
Examine config.log to see error details. Something wrong with
PYLIB=-u _PyMac_Error Python.framework/Versions/2.5/Python
or
PYINCDIR=/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5
hines
Site Admin
Posts: 1687
Joined: Wed May 18, 2005 3:32 pm

Post by hines »

A workaround under OS X for now is to add

Code: Select all

PYLIB=-lpython PYLIBLINK=-lpython
to the configure line. You may also have to remove the mention of
ivocman1.cpp from the libivoc_la_SOURCES in src/ivoc/Makefile.am
to eliminate some multiple definitions. Finally you may have to
make

Code: Select all

void (*nrnpy_py2n_component)...
extern void to prevent another multiple definition error.
In the next few days I hope to resolve these issues without breaking
the code for other machines.
hines
Site Admin
Posts: 1687
Joined: Wed May 18, 2005 3:32 pm

Post by hines »

I forgot to mention that
void (*nrnpy_py2n_component) is in
src/nrnpython/nrnpy_p2h.cpp
gartland

That helped...

Post by gartland »

thanks for the help. that got me past the configure line but now there are some problems in the make. in src/ivoc/Makefile.am there was no reference to ivocman1.cpp, so i didn't change that file. i made the function you mentioned extern in nrnpy_p2h.cpp as well. below i've pasted the output of typing make after ./configure... i realize at this point that its not just a problem of the compiler finding the right files, but some little bugs in the code so i'm doing this just to help you with your debugging. let me know when you have a newer version for me to try. i'm looking forward to working more with neuron in the python environment! thanks!

Code: Select all

make  all-recursive
Making all in src
Making all in memacs
make[3]: Nothing to be done for `all'.
Making all in e_editor
make[3]: Nothing to be done for `all'.
Making all in modlunit
make[3]: Nothing to be done for `all'.
Making all in nmodl
make[3]: Nothing to be done for `all'.
Making all in sparse
make[3]: Nothing to be done for `all'.
Making all in sparse13
make[3]: Nothing to be done for `all'.
Making all in scopmath
make[3]: Nothing to be done for `all'.
Making all in nrnmpi
make[3]: Nothing to be done for `all'.
Making all in oc
make  all-am
Making all in nrnoc
if test -d ../../.svn && svnversion ../.. ; then \
if test "`svnversion ../..`" != "`sed -n 's/.*SVN_CHANGESET.*(\([^)]*\).*/\1/p' ./nrnversion.h`" ; then \
    sh ../../svn2nrn_h.sh ../.. > ./nrnversion.h.tmp; \
    if test -s ./nrnversion.h.tmp ; then \
        mv ./nrnversion.h.tmp ./nrnversion.h ; \
    fi ; \
    echo "updated nrnversion.h" ; \
else \
        echo "nrnversion.h not changed" ; \
fi \
fi
make  all-am
if test -d ../../.svn && svnversion ../.. ; then \
if test "`svnversion ../..`" != "`sed -n 's/.*SVN_CHANGESET.*(\([^)]*\).*/\1/p' ./nrnversion.h`" ; then \
    sh ../../svn2nrn_h.sh ../.. > ./nrnversion.h.tmp; \
    if test -s ./nrnversion.h.tmp ; then \
        mv ./nrnversion.h.tmp ./nrnversion.h ; \
    fi ; \
    echo "updated nrnversion.h" ; \
else \
        echo "nrnversion.h not changed" ; \
fi \
fi
Making all in nrnpython
if test inithoc.cpp -ot ../../src/nrnpython/inithoc.cpp ; then \
        cp ../../src/nrnpython/inithoc.cpp inithoc.cpp ; \
fi
if test ! -d neuron ; then \
        mkdir neuron ; \
fi
for i in __init__.py ; do \
        if test neuron/$i -ot ../../src/nrnpython/neuron/$i ; then \
                cp ../../src/nrnpython/neuron/$i neuron/$i ; \
        fi \
done
make  all-am
if /bin/sh ../../libtool --mode=compile --tag=CXX g++ -DHAVE_CONFIG_H -DWITH_NUMPY -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. -I. -I../../src/nrniv -I../../src/ivoc -I../../src/nrnoc -I../../src/oc -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include -I/home/peterdetwiler/neuron/iv-17/include  -DOOP=1 -DCABLE=1 -DUSECVODE=1 -DUSEMATRIX=1 -DUSEBBS=1   -g -O2 -MT nrnpy_hoc.lo -MD -MP -MF ".deps/nrnpy_hoc.Tpo" -c -o nrnpy_hoc.lo nrnpy_hoc.cpp; \
then mv -f ".deps/nrnpy_hoc.Tpo" ".deps/nrnpy_hoc.Plo"; else rm -f ".deps/nrnpy_hoc.Tpo"; exit 1; fi
 g++ -DHAVE_CONFIG_H -DWITH_NUMPY -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. -I. -I../../src/nrniv -I../../src/ivoc -I../../src/nrnoc -I../../src/oc -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include -I/home/peterdetwiler/neuron/iv-17/include -DOOP=1 -DCABLE=1 -DUSECVODE=1 -DUSEMATRIX=1 -DUSEBBS=1 -g -O2 -MT nrnpy_hoc.lo -MD -MP -MF .deps/nrnpy_hoc.Tpo -c nrnpy_hoc.cpp  -fno-common -DPIC -o .libs/nrnpy_hoc.o
nrnpy_hoc.cpp:996: error: invalid conversion from 'int (*)(PyObject*)' to 'Py_ssize_t (*)(PyObject*)'
nrnpy_hoc.cpp:996: error: invalid conversion from 'PyObject* (*)(PyObject*, int)' to 'PyObject* (*)(PyObject*, Py_ssize_t)'
nrnpy_hoc.cpp:996: error: invalid conversion from 'int (*)(PyObject*, int, PyObject*)' to 'int (*)(PyObject*, Py_ssize_t, PyObject*)'
nrnpy_hoc.cpp: In function 'PyObject* PyObj_FromNrnObj(Object*)':
nrnpy_hoc.cpp:1013: error: 'Vect' was not declared in this scope
nrnpy_hoc.cpp:1013: error: 'v' was not declared in this scope
nrnpy_hoc.cpp:1013: error: expected primary-expression before ')' token
nrnpy_hoc.cpp:1013: error: expected `;' before 'obj'
nrnpy_hoc.cpp: In function 'int hocobj_tonumpy(PyObject*, PyObject*)':
nrnpy_hoc.cpp:1047: error: 'struct _object' has no member named 'type_'
nrnpy_hoc.cpp:1047: error: 'struct _object' has no member named 'type_'
nrnpy_hoc.cpp:1049: error: 'struct _object' has no member named 'sym_'
nrnpy_hoc.cpp:1062: error: 'hoc_total_array' was not declared in this scope
nrnpy_hoc.cpp:1091: error: 'pObj' was not declared in this scope
nrnpy_hoc.cpp:1101: error: 'pObj' was not declared in this scope
nrnpy_hoc.cpp:1111: error: 'hoc_total_array' was not declared in this scope
nrnpy_hoc.cpp:1141: error: 'pObj' was not declared in this scope
nrnpy_hoc.cpp:1156: error: 'pObj' was not declared in this scope
nrnpy_hoc.cpp:1174: error: invalid conversion from 'int (*)(PyObject*, PyObject*)' to 'PyObject* (*)(PyObject*, PyObject*)'
nrnpy_hoc.cpp:1234: error: a function-definition is not allowed here before '{' token
nrnpy_hoc.cpp: At global scope:
nrnpy_hoc.cpp:1263: error: expected `}' at end of input
make[4]: *** [nrnpy_hoc.lo] Error 1
make[3]: *** [all] Error 2
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
hines
Site Admin
Posts: 1687
Joined: Wed May 18, 2005 3:32 pm

Post by hines »

I believe the build process is more generic now. But since I still do not have numpy installed on my machine, there could be problems with that case. You will need one of the alpha versions at
http://www.neuron.yale.edu/ftp/neuron/versions/alpha/ or the svn repository version.
farzad

Re: Mac OS X Build error

Post by farzad »

The version 7.0 also has same problem, I am getting same error when "--with-nrnpython" is given on Mac OS X.
-farzad
hines
Site Admin
Posts: 1687
Joined: Wed May 18, 2005 3:32 pm

Re: Mac OS X Build error

Post by hines »

There seem to be several errors mentioned above. Which, precisely, is yours. I build the generic alpha distribution using:

$NSRC/configure --prefix=$IDIR/nrn --srcdir=$NSRC \
--with-iv=$IDIR/iv --enable-carbon --with-nrnpython=dynamic \
--enable-UniversalMacBinary

but leaving out the '=dynamic' also builds correctly on my mac os 10.4 and python2.5
Post Reply