Description of problem
I am having a problem with cython on Ubuntu 20.04.3 LTS running on my laptop with the following processor: 11th Gen Intel® Core™ i7-1185G7 @ 3.00GHz × 8.
Brian2 was installed via pip in a venv virtual environment.
From the error (see below) it seems -march=native
is not supported. And tigerlake
, Intel’s code name for my processor, is not a valid argument to -march
and -mtune
.
Unfortunately I don’t know what to try next… Any help would be very much appreciated! Thanks in advance.
Minimal code to reproduce problem
I ran this example:
https://brian2.readthedocs.io/en/stable/examples/CUBA.html
What you have aready tried
First tried with default gcc-9 / g+±9.
Updated to gcc-10 and g+±10 and set them as priority via update-alternatives
.
Tried setting CC=gcc and CXX=g++ in the terminal.
Checked that CC is set to gcc-10 via readlink -f $(which cc)
.
Ran the brian2 test suite finding that many tests fail.
Full traceback of error (if relevant)
WARNING Removing unsupported flag '-march=native' from compiler flags. [brian2.codegen.cpp_prefs]
cc1plus: error: bad value (‘tigerlake’) for ‘-march=’ switch
cc1plus: note: valid arguments to ‘-march=’ switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client icelake-server cascadelake bonnell atom silvermont slm goldmont goldmont-plus tremont knl knm x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 btver1 btver2 native
cc1plus: error: bad value (‘tigerlake’) for ‘-mtune=’ switch
cc1plus: note: valid arguments to ‘-mtune=’ switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client icelake-server cascadelake bonnell atom silvermont slm goldmont goldmont-plus tremont knl knm intel x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 btver1 btver2 generic native
/home/andrew/.cython/brian_extensions/_cython_magic_c60dbfbef46564730dc92eef23e9555e.cpp:36:10: fatal error: Python.h: No such file or directory
36 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
WARNING Cannot use Cython, a test compilation failed: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1 (CompileError)
Certain compiler configurations (e.g. clang in a conda environment on OS X) are known to be problematic. Note that you can switch the compiler by setting the 'CC' and 'CXX' environment variables. For example, you may want to try 'CC=gcc' and 'CXX=g++'. [brian2.codegen.runtime.cython_rt.cython_rt.failed_compile_test]
INFO Cannot use compiled code, falling back to the numpy code generation target. Note that this will likely be slower than using compiled code. Set the code generation to numpy manually to avoid this message:
prefs.codegen.target = "numpy" [brian2.devices.device.codegen_fallback]