Python 带scipy.weave.inline的SyntaxError

Python 带scipy.weave.inline的SyntaxError,python,c,gcc,scipy,Python,C,Gcc,Scipy,我最近升级到了最新版本的brian2,并在运行神经模拟时开始看到以下警告: WARNING brian2.codegen.runtime.weave_rt.weave_rt.failed_compile_test: Cannot use weave, a test compilation failed: invalid syntax (<string>, line 1) (SyntaxError) 运行此代码,我得到以下结果: In [11]: from scipy import

我最近升级到了最新版本的
brian2
,并在运行神经模拟时开始看到以下警告:

WARNING  brian2.codegen.runtime.weave_rt.weave_rt.failed_compile_test: Cannot use weave, a test compilation failed: invalid syntax (<string>, line 1) (SyntaxError)
运行此代码,我得到以下结果:

In [11]: from scipy import weave

In [12]: compiler
Out[12]: 'gcc'

In [13]: extra_compile_args 
Out[13]: ['-w', '-O3']

In [14]: weave.inline('int x=0;', [], compiler=compiler, headers=['<algorithm>', '<limits>'], extra_compile_args=extra_compile_args, verbose=0)
  File "<string>", line 1
    '\t\t\t\t// SUPPORT CODE\n\t//static py::object _namespace_numpy_rand;\n\t//#define BUFFER_SIZE 1024\n\t//// A rand() function that returns a single random number. Internally\n\t//// it asks numpy\'s rand function for BUFFER_SIZE\n\t//// random numbers at a time and then returns one number from this\n\t//// buffer.\n\t//// It needs a reference to the numpy_rand object (the original numpy\n\t//// function), because this is otherwise only available in\n\t//// compiled_function (where is is automatically handled by weave).\n\t////\n\t//double _rand(const int _vectorisation_idx) {\n\t//    // the _vectorisation_idx argument is unused for now, it could in\n\t//    // principle be used to get reproducible random numbers when using\n\t//    // OpenMP etc.\n\t//    static PyArrayObject *rand_buffer = NULL;\n\t//    static double *buf_pointer = NULL;\n\t//    static npy_int curbuffer = 0;\n\t//    if(curbuffer==0)\n\t//    {\n\t//        if(rand_buffer) Py_DECREF(rand_buffer);\n\t//        py::tuple args(1);\n\t//        args[0] = BUFFER_SIZE;\n\t//        rand_buffer = (PyArrayObject *)PyArray_FromAny(_namespace_numpy_rand.call(args),\n\t//                                                       NULL, 1, 1, 0, NULL);\n\t//        buf_pointer = (double*)PyArray_GETPTR1(rand_buffer, 0);\n\t//    }\n\t//    double number = buf_pointer[curbuffer];\n\t//    curbuffer = curbuffer+1;\n\t//    if (curbuffer == BUFFER_SIZE)\n\t//        // This seems to be safer then using (curbuffer + 1) % BUFFER_SIZE, we might run into\n\t//        // an integer overflow for big networks, otherwise.\n\t//        curbuffer = 0;\n\t//    return number;\n\t//}\n\n\n\t\t\t//// HANDLE DENORMALS ////\n\t\n\n\n\t\t\t//// HASH DEFINES ////\n\t\n\n\n\t\t\t//// POINTERS ////\n\tint* __restrict  _ptr_array_synapses_4_N_incoming = _array_synapses_4_N_incoming;\n\tint* __restrict  _ptr_array_poissongroup_i = _array_poissongroup_i;\n\tint* __restrict  _ptr_array_neurongroup_i = _array_neurongroup_i;\n\tint* __restrict  _ptr_array_synapses_4__synaptic_post = _array_synapses_4__synaptic_post;\n\tint* __restrict  _ptr_array_synapses_4_N_outgoing = _array_synapses_4_N_outgoing;\n\tint* __restrict  _ptr_array_synapses_4__synaptic_pre = _array_synapses_4__synaptic_pre;\n\t_namespace_numpy_rand = _numpy_rand;\n\n\n\n    srand((unsigned int)time(NULL));\n    const int _buffer_size = 1024;\n    int *const _prebuf = new int[_buffer_size];\n    int *const _postbuf = new int[_buffer_size];\n    int *const _synprebuf = new int[1];\n    int *const _synpostbuf = new int[1];\n    int _curbuf = 0;\n\n    // scalar code\n\tconst intrray_neurongroup_1_s_ext;\n\tdouble* __restrict  _ptr_array_neurongroup_1_s_gaba = _array_neurongroup_1_s_gaba;\n\tdouble* __restrict  _ptr_array_neurongroup_1_v = _array_neurongroup_1_v;\n\tdouble* __restrict  _ptr_array_neurongroup_1_s_tot_ampa = _array_neurongroup_1_s_tot_ampa;\n\n\n\n\t//// MAIN CODE ////////////\n\n\t// scalar code\n\tconst int _vectorisation_idx = 1;\n \t\n const double _lio_const_1 = - dt;\n const double _lio_const_2 = - G_ampa;\n const double _lio_const_3 = - E_ampa;\n const double _lio_const_4 = - E_gaba;\n const double _lio_const_5 = - E_nmda;\n const double _lio_const_6 = - a;\n const double _lio_const_7 = - El_i;\n\n\n\tfor(int _idx=0; _idx<N; _idx++)\n\t{\n\t    // vector code\n\t\tconst int _vectorisation_idx = _idx;\n      \t\t    \n      const double s_tot_ampa = _ptr_array_neurongroup_1_s_tot_ampa[_idx];\n      double s_ext = _ptr_array_neurongroup_1_s_ext[_idx];\n      double s_gaba = _ptr_array_neurongroup_1_s_gaba[_idx];\n      const double s_tot_nmda = _ptr_array_neurongroup_1_s_tot_nmda[_idx];\n      double v = _ptr_array_neurongroup_1_v[_idx];\n      const double lastspike = _ptr_array_neurongroup_1_lastspike[_idx];\n      bool not_refractory = _ptr_array_neurongroup_1_not_refractory[_idx];\n      not_refractory = (t - lastspike) > tr_i;\n      const double __k_s_ext = (_lio_const_1 * s_ext) / t_ampa;\n      const double __k_s_gaba = (_lio_const_1 * s_gaba) / t_gaba;\n      const double __k_v = ((dt * ((((((_lio_const_2 * s_tot_ampa) * (_lio_const_3 + v)) - ((G_ext * s_ext) * (_lio_const_3 + v))) - ((G_gaba * s_gaba) * (_lio_const_4 + v))) - (((G_nmda * s_tot_nmda) * (_lio_const_5 + v)) / ((b * exp(_lio_const_6 * v)) + 1.0))) - (gl_i * (_lio_const_7 + v)))) * int_(not_refractory)) / C_m;\n      const double _s_ext = ((_lio_const_1 * ((0.5 * __k_s_ext) + s_ext)) / t_ampa) + s_ext;\n      const double _s_gaba = ((_lio_const_1 * ((0.5 * __k_s_gaba) + s_gaba)) / t_gaba) + s_gaba;\n      const double _v = v + (((dt * ((((((_lio_const_2 * s_tot_ampa) * ((_lio_const_3 + (0.5 * __k_v)) + v)) - ((G_ext * ((0.5 * __k_s_ext) + s_ext)) * ((_lio_const_3 + (0.5 * __k_v)) + v))) - ((G_gaba * ((0.5 * __k_s_gaba) + s_gaba)) * ((_lio_const_4 + (0.5 * __k_v)) + v))) - (((G_nmda * s_tot_nmda) * ((_lio_const_5 + (0.5 * __k_v)) + v)) / ((b * exp(_lio_const_6 * ((0.5 * __k_v) + v))) + 1.0))) - (gl_i * ((_lio_const_7 + (0.5 * __k_v)) + v)))) * int_(not_refractory)) / C_m);\n      s_ext = _s_ext;\n      s_gaba = _s_gaba;\n      if(not_refractory)\n          v = _v;\n      _ptr_array_neurongroup_1_s_gaba[_idx] = s_gaba;\n      _ptr_array_neurongroup_1_v[_idx] = v;\n      _ptr_array_neurongroup_1_s_ext[_idx] = s_ext;\n      _ptr_array_neurongroup_1_not_refractory[_idx] = not_refractory;\n\n\n\t}\n\n/*\nThe following code is just compiler options for the call to weave.inline.\nBy including them here, we force a recompile if the compiler options change,\nwhich is a good thing (e.g. switching -ffast-math on and off).\n\nsupport_code:\n  \t\t\n  int int_(const bool value)\n  {\n      return value ? 1 : 0;\n  }\n\n\n\n\ncompiler:\ngcc\n\nextra_compile_args:\n['-w', '-O3']\n\ninclude_dirs:\n['/usr/local/anaconda/include']\n*/\n        ", (119808, 66)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ^
SyntaxError: invalid syntax
In [3]: weave.inline('int x=0;', [], compiler='gcc', headers=

['<algorithm>', '<limits>'], extra_compile_args=['-w', '-03'], verbose=2, force=1)
<weave: compiling>
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b
running build_ext
running build_src
build_src
building extension "sc_302644cc5257b9feebbfde0f5856848e1" sources
build_src: building npy-pkg config files
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
building 'sc_302644cc5257b9feebbfde0f5856848e1' extension
compiling C++ sources
C compiler: g++ -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -fPIC

creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/home
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/home/despo
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/home/despo/dbliss
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/home/despo/dbliss/.cache
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/home/despo/dbliss/.cache/scipy
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/home/despo/dbliss/.cache/scipy/python27_compiled
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/usr
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/usr/local
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/usr/local/anaconda
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/usr/local/anaconda/lib
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/usr/local/anaconda/lib/python2.7
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/usr/local/anaconda/lib/python2.7/site-packages
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/usr/local/anaconda/lib/python2.7/site-packages/scipy
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/usr/local/anaconda/lib/python2.7/site-packages/scipy/weave
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/usr/local/anaconda/lib/python2.7/site-packages/scipy/weave/scxx
compile options: '-I/usr/local/anaconda/lib/python2.7/site-packages/scipy/weave -I/usr/local/anaconda/lib/python2.7/site-packages/scipy/weave/scxx -I/usr/local/anaconda/lib/python2.7/site-packages/numpy/core/include -I/usr/local/anaconda-1.9.2/include/python2.7 -c'
extra options: '-w -03'
g++: /home/despo/dbliss/.cache/scipy/python27_compiled/sc_302644cc5257b9feebbfde0f5856848e1.cpp
g++: unrecognized option '-03'
g++: /usr/local/anaconda/lib/python2.7/site-packages/scipy/weave/scxx/weave_imp.cpp
g++: unrecognized option '-03'
g++ -pthread -shared /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/home/despo/dbliss/.cache/scipy/python27_compiled/sc_302644cc5257b9feebbfde0f5856848e1.o /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/usr/local/anaconda/lib/python2.7/site-packages/scipy/weave/scxx/weave_imp.o -L/usr/local/anaconda-1.9.2/lib -lpython2.7 -o /home/despo/dbliss/.cache/scipy/python27_compiled/sc_302644cc5257b9feebbfde0f5856848e1.so
  File "<string>", line 1
    '\t\t\t\t// SUPPORT CODE\n\t//static py::object _namespace_numpy_rand;\n\t//#define BUFFER_SIZE 1024\n\t//// A rand() function that returns a single random number. Internally\n\t//// it asks numpy\'s rand function for BUFFER_SIZE\n\t//// random numbers at a time and then returns one number from this\n\t//// buffer.\n\t//// It needs a reference to the numpy_rand object (the original numpy\n\t//// function), because this is otherwise only available in\n\t//// compiled_function (where is is automatically handled by weave).\n\t////\n\t//double _rand(const int _vectorisation_idx) {\n\t//    // the _vectorisation_idx argument is unused for now, it could in\n\t//    // principle be used to get reproducible random numbers when using\n\t//    // OpenMP etc.\n\t//    static PyArrayObject *rand_buffer = NULL;\n\t//    static double *buf_pointer = NULL;\n\t//    static npy_int curbuffer = 0;\n\t//    if(curbuffer==0)\n\t//    {\n\t//        if(rand_buffer) Py_DECREF(rand_buffer);\n\t//        py::tuple args(1);\n\t//        args[0] = BUFFER_SIZE;\n\t//        rand_buffer = (PyArrayObject *)PyArray_FromAny(_namespace_numpy_rand.call(args),\n\t//                                                       NULL, 1, 1, 0, NULL);\n\t//        buf_pointer = (double*)PyArray_GETPTR1(rand_buffer, 0);\n\t//    }\n\t//    double number = buf_pointer[curbuffer];\n\t//    curbuffer = curbuffer+1;\n\t//    if (curbuffer == BUFFER_SIZE)\n\t//        // This seems to be safer then using (curbuffer + 1) % BUFFER_SIZE, we might run into\n\t//        // an integer overflow for big networks, otherwise.\n\t//        curbuffer = 0;\n\t//    return number;\n\t//}\n\n\n\t\t\t//// HANDLE DENORMALS ////\n\t\n\n\n\t\t\t//// HASH DEFINES ////\n\t\n\n\n\t\t\t//// POINTERS ////\n\tint* __restrict  _ptr_array_synapses_4_N_incoming = _array_synapses_4_N_incoming;\n\tint* __restrict  _ptr_array_poissongroup_i = _array_poissongroup_i;\n\tint* __restrict  _ptr_array_neurongroup_i = _array_neurongroup_i;\n\tint* __restrict  _ptr_array_synapses_4__synaptic_post = _array_synapses_4__synaptic_post;\n\tint* __restrict  _ptr_array_synapses_4_N_outgoing = _array_synapses_4_N_outgoing;\n\tint* __restrict  _ptr_array_synapses_4__synaptic_pre = _array_synapses_4__synaptic_pre;\n\t_namespace_numpy_rand = _numpy_rand;\n\n\n\n    srand((unsigned int)time(NULL));\n    const int _buffer_size = 1024;\n    int *const _prebuf = new int[_buffer_size];\n    int *const _postbuf = new int[_buffer_size];\n    int *const _synprebuf = new int[1];\n    int *const _synpostbuf = new int[1];\n    int _curbuf = 0;\n\n    // scalar code\n\tconst intrray_neurongroup_1_s_ext;\n\tdouble* __restrict  _ptr_array_neurongroup_1_s_gaba = _array_neurongroup_1_s_gaba;\n\tdouble* __restrict  _ptr_array_neurongroup_1_v = _array_neurongroup_1_v;\n\tdouble* __restrict  _ptr_array_neurongroup_1_s_tot_ampa = _array_neurongroup_1_s_tot_ampa;\n\n\n\n\t//// MAIN CODE ////////////\n\n\t// scalar code\n\tconst int _vectorisation_idx = 1;\n \t\n const double _lio_const_1 = - dt;\n const double _lio_const_2 = - G_ampa;\n const double _lio_const_3 = - E_ampa;\n const double _lio_const_4 = - E_gaba;\n const double _lio_const_5 = - E_nmda;\n const double _lio_const_6 = - a;\n const double _lio_const_7 = - El_i;\n\n\n\tfor(int _idx=0; _idx<N; _idx++)\n\t{\n\t    // vector code\n\t\tconst int _vectorisation_idx = _idx;\n      \t\t    \n      const double s_tot_ampa = _ptr_array_neurongroup_1_s_tot_ampa[_idx];\n      double s_ext = _ptr_array_neurongroup_1_s_ext[_idx];\n      double s_gaba = _ptr_array_neurongroup_1_s_gaba[_idx];\n      const double s_tot_nmda = _ptr_array_neurongroup_1_s_tot_nmda[_idx];\n      double v = _ptr_array_neurongroup_1_v[_idx];\n      const double lastspike = _ptr_array_neurongroup_1_lastspike[_idx];\n      bool not_refractory = _ptr_array_neurongroup_1_not_refractory[_idx];\n      not_refractory = (t - lastspike) > tr_i;\n      const double __k_s_ext = (_lio_const_1 * s_ext) / t_ampa;\n      const double __k_s_gaba = (_lio_const_1 * s_gaba) / t_gaba;\n      const double __k_v = ((dt * ((((((_lio_const_2 * s_tot_ampa) * (_lio_const_3 + v)) - ((G_ext * s_ext) * (_lio_const_3 + v))) - ((G_gaba * s_gaba) * (_lio_const_4 + v))) - (((G_nmda * s_tot_nmda) * (_lio_const_5 + v)) / ((b * exp(_lio_const_6 * v)) + 1.0))) - (gl_i * (_lio_const_7 + v)))) * int_(not_refractory)) / C_m;\n      const double _s_ext = ((_lio_const_1 * ((0.5 * __k_s_ext) + s_ext)) / t_ampa) + s_ext;\n      const double _s_gaba = ((_lio_const_1 * ((0.5 * __k_s_gaba) + s_gaba)) / t_gaba) + s_gaba;\n      const double _v = v + (((dt * ((((((_lio_const_2 * s_tot_ampa) * ((_lio_const_3 + (0.5 * __k_v)) + v)) - ((G_ext * ((0.5 * __k_s_ext) + s_ext)) * ((_lio_const_3 + (0.5 * __k_v)) + v))) - ((G_gaba * ((0.5 * __k_s_gaba) + s_gaba)) * ((_lio_const_4 + (0.5 * __k_v)) + v))) - (((G_nmda * s_tot_nmda) * ((_lio_const_5 + (0.5 * __k_v)) + v)) / ((b * exp(_lio_const_6 * ((0.5 * __k_v) + v))) + 1.0))) - (gl_i * ((_lio_const_7 + (0.5 * __k_v)) + v)))) * int_(not_refractory)) / C_m);\n      s_ext = _s_ext;\n      s_gaba = _s_gaba;\n      if(not_refractory)\n          v = _v;\n      _ptr_array_neurongroup_1_s_gaba[_idx] = s_gaba;\n      _ptr_array_neurongroup_1_v[_idx] = v;\n      _ptr_array_neurongroup_1_s_ext[_idx] = s_ext;\n      _ptr_array_neurongroup_1_not_refractory[_idx] = not_refractory;\n\n\n\t}\n\n/*\nThe following code is just compiler options for the call to weave.inline.\nBy including them here, we force a recompile if the compiler options change,\nwhich is a good thing (e.g. switching -ffast-math on and off).\n\nsupport_code:\n  \t\t\n  int int_(const bool value)\n  {\n      return value ? 1 : 0;\n  }\n\n\n\n\ncompiler:\ngcc\n\nextra_compile_args:\n['-w', '-O3']\n\ninclude_dirs:\n['/usr/local/anaconda/include']\n*/\n        ", (119808, 66)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ^
SyntaxError: invalid syntax
[11]中的
:来自scipy import weave
在[12]中:编译器
Out[12]:“gcc”
在[13]中:额外的编译参数
Out[13]:['-w','-O3']
在[14]中:weave.inline('int x=0;',[],compiler=compiler,headers=['',],extra\u compile\u args=extra\u compile\u args,verbose=0)
文件“”,第1行
'\t\t\t\t//支持代码\n\t//静态py::object\u namespace\u numpy\u rand\n\t//#定义缓冲区大小1024\n\t////返回单个随机数的rand()函数。在内部\n\t////它一次向numpy的rand函数询问BUFFER\u SIZE\n\t////随机数,然后从这个\n\t////缓冲区返回一个数字。\n\t////它需要一个对numpy\u rand对象(原始numpy\n\t////函数)的引用,因为这仅在\n\t////编译的\u函数中可用(其中是由weave自动处理的)。\n\t///\n\t//double\u rand(const int\u vectoriation\u idx){\n\t////目前尚未使用{u vectoriation\u idx参数,原则上,在使用OpenMP等时,可以使用它来获取可复制的随机数。\n\t///static PyArrayObject*rand\u buffer=NULL;\n\t//static double*buf\u pointer=NULL;\n\t///static npy\u int curbuffer=0;\n\t//if(corbuffer==0)\n\t///{\n\t//if(rand\u buffer)Py\u DECREF(rand\u buffer);\n\t//Py::tuple args(1);\n\t//args[0]=buffer\u SIZE;\n\t//rand\u buffer=(PyArrayObject*)PyArray\u from任何(_namespace\u numpy rand.call(args),\n\t//NULL,1,1,0,NULL);\n\t//buf\u指针=(double*)PyArray_GETPTR1(rand_buffer,0);\n\t//}\n\t//double number=buf\u指针[courbuffer];\n\t//courbuffer=courbuffer+1;\n\t//if(courbuffer==buffer\u SIZE)\n\t///这似乎比使用(courbuffer+1)更安全%BUFFER\u SIZE,对于大型网络,我们可能会遇到\n\t///整数溢出,否则。\n\t//curbuffer=0;\n\t//return number;\n\t//}\\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\n\n\n\n\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\=\u数组\u组\u i;\n\tint*\u res本次交易的目的是为了对阵列式阵列式阵列式阵列式突触突触的突触突触进行研究。后文\n\n\n\n\n\tint*\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\tint*着色*对阵列式阵列式阵列式阵列式阵列式阵列式阵列式阵列式阵列式阵列式突触突触突触的突触突触的阵列式阵列式阵列式阵列式阵列式突触突触突触突触突触突触的突触突触突触突触突触突触突触突触突触突触突触突触的突触阵列式阵列式阵列式阵列式阵列式阵列式突触突触的突触突触突触突触突触突触突触后文发布后;后;后;后;后文\n阵列式阵列式阵列式阵列式阵列式阵列式阵列式阵列式阵列式阵列式阵列式阵列式突触阵列式阵列式阵列式突触4无符号整数)时间(空)\n常量intbuffersize=1024;\n int*constprebuf=new int[buffersize];\n int*constpostbuf=new int[buffersize];\n int*constpostbuff=new int[1]\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\您必须遵守《全国人大常委会关于维护互联网安全的决定》\n\n\n\t////主要代码[[[//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////主要////////////////////主要[[[[[[[1]1]1][[1\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n常数双\u lio\u常数71.0\n\n\n\n\n\n\n\n\n\n本月(int-U-idx=0.0\n\n\n\n\n\n本月(int-n\n\n\n\n\n\n本月(int-n\n\n\n\n\n\n\n\n\n\n\n\n\n本月(int\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n*s_ext)*(lio_const_3+v))-((G_gaba*s_gaba)*(lio_const_4+v)))(b.b.exp(1.0))(1.0))(((G.U nmda(G.U nmda)和(G.U nmda)和(G.U nmda(G.U nmda)和(G.U nmda)和(G.U nmda)和(G.U nmda)和(G.U nmda)和(G.U nmda)和(5.v)和(G(G.U nmda)和(s)和(s)和(s)和(G(G.m)nmda)和(s)和(s)和(s)和(s)和(s)和(s)和(G(G(G-m)的国防国防国防国防军军)和国防军)和国防军)和国防军)和国防军)和国防军)和国防军)和国防军)和国防军)和国防军)和国防军)和国防军)的未来5+5+5+5+5+5+5+5(s(s(1*((0.5*_k_s_gaba)+s_gaba))/t_gaba)(2)北京市政府工程施工现场加加布;加布市政府工程施工现场加布;加布市政府工程施工现场加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市政府加布市(3+3+3+3+0.5(0.5(0.5(0.5)(0.5)(0.5(0.5)(0.5)(0.5)(0.5)(0.5)(0.5)(0.5)(0.5)(0.5)和5)和5)和5)))常数4+(0.5*)+v-((G_nmda*s_tot_nmda)*(((u lio_常数5+(0.5*))(b.v)5/5)5/5(b.v)和(b.v)5/5)5/5(b.v)5/5(b.b.5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5)v)5/v)5/5(b.v)和(b.v)5/5(b.5 5)5)5/5(b)和(b.5(b.0)5)5)5/5/5/5(b)和(b)5(b)5/5(b)5/5(b)5(b)和(b(b)5/5(b)和(b/1.5(b)5(b)和(b/5(b)5(b)和(b)5(b)和(b)和(b)5(b)5(b)和(b/5(b)和(b)和(b)5(b)5 u ptr_阵列_神经元组_1_v[_idx]=v;\n\u ptr\u array\u neurongroup\u 1\u s\u ext[\u idx]=s\u ext;\n\u ptr\u array\u neurongroup\u 1\u not\u refractive[\u idx]=not\u refractive;\n\n\t}\n\n/*\n以下代码只是调用weave.inline的编译器选项。\n通过将它们包含在这里,如果编译器选项更改,我们将强制重新编译,\n这是一件好事(例如,打开和关闭-ffast math)。\n\n支持代码:\n\t\t\n int(const bool value)\n{\n返回值?1:0;\n}\n\n\n\n\n编译器:\ngcc\n\nextra\u编译参数:\n['-w','-O3']\n\n\n包括目录:\n['/usr/local/anaconda/include']\n*/\n*,(119808,66)
In [3]: weave.inline('int x=0;', [], compiler='gcc', headers=

['<algorithm>', '<limits>'], extra_compile_args=['-w', '-03'], verbose=2, force=1)
<weave: compiling>
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b
running build_ext
running build_src
build_src
building extension "sc_302644cc5257b9feebbfde0f5856848e1" sources
build_src: building npy-pkg config files
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
building 'sc_302644cc5257b9feebbfde0f5856848e1' extension
compiling C++ sources
C compiler: g++ -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -fPIC

creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/home
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/home/despo
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/home/despo/dbliss
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/home/despo/dbliss/.cache
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/home/despo/dbliss/.cache/scipy
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/home/despo/dbliss/.cache/scipy/python27_compiled
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/usr
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/usr/local
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/usr/local/anaconda
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/usr/local/anaconda/lib
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/usr/local/anaconda/lib/python2.7
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/usr/local/anaconda/lib/python2.7/site-packages
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/usr/local/anaconda/lib/python2.7/site-packages/scipy
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/usr/local/anaconda/lib/python2.7/site-packages/scipy/weave
creating /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/usr/local/anaconda/lib/python2.7/site-packages/scipy/weave/scxx
compile options: '-I/usr/local/anaconda/lib/python2.7/site-packages/scipy/weave -I/usr/local/anaconda/lib/python2.7/site-packages/scipy/weave/scxx -I/usr/local/anaconda/lib/python2.7/site-packages/numpy/core/include -I/usr/local/anaconda-1.9.2/include/python2.7 -c'
extra options: '-w -03'
g++: /home/despo/dbliss/.cache/scipy/python27_compiled/sc_302644cc5257b9feebbfde0f5856848e1.cpp
g++: unrecognized option '-03'
g++: /usr/local/anaconda/lib/python2.7/site-packages/scipy/weave/scxx/weave_imp.cpp
g++: unrecognized option '-03'
g++ -pthread -shared /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/home/despo/dbliss/.cache/scipy/python27_compiled/sc_302644cc5257b9feebbfde0f5856848e1.o /tmp/scipy-dbliss-wzdMj_/python27_intermediate/compiler_0129f738e3db7528dd918ff316c8b91b/usr/local/anaconda/lib/python2.7/site-packages/scipy/weave/scxx/weave_imp.o -L/usr/local/anaconda-1.9.2/lib -lpython2.7 -o /home/despo/dbliss/.cache/scipy/python27_compiled/sc_302644cc5257b9feebbfde0f5856848e1.so
  File "<string>", line 1
    '\t\t\t\t// SUPPORT CODE\n\t//static py::object _namespace_numpy_rand;\n\t//#define BUFFER_SIZE 1024\n\t//// A rand() function that returns a single random number. Internally\n\t//// it asks numpy\'s rand function for BUFFER_SIZE\n\t//// random numbers at a time and then returns one number from this\n\t//// buffer.\n\t//// It needs a reference to the numpy_rand object (the original numpy\n\t//// function), because this is otherwise only available in\n\t//// compiled_function (where is is automatically handled by weave).\n\t////\n\t//double _rand(const int _vectorisation_idx) {\n\t//    // the _vectorisation_idx argument is unused for now, it could in\n\t//    // principle be used to get reproducible random numbers when using\n\t//    // OpenMP etc.\n\t//    static PyArrayObject *rand_buffer = NULL;\n\t//    static double *buf_pointer = NULL;\n\t//    static npy_int curbuffer = 0;\n\t//    if(curbuffer==0)\n\t//    {\n\t//        if(rand_buffer) Py_DECREF(rand_buffer);\n\t//        py::tuple args(1);\n\t//        args[0] = BUFFER_SIZE;\n\t//        rand_buffer = (PyArrayObject *)PyArray_FromAny(_namespace_numpy_rand.call(args),\n\t//                                                       NULL, 1, 1, 0, NULL);\n\t//        buf_pointer = (double*)PyArray_GETPTR1(rand_buffer, 0);\n\t//    }\n\t//    double number = buf_pointer[curbuffer];\n\t//    curbuffer = curbuffer+1;\n\t//    if (curbuffer == BUFFER_SIZE)\n\t//        // This seems to be safer then using (curbuffer + 1) % BUFFER_SIZE, we might run into\n\t//        // an integer overflow for big networks, otherwise.\n\t//        curbuffer = 0;\n\t//    return number;\n\t//}\n\n\n\t\t\t//// HANDLE DENORMALS ////\n\t\n\n\n\t\t\t//// HASH DEFINES ////\n\t\n\n\n\t\t\t//// POINTERS ////\n\tint* __restrict  _ptr_array_synapses_4_N_incoming = _array_synapses_4_N_incoming;\n\tint* __restrict  _ptr_array_poissongroup_i = _array_poissongroup_i;\n\tint* __restrict  _ptr_array_neurongroup_i = _array_neurongroup_i;\n\tint* __restrict  _ptr_array_synapses_4__synaptic_post = _array_synapses_4__synaptic_post;\n\tint* __restrict  _ptr_array_synapses_4_N_outgoing = _array_synapses_4_N_outgoing;\n\tint* __restrict  _ptr_array_synapses_4__synaptic_pre = _array_synapses_4__synaptic_pre;\n\t_namespace_numpy_rand = _numpy_rand;\n\n\n\n    srand((unsigned int)time(NULL));\n    const int _buffer_size = 1024;\n    int *const _prebuf = new int[_buffer_size];\n    int *const _postbuf = new int[_buffer_size];\n    int *const _synprebuf = new int[1];\n    int *const _synpostbuf = new int[1];\n    int _curbuf = 0;\n\n    // scalar code\n\tconst intrray_neurongroup_1_s_ext;\n\tdouble* __restrict  _ptr_array_neurongroup_1_s_gaba = _array_neurongroup_1_s_gaba;\n\tdouble* __restrict  _ptr_array_neurongroup_1_v = _array_neurongroup_1_v;\n\tdouble* __restrict  _ptr_array_neurongroup_1_s_tot_ampa = _array_neurongroup_1_s_tot_ampa;\n\n\n\n\t//// MAIN CODE ////////////\n\n\t// scalar code\n\tconst int _vectorisation_idx = 1;\n \t\n const double _lio_const_1 = - dt;\n const double _lio_const_2 = - G_ampa;\n const double _lio_const_3 = - E_ampa;\n const double _lio_const_4 = - E_gaba;\n const double _lio_const_5 = - E_nmda;\n const double _lio_const_6 = - a;\n const double _lio_const_7 = - El_i;\n\n\n\tfor(int _idx=0; _idx<N; _idx++)\n\t{\n\t    // vector code\n\t\tconst int _vectorisation_idx = _idx;\n      \t\t    \n      const double s_tot_ampa = _ptr_array_neurongroup_1_s_tot_ampa[_idx];\n      double s_ext = _ptr_array_neurongroup_1_s_ext[_idx];\n      double s_gaba = _ptr_array_neurongroup_1_s_gaba[_idx];\n      const double s_tot_nmda = _ptr_array_neurongroup_1_s_tot_nmda[_idx];\n      double v = _ptr_array_neurongroup_1_v[_idx];\n      const double lastspike = _ptr_array_neurongroup_1_lastspike[_idx];\n      bool not_refractory = _ptr_array_neurongroup_1_not_refractory[_idx];\n      not_refractory = (t - lastspike) > tr_i;\n      const double __k_s_ext = (_lio_const_1 * s_ext) / t_ampa;\n      const double __k_s_gaba = (_lio_const_1 * s_gaba) / t_gaba;\n      const double __k_v = ((dt * ((((((_lio_const_2 * s_tot_ampa) * (_lio_const_3 + v)) - ((G_ext * s_ext) * (_lio_const_3 + v))) - ((G_gaba * s_gaba) * (_lio_const_4 + v))) - (((G_nmda * s_tot_nmda) * (_lio_const_5 + v)) / ((b * exp(_lio_const_6 * v)) + 1.0))) - (gl_i * (_lio_const_7 + v)))) * int_(not_refractory)) / C_m;\n      const double _s_ext = ((_lio_const_1 * ((0.5 * __k_s_ext) + s_ext)) / t_ampa) + s_ext;\n      const double _s_gaba = ((_lio_const_1 * ((0.5 * __k_s_gaba) + s_gaba)) / t_gaba) + s_gaba;\n      const double _v = v + (((dt * ((((((_lio_const_2 * s_tot_ampa) * ((_lio_const_3 + (0.5 * __k_v)) + v)) - ((G_ext * ((0.5 * __k_s_ext) + s_ext)) * ((_lio_const_3 + (0.5 * __k_v)) + v))) - ((G_gaba * ((0.5 * __k_s_gaba) + s_gaba)) * ((_lio_const_4 + (0.5 * __k_v)) + v))) - (((G_nmda * s_tot_nmda) * ((_lio_const_5 + (0.5 * __k_v)) + v)) / ((b * exp(_lio_const_6 * ((0.5 * __k_v) + v))) + 1.0))) - (gl_i * ((_lio_const_7 + (0.5 * __k_v)) + v)))) * int_(not_refractory)) / C_m);\n      s_ext = _s_ext;\n      s_gaba = _s_gaba;\n      if(not_refractory)\n          v = _v;\n      _ptr_array_neurongroup_1_s_gaba[_idx] = s_gaba;\n      _ptr_array_neurongroup_1_v[_idx] = v;\n      _ptr_array_neurongroup_1_s_ext[_idx] = s_ext;\n      _ptr_array_neurongroup_1_not_refractory[_idx] = not_refractory;\n\n\n\t}\n\n/*\nThe following code is just compiler options for the call to weave.inline.\nBy including them here, we force a recompile if the compiler options change,\nwhich is a good thing (e.g. switching -ffast-math on and off).\n\nsupport_code:\n  \t\t\n  int int_(const bool value)\n  {\n      return value ? 1 : 0;\n  }\n\n\n\n\ncompiler:\ngcc\n\nextra_compile_args:\n['-w', '-O3']\n\ninclude_dirs:\n['/usr/local/anaconda/include']\n*/\n        ", (119808, 66)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ^
SyntaxError: invalid syntax