More background e.g. in Homebrew/legacy-homebrew#14204.
The way it breaks in (our compiled) gcc is as follows:
[csympy] Building CXX object src/CMakeFiles/csympy.dir/symbol.cpp.o
[csympy] /var/tmp//ccc4Ii22.s:829:no such instruction: `vzeroupper'
[csympy] /var/tmp//ccc4Ii22.s:847:no such instruction: `vzeroupper'
[csympy] /var/tmp//ccc4Ii22.s:855:no such instruction: `vzeroupper'
...
The linker (which is Apple linker) complains that it doesn't understand the AVX instructions, emitted (correctly) by gcc's -march=native, since my computer supports AVX. A quick workaround is to do
diff --git a/pkgs/csympy.yaml b/pkgs/csympy.yaml
index 5caa557..32bf39d 100644
--- a/pkgs/csympy.yaml
+++ b/pkgs/csympy.yaml
@@ -12,6 +12,12 @@ defaults:
relocatable: false
build_stages:
+- name: cxx_flags
+ before: configure
+ handler: bash
+ bash: |
+ export CXXFLAGS="-mno-avx"
+
- name: configure
extra: ['-D WITH_PYTHON:BOOL=ON',
'-D PYTHON_INSTALL_PATH:PATH=$ARTIFACT/{{python_site_packages_rel}}']
But this is not a solution, because you want to be able to use AVX instructions if your processor supports it, and gcc generates them, i.e. you must be able to use -march=native.
The fix is to either make gcc generate AVX instructions so that the Apple's linker can understand, or we need to build our own linker.
More background e.g. in Homebrew/legacy-homebrew#14204.
The way it breaks in (our compiled) gcc is as follows:
The linker (which is Apple linker) complains that it doesn't understand the AVX instructions, emitted (correctly) by gcc's
-march=native, since my computer supports AVX. A quick workaround is to doBut this is not a solution, because you want to be able to use AVX instructions if your processor supports it, and gcc generates them, i.e. you must be able to use
-march=native.The fix is to either make gcc generate AVX instructions so that the Apple's linker can understand, or we need to build our own linker.