-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile error on centos system #319
Comments
do you change native C code? |
I want to do some work on native code, but I can't compile successful before I do any change. Just modify the Makefile for some compile errors: CFLAGS := -mno-red-zone |
DONOT change any flags. At present, |
(base) [eric@icx250 sonic]$ make Do not change any word, get this error. |
only use it on macOS and clang 12+ |
Seems that this is because you have changed the makefile: |
As a open source project, you'd better clarify this limitation in the readme. |
This is only used for our development, not for sonic's users. If you want to use |
I want to modify the native code with AVX512 and check the performance. |
Actually our team has tried this and it decreased the speed due to the CPU underclocking effects introduced by AVX512. You can just try it in C-code benchmark (like Google Test, etc.) |
Which CPU platform did you test on? |
As I know, on the latest Intel platform, Icelake or SPR, the problem of underclocking has been solved. |
cc @PureWhiteWu @liuq19 @chenzhuoyu , any code left? |
checkout this repo should be compile with clang on linux(arch).But asm2asm need further work |
yeah, asm2asm does not works in Linux because of different asm syntax. |
yep, I believe if we want sonic running on ARM we should spill the work to two-step.
|
Any plan to support Linux? |
Perhaps using Example
|
Does anyone develop native code on Centos?
My ENV: Intel Xeon, Centos 8, Python 3.9.0, clang version 13.0.0, get some compile error with the latest code:
(py39_env) [eric@icx250 sonic]$ make
mkdir -p internal/native/avx/
echo '// Code generated by Makefile, DO NOT EDIT.' > internal/native/avx/native_amd64.go
echo >> internal/native/avx/native_amd64.go
sed -e 's/{{PACKAGE}}/avx/g' internal/native/native_amd64.tmpl >> internal/native/avx/native_amd64.go
mkdir -p output/avx
clang -mno-red-zone -fno-asynchronous-unwind-tables -fno-builtin -fno-exceptions -fno-rtti -fno-stack-protector -nostdlib -O3 -Wall -Werror -Wno-misleading-indentation -Wno-incompatible-pointer-types -msse -mno-sse4 -mavx -mno-avx2 -DUSE_AVX=1 -DUSE_AVX2=0 -S -o output/avx/native.s native/native.c
python3 tools/asm2asm/asm2asm.py internal/native/avx/native_amd64.s output/avx/native.s
Traceback (most recent call last):
File "/home/download/sonic_dir/sonic/tools/asm2asm/asm2asm.py", line 2132, in
main()
File "/home/download/sonic_dir/sonic/tools/asm2asm/asm2asm.py", line 2067, in main
asm.parse(src, proto)
File "/home/download/sonic_dir/sonic/tools/asm2asm/asm2asm.py", line 1979, in parse
self._parse(src)
File "/home/download/sonic_dir/sonic/tools/asm2asm/asm2asm.py", line 1857, in _parse
raise SyntaxError('invalid assembly command: ' + cmd.cmd)
SyntaxError: invalid assembly command: .text
make: *** [Makefile:108: internal/native/avx/native_amd64.s] Error 1
Is this a config problem, or the asm2asm.py just only support the assembly code compile from Mac OS?
The text was updated successfully, but these errors were encountered: