Xtensa compiler doesn't work in CLion

ReyMagos
Posts: 3
Joined: Thu May 20, 2021 12:48 pm

Xtensa compiler doesn't work in CLion

Postby ReyMagos » Thu May 20, 2021 1:49 pm

Hello! I'm new at ESP-IDF and just started to setup idf environment in CLion.
Firstly I cloned idf repository via

Code: Select all

git clone --recursive https://github.com/espressif/esp-idf.git
Next step I installed MSYS2 according to https://docs.espressif.com/projects/esp ... setup.html
In Preferencs/Build, Execution, Deployment/Toolchains In CLion I setted compilers (Screenshot_1)

There was this error in CMake log:

Code: Select all

-- The C compiler identification is GNU 8.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/msys32/opt/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/msys32/opt/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe - broken
CMake Error at C:/Program Files/JetBrains/CLion 2020.3.3/bin/cmake/win/share/cmake-3.19/Modules/CMakeTestCCompiler.cmake:66 (message):
  The C compiler

    "C:/msys32/opt/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: C:/Users/User/Desktop/esp32/test/cmake-build-debug/CMakeFiles/CMakeTmp
    
    Run Build Command(s):C:/msys32/usr/bin/make.exe cmTC_b9276/fast && /usr/bin/make  -f CMakeFiles\cmTC_b9276.dir\build.make CMakeFiles/cmTC_b9276.dir/build
 
 
     make: *** [Makefile:139: cmTC_b9276/fast] Error 1
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


-- Configuring incomplete, errors occurred!
See also "C:/Users/User/Desktop/esp32/test/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "C:/Users/User/Desktop/esp32/test/cmake-build-debug/CMakeFiles/CMakeError.log".

[Finished]
And I don't understand how to fix this problem. Any ideas? I will be grateful for any help.
Attachments
Screenshot_1.png
Screenshot_1.png (41.32 KiB) Viewed 5739 times

ESP_bignacio
Posts: 229
Joined: Wed May 02, 2018 12:12 pm

Re: Xtensa compiler doesn't work in CLion

Postby ESP_bignacio » Fri May 21, 2021 8:28 am

You need to add the Xtensa toolchain to the environment variable PATH, either globally in your system or in the CLion environment variables.

ReyMagos
Posts: 3
Joined: Thu May 20, 2021 12:48 pm

Re: Xtensa compiler doesn't work in CLion

Postby ReyMagos » Fri May 21, 2021 12:40 pm

I added to PATH next values:
C:\msys32\mingw32\bin
C:\msys32\opt\xtensa-esp32-elf\bin
C:\msys32\usr\bin

After in log except old message new appeared: make: cmd.exe: No such file or directory
I added C:\Windows\system32 to PATH and now log is same as old.

ReyMagos
Posts: 3
Joined: Thu May 20, 2021 12:48 pm

Re: Xtensa compiler doesn't work in CLion

Postby ReyMagos » Mon May 24, 2021 1:05 pm

Problem solved by adding in CMake options: -DCMAKE_SYSTEM_NAME=Generic

Thank you!

Who is online

Users browsing this forum: grantb and 39 guests