riscv64-unknown-linux-gnu-g++: error: unrecognized command line option '-mavx2'

Clark

I am trying to compile a Tensorflow lite code by using the riscv toolchain. My target is RISC-V CVA6 core. I use the minimal example as the starting point.

I see the errors are related to the vector extension. The CVA6 core only supports I, M, A, and C extension. Does anyone know how to get around this issue or how to disable the V extension?

Thank you

Here are the steps:

mkdir minimal_build
cd minimal_build
RISCVCC_PREFIX=$HOME/toolchains/riscv/bin/riscv64-unknown-linux-gnu-
cmake -DCMAKE_C_COMPILER=${RISCVCC_PREFIX}gcc -DCMAKE_CXX_COMPILER=${RISCVCC_PREFIX}g++ -DTFLITE_ENABLE_XNNPACK=OFF ../tensorflow/lite/
cmake --build . -j

However, it gives me errors like below.

riscv64-unknown-linux-gnu-g++: error: unrecognized command line option '-mavx2'
riscv64-unknown-linux-gnu-g++: error: unrecognized command line option '-mavx512f'
riscv64-unknown-linux-gnu-g++: error: unrecognized command line option '-mfma'
_deps/ruy-build/ruy/CMakeFiles/ruy_have_built_path_for_avx2_fma.dir/build.make:75: recipe for target '_deps/ruy-build/ruy/CMakeFiles/ruy_have_built_path_for_avx2_fma.dir/have_built_path_for_avx2_fma.cc.o' failed
make[2]: *** [_deps/ruy-build/ruy/CMakeFiles/ruy_have_built_path_for_avx2_fma.dir/have_built_path_for_avx2_fma.cc.o] Error 1
riscv64-unknown-linux-gnu-g++: error: unrecognized command line option '-mavx512vl'
CMakeFiles/Makefile2:5423: recipe for target '_deps/ruy-build/ruy/CMakeFiles/ruy_have_built_path_for_avx2_fma.dir/all' failed
make[1]: *** [_deps/ruy-build/ruy/CMakeFiles/ruy_have_built_path_for_avx2_fma.dir/all] Error 2
riscv64-unknown-linux-gnu-g++: error: unrecognized command line option '-mavx512cd'
riscv64-unknown-linux-gnu-g++: error: unrecognized command line option '-mavx512bw'
riscv64-unknown-linux-gnu-g++: error: unrecognized command line option '-mavx512dq'
Clark

Thanks to the help from @teapot418 The below steps work

mkdir minimal_build
cd minimal_build

RISCVCC_PREFIX=$HOME/toolchains/riscv/bin/riscv64-unknown-linux-gnu-
RISCV_CC_FLAGS="-funsafe-math-optimizations"

cmake -DCMAKE_C_COMPILER=${RISCVCC_PREFIX}gcc \
  -DCMAKE_CXX_COMPILER=${RISCVCC_PREFIX}g++ \
  -DCMAKE_C_FLAGS="${RISCV_CC_FLAGS}" \
  -DCMAKE_CXX_FLAGS="${RISCV_CC_FLAGS}" \
  -DTFLITE_ENABLE_XNNPACK=OFF \
  -DCMAKE_SYSTEM_NAME=Linux \
  -DCMAKE_SYSTEM_PROCESSOR=rv64 \
  ../tensorflow/lite

cmake --build . -j

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

mips64el-linux-android-g++: error: unrecognized command line option '-mfpu=neon'

Error install psycopg2 linux " x86_64-linux-gnu-gcc: error: unrecognized command line option ‘-Qunused-arguments’"

g++: error: unrecognized command line option '-mt'

g++.exe: error: unrecognized command line option

Qt Android Error: arm-linux-androideabi-g++: error: unrecognized command line option '-fstack-protector-strong'

Error parsing command line : unrecognized option '--rest'

gcc: error: unrecognized command line option

cc1plus: error: unrecognized command line option "-fsysroot=<path>" with g++

cc1plus: error: unrecognized command line option "-std=c++11" with g++

g++-5.real: error: unrecognized command line option ‘-pthread-lQtGui’

g++: error: unrecognized command line option ‘-Wimplicit-fallthrough=0’ running gem install

unrecognized command line option ‘-framework’

libmad - gcc: error: unrecognized command line option '-fforce-mem'

pip error: unrecognized command line option ‘-fstack-protector-strong’

cppcheck: error: unrecognized command line option: "--file-filter

R gputools: gcc: error: unrecognized command line option ‘-Wp’

Ubuntu Terminal - gcc: error: unrecognized command line option ‘--showme:link’

gcc raises "unrecognized command line option" error with pkg-config

Error installing Python package (leven) written in C++: g++ unrecognized command line option --output-lib

Unrecognized command error in Linux

Apple M1 to Linux x86_64: unrecognized command-line option '-m64'

cmake error: "cc: error: unrecognized command line option ‘-std=c++20’; did you mean ‘-std=c++2a’?"

How to check if my ARM64 board supports 32 bit binary compilation? (error: unrecognized command line option ‘-m32’)

The error “base64: unrecognized option: w” is output in alpine linux

Unknown command line option '-skip'

Eliciting an "unrecognized command line option" from gcc

c++: error: unrecognized command line option ‘-std=c++14’

cc1plus.exe: error: unrecognized command line option '-fdump-class-hierarchy' with CMake

Error: unrecognized command line option ‘-Wno-invalid-source-encoding’ [-Werror] within building Mesos