I'm trying to upgrade to the latest version of Neuron.
Compilation of Interview and Neuron works fine but I can't build the nrnpython.
It seems the setup.py coming with the package is somehow broken (or it's not well formed in my systems)
This is the error
Code: Select all
mattioni@pogo:nrnpython$ python setup.py install --prefix=~/local/
File "setup.py", line 64
= [ epre+libdirs[0],epre+libdirs[1] ],
^
SyntaxError: invalid syntax
Code: Select all
hoc_module = Extension(
"neuron.hoc",
["inithoc.cpp"],
library_dirs=libdirs,
= [ epre+libdirs[0],epre+libdirs[1] ],
#extra_objects = [],
libraries = [
"nrnpython",
"nrnoc", "oc", "nrniv", "ivoc",
"memacs", "meschach", "neuron_gnu", "nrnmpi",
"scopmath", "sparse13", "sundials", "IVhines",
"readline"
],
include_dirs = include_dirs,
define_macros=defines
)
Follows the whole file.
Code: Select all
#setup.py
from distutils.core import setup, Extension
import sys
# NRNPYTHON_DEFINES which were enabled at configure time
extern_defines = ""
nrnpython_exec = ""
nrn_srcdir = "."
if nrn_srcdir[0] != '/' :
nrn_srcdir = '../../' + nrn_srcdir
if nrnpython_exec!=sys.executable:
print "Error:"
print "NEURON configure time python: "+nrnpython_exec
print "Python presently executing setup.py: "+sys.executable
print "These do not match, and the should!"
sys.exit(1)
ldefs = extern_defines.split('-D')
# if using MPI then at least for linking need special paths and libraries
mpicc_bin = "gcc"
mpicxx_bin = "g++"
import os
os.environ["CC"]=mpicc_bin
os.environ["CXX"]=mpicxx_bin
# apparently we do not need the following
#################################
## following http://code.google.com/p/maroonmpi/wiki/Installation
## hack into distutils to replace the compiler in "linker_so" with mpicxx_bin
#
#import distutils
#import distutils.unixccompiler
#
#class MPI_UnixCCompiler(distutils.unixccompiler.UnixCCompiler):
# __set_executable = distutils.unixccompiler.UnixCCompiler.set_executable
#
# def set_executable(self,key,value):
# print "MPI_UnixCCompiler ", key, " | ", value
# if key == 'linker_so' and type(value) == str:
# value = mpicxx_bin + ' ' + ' '.join(value.split()[1:])
#
# return self.__set_executable(key,value)
#
#distutils.unixccompiler.UnixCCompiler = MPI_UnixCCompiler
#################################
include_dirs = [nrn_srcdir+'/src/oc', '../oc']
defines = []
libdirs = ["/homes/mattioni/local/x86_64/lib",
"/homes/mattioni/local/x86_64/lib"
]
epre='-Wl,-R'
hoc_module = Extension(
"neuron.hoc",
["inithoc.cpp"],
library_dirs=libdirs,
= [ epre+libdirs[0],epre+libdirs[1] ],
#extra_objects = [],
libraries = [
"nrnpython",
"nrnoc", "oc", "nrniv", "ivoc",
"memacs", "meschach", "neuron_gnu", "nrnmpi",
"scopmath", "sparse13", "sundials", "IVhines",
"readline"
],
include_dirs = include_dirs,
define_macros=defines
)
setup(name="NEURON", version="7.0",
description = "NEURON bindings for python",
package_dir = {'':nrn_srcdir+'/share/lib/python'},
packages=['neuron','neuron.tests'],
ext_modules=[hoc_module]
)