espressif / esp-wasmachine

The Machine which can run WASM applications.
58 stars 5 forks source link

error on switch target to esp32c6 #5

Open gordonlukch opened 2 months ago

gordonlukch commented 2 months ago

Dear,

I just try new support target "esp32c6", but i got error as below error log:

-------- idf_py_stderr_output ------------- CMake Error at /usr/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake:69 (message): The C compiler

"/home/gordon/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /mnt/extra_nvme1/dev_src/test_wasmachine/esp-wasmachine/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_05684 && [1/2] Building C object CMakeFiles/cmTC_05684.dir/testCCompiler.c.obj
FAILED: CMakeFiles/cmTC_05684.dir/testCCompiler.c.obj 
/home/gordon/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc   -march=rv32imac_zicsr_zifencei -o CMakeFiles/cmTC_05684.dir/testCCompiler.c.obj -c /mnt/extra_nvme1/dev_src/test_wasmachine/esp-wasmachine/build/CMakeFiles/CMakeTmp/testCCompiler.c
Assembler messages:
Fatal error: invalid -march= option: `rv32imac_zicsr_zifencei'
ninja: build stopped: subcommand failed.

CMake will not be able to correctly generate this project. Call Stack (most recent call first): /home/gordon/esp/v5.2.1/esp-idf/tools/cmake/project.cmake:506 (__project) CMakeLists.txt:25 (project)

I unable to build it. Please see if any idea to solve it. Thank you.

I tried to build esp32s3 and it's success. Unfortunately, i don't have s3 board on hand.

donghengqaz commented 2 months ago

Hi, @gordonlukch I just compile with esp-idf(v5.2.1, commit ID: a322e6bdad4) and target is C6, but I have no issue like you, my steps is:

idf.py set-target esp32c6
idf.py build

Do you use esp-idf v5.2.1 completed tools, like GCC? Or do you add some more code in cmake script?

You can try to run ./install.sh in esp-idf's root directory.

gordonlukch commented 2 months ago

Dear @donghengqaz, FYI, my idf version is 5.2.1 and i hadn't add any code in cmake script, just simple clone the repo.

> idf.py --version 
ESP-IDF v5.2.1-dirty 

And i found something wrong on switch target to esp32c6, it should be problem on Incorrect detect compilers

> get_idf
> idf.py clean
> idf.py fullclean
> idf.py set-target esp32c6

Error like below...

...
Adding "set-target"'s dependency "fullclean" to list of commands with default set of options.
Executing action: fullclean
Build directory '/mnt/extra_nvme1/dev_src/test_wasmachine/esp-wasmachine/build' is empty. Nothing to clean.
Executing action: set-target
Set Target to: esp32c6, new sdkconfig will be created.
Running cmake in directory /mnt/extra_nvme1/dev_src/test_wasmachine/esp-wasmachine/build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DPYTHON=/home/gordon/.espressif/python_env/idf5.2_py3.10_env/bin/python -DESP_PLATFORM=1 -DIDF_TARGET=esp32c6 -DCCACHE_ENABLE=0 /mnt/extra_nvme1/dev_src/test_wasmachine/esp-wasmachine"...
destination path 'components/lvgl' exists and skip this process
destination path 'components/esp-rainmaker' exists and skip this process
destination path 'components/wamr/wasm-micro-runtime' exists and skip this process
-- Existing sdkconfig '/mnt/extra_nvme1/dev_src/test_wasmachine/esp-wasmachine/sdkconfig' renamed to '/mnt/extra_nvme1/dev_src/test_wasmachine/esp-wasmachine/sdkconfig.old'.
-- Found Git: /usr/bin/git (found version "2.34.1") 
-- Component directory /mnt/extra_nvme1/dev_src/test_wasmachine/esp-wasmachine/components/esp-rainmaker/components/esp-insights does not contain a CMakeLists.txt file. No component will be added
-- Component directory /mnt/extra_nvme1/dev_src/test_wasmachine/esp-wasmachine/components/esp-rainmaker does not contain a CMakeLists.txt file. No component will be added
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- The ASM compiler identification is GNU
-- Found assembler: /home/gordon/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /home/gordon/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc
-- Check for working C compiler: /home/gordon/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc - broken
CMake Error at /usr/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "/home/gordon/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /mnt/extra_nvme1/dev_src/test_wasmachine/esp-wasmachine/build/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/ninja cmTC_bb06e && [1/2] Building C object CMakeFiles/cmTC_bb06e.dir/testCCompiler.c.obj
    FAILED: CMakeFiles/cmTC_bb06e.dir/testCCompiler.c.obj 
    /home/gordon/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc   -march=rv32imac_zicsr_zifencei -o CMakeFiles/cmTC_bb06e.dir/testCCompiler.c.obj -c /mnt/extra_nvme1/dev_src/test_wasmachine/esp-wasmachine/build/CMakeFiles/CMakeTmp/testCCompiler.c
    Assembler messages:
    Fatal error: invalid -march= option: `rv32imac_zicsr_zifencei'
    ninja: build stopped: subcommand failed.
...

but when i switch target to esp32s3, detect correct and build successful

> get_idf
> idf.py clean
> idf.py fullclean
> idf.py set-target esp32s3
idf.py set-target esp32s3
Adding "set-target"'s dependency "fullclean" to list of commands with default set of options.
Executing action: fullclean
Executing action: set-target
Set Target to: esp32s3, new sdkconfig will be created.
Running cmake in directory /mnt/extra_nvme1/dev_src/test_wasmachine/esp-wasmachine/build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DPYTHON=/home/gordon/.espressif/python_env/idf5.2_py3.10_env/bin/python -DESP_PLATFORM=1 -DIDF_TARGET=esp32s3 -DCCACHE_ENABLE=0 /mnt/extra_nvme1/dev_src/test_wasmachine/esp-wasmachine"...
destination path 'components/lvgl' exists and skip this process
destination path 'components/esp-rainmaker' exists and skip this process
destination path 'components/wamr/wasm-micro-runtime' exists and skip this process
-- Existing sdkconfig '/mnt/extra_nvme1/dev_src/test_wasmachine/esp-wasmachine/sdkconfig' renamed to '/mnt/extra_nvme1/dev_src/test_wasmachine/esp-wasmachine/sdkconfig.old'.
-- Found Git: /usr/bin/git (found version "2.34.1") 
-- Component directory /mnt/extra_nvme1/dev_src/test_wasmachine/esp-wasmachine/components/esp-rainmaker/components/esp-insights does not contain a CMakeLists.txt file. No component will be added
-- Component directory /mnt/extra_nvme1/dev_src/test_wasmachine/esp-wasmachine/components/esp-rainmaker does not contain a CMakeLists.txt file. No component will be added
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/gordon/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32s3-elf-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/gordon/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32s3-elf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
...
..
.
> idf.py build

Any idea to make it work correctly? Thanks.

donghengqaz commented 2 months ago

Hi @gordonlukch I guess your compiling environment has some issues, so please check to release/v5.2, install the newest environment by following commanders:

./install.sh

. ./export.sh

Then remove compiling files and recompile SDK:

rm -rf build sdkconfig

idf.py set-target esp32c6
idf.py build
wujiangang commented 2 months ago

@gordonlukch Can you compile esp-idf/examples/get-started/blink by using esp32c6? To confirm it's related to your building env. And you can check whether riscv32-esp-elf-gcc is runable.

/home/gordon/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc -v

Last, you can remove /home/gordon/.espressif/tools/riscv32-esp-elf and re-install the toolchain by using ./install.sh again.

gordonlukch commented 2 months ago

Dear @donghengqaz @wujiangang, thanks for your quick response. And you are right, problem on my idf building env. it should mixed up lot of old version tools on my .espressif/tools. After following the clean up steps, look like problem has gone ;-)

> python /home/gordon/esp/esp-idf/tools/idf_tools.py uninstall
> python3 /home/gordon/esp/esp-idf/tools/idf_tools.py uninstall --remove-archives
> ./install.sh
> . ./export.sh

Now, I could switch target to esp32c6 and got my first successful build ... thank you very much.

Other good news, postman just hand over a parcel(s3-box-3b) to me, i may test it later as well. :-D