Ошибка компиляции на python Weave-модуле (Ubuntu) - PullRequest
0 голосов
/ 02 мая 2020

Я пытаюсь запустить файл Diehl&Cook_spiking_MNIST.py здесь: https://github.com/peter-u-diehl/stdp-mnist.

вывод:

/home/showtsai/data/py2_env/lib/python2.7/site-packages/brian_no_units.py:4: UserWarning: Turning off units
  warnings.warn("Turning off units")
time needed to load training set: 11.9281079769
time needed to load test set: 2.18607211113
brian.stateupdater: WARNING  Using codegen CStateUpdater
brian.stateupdater: WARNING  Using codegen CStateUpdater
create neuron group A
create recurrent connections
(400, 3) ./weights/../random/AeAi.npy
(160000, 3) ./weights/../random/AiAe.npy
create monitors for A
create connections between X and A
(313600, 3) ./weights/XeAe.npy
creating /tmp/weave-showtsai-sAzJ3f/python27_intermediate/compiler_2e1ec47136bac12e4e2e13b18cd08c1e
c++: error: unrecognized command line option ‘-ffast-math -march=native’
brian.experimental.codegen.stateupdaters: WARNING  C compilation failed, falling back on Python.
c++: error: unrecognized command line option ‘-ffast-math -march=native’
brian.experimental.codegen.stateupdaters: WARNING  C compilation failed, falling back on Python.
c++: error: unrecognized command line option ‘-ffast-math -march=native’
Traceback (most recent call last):
  File "spiking_MNIST.py", line 455, in <module>
    b.run(single_example_time, report='text')
  File "/home/showtsai/data/py2_env/lib/python2.7/site-packages/brian/network.py", line 938, in run
    report=report, report_period=report_period)
  File "/home/showtsai/data/py2_env/lib/python2.7/site-packages/brian/network.py", line 574, in run
    self.update()
  File "/home/showtsai/data/py2_env/lib/python2.7/site-packages/brian/network.py", line 518, in update
    f()
  File "/home/showtsai/data/py2_env/lib/python2.7/site-packages/brian/neurongroup.py", line 501, in update
    spikes = self._threshold(self) # get spikes
  File "/home/showtsai/data/py2_env/lib/python2.7/site-packages/brian/threshold.py", line 186, in __call__
    extra_compile_args=self._extra_compile_args)
  File "/home/showtsai/data/py2_env/lib/python2.7/site-packages/weave/inline_tools.py", line 370, in inline
    **kw)
  File "/home/showtsai/data/py2_env/lib/python2.7/site-packages/weave/inline_tools.py", line 500, in compile_function
    verbose=verbose, **kw)
  File "/home/showtsai/data/py2_env/lib/python2.7/site-packages/weave/ext_tools.py", line 373, in compile
    verbose=verbose, **kw)
  File "/home/showtsai/data/py2_env/lib/python2.7/site-packages/weave/build_tools.py", line 279, in build_extension
    setup(name=module_name, ext_modules=[ext],verbose=verb)
  File "/home/showtsai/data/py2_env/lib/python2.7/site-packages/numpy/distutils/core.py", line 171, in setup
    return old_setup(**new_attr)
  File "/usr/lib/python2.7/distutils/core.py", line 166, in setup
    raise SystemExit, "error: " + str(msg)
weave.build_tools.CompileError: error: Command "c++ -pthread -DNDEBUG -g -fwrapv -O2 -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/home/showtsai/data/py2_env/lib/python2.7/site-packages/weave -I/home/showtsai/data/py2_env/lib/python2.7/site-packages/weave/scxx -I/home/showtsai/data/py2_env/lib/python2.7/site-packages/weave/blitz -I/home/showtsai/data/py2_env/lib/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c /home/showtsai/.cache/weave/python27_compiled/sc_d99244cd82bb18764cebf838c5d78a220.cpp -o /tmp/weave-showtsai-sAzJ3f/python27_intermediate/compiler_2e1ec47136bac12e4e2e13b18cd08c1e/home/showtsai/.cache/weave/python27_compiled/sc_d99244cd82bb18764cebf838c5d78a220.o -MMD -MF /tmp/weave-showtsai-sAzJ3f/python27_intermediate/compiler_2e1ec47136bac12e4e2e13b18cd08c1e/home/showtsai/.cache/weave/python27_compiled/sc_d99244cd82bb18764cebf838c5d78a220.o.d -O3 -ffast-math -march=native" failed with exit status 1

Ошибка возникает при компиляции weave module.

Это из-за версии g cc?

environment:

ubuntu 16.04.6
python 2.7.12
weave 0.17.0
gcc 5.4.0 20160609
...