#setup.py from distutils.core import setup, Extension import sys # NRNPYTHON_DEFINES which were enabled at configure time extern_defines = "@NRNPYTHON_DEFINES@" nrnpython_exec = "@NRNPYTHON_EXEC@" nrn_srcdir = "@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 = "@CC@" mpicxx_bin = "@CXX@" 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 = [] defines = [] libdirs = ["@NRN_LIBDIR@", "@IV_LIBDIR@" ] epre='-Wl,-R' hoc_module = Extension( "neuron.hoc", ["inithoc.cpp"], library_dirs=libdirs, @setup_extra_link_args@ = [ 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] )