Cant Compile project with component in Linux environment

naitik
Posts: 19
Joined: Thu Apr 22, 2021 2:04 pm

Cant Compile project with component in Linux environment

Postby naitik » Mon Jul 12, 2021 5:49 am

Hello, I have a project which uses ESP IDF. I am using VSCode extension. My project has multiple components. each consists inc and src directory. this project compiles successfully on windows environment's ESP-IDF but when I compile in Linux environment which is Pop os Here it fails with Include error because it cant find the file from component I have created. I want know why its happening in case of linux only? it ESP_IDF and including OS is newly installed on my PC. is there update in ESP-IDF that's causing this or the file path having issue in CMake ?
Here is CmakeLists of component :
  1. set(COMPONENT_ADD_INCLUDEDIRS "inc")
  2. set(COMPONENT_SRCS "src/src_file1.c"
  3.                    "src/src_file2.c"
  4. )
  5. set(COMPONENT_REQUIRES "esp_adc_cal")
  6. register_component()

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: Cant Compile project with component in Linux environment

Postby ESP_igrr » Mon Jul 12, 2021 7:50 am

Possibly case-sensitive filesystem on Linux vs. non-case-sensitive one on Windows is the reason? Are the file names exactly the same case as you have in CMakeLists?

naitik
Posts: 19
Joined: Thu Apr 22, 2021 2:04 pm

Re: Cant Compile project with component in Linux environment

Postby naitik » Mon Jul 12, 2021 8:22 am

I checked and found all components uses lowercase letters.

naitik
Posts: 19
Joined: Thu Apr 22, 2021 2:04 pm

Re: Cant Compile project with component in Linux environment

Postby naitik » Mon Jul 12, 2021 8:29 am

What i also found that when i build project it looks like ESP-IDF not even looking at CMakeLists.txt in each component because when i add invalid source file name there as far as i know esp-idf should return that no .c .h .cpp etc file found.

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: Cant Compile project with component in Linux environment

Postby ESP_igrr » Mon Jul 12, 2021 8:34 am

Can you run 'idf.py reconfigure' and post the output you get? There should be a part where CMake will list all the components it found.

naitik
Posts: 19
Joined: Thu Apr 22, 2021 2:04 pm

Re: Cant Compile project with component in Linux environment

Postby naitik » Mon Jul 12, 2021 8:40 am

Looks like components I made are not included
Here is output :
  1. Executing action: reconfigure
  2. Running cmake in directory /home/nik/Documents/GitHub/swtich_prototype_v2/build
  3. Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -DCCACHE_ENABLE=0 /home/nik/Documents/GitHub/swtich_prototype_v2"...
  4. -- Building ESP-IDF components for target esp32
  5. -- Project sdkconfig file /home/nik/Documents/GitHub/swtich_prototype_v2/sdkconfig
  6. CMake Warning (dev) at /home/nik/esp/esp-idf/components/mbedtls/CMakeLists.txt:114 (target_sources):
  7.   Policy CMP0076 is not set: target_sources() command converts relative paths
  8.   to absolute.  Run "cmake --help-policy CMP0076" for policy details.  Use
  9.   the cmake_policy command to set the policy and suppress this warning.
  10.  
  11.   A private source from a directory other than that of target "mbedcrypto"
  12.   has a relative path.
  13. This warning is for project developers.  Use -Wno-dev to suppress it.
  14.  
  15. -- App "wifi_prov_mgr" version: a54f77a-dirty
  16. -- Adding linker script /home/nik/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.ld
  17. -- Adding linker script /home/nik/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.api.ld
  18. -- Adding linker script /home/nik/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
  19. -- Adding linker script /home/nik/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-data.ld
  20. -- Adding linker script /home/nik/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.syscalls.ld
  21. -- Adding linker script /home/nik/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
  22. -- Adding linker script /home/nik/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-time.ld
  23. -- Adding linker script /home/nik/Documents/GitHub/swtich_prototype_v2/build/esp-idf/esp32/esp32_out.ld
  24. -- Adding linker script /home/nik/esp/esp-idf/components/esp32/ld/esp32.project.ld.in
  25. -- Adding linker script /home/nik/esp/esp-idf/components/esp32/ld/esp32.peripherals.ld
  26. -- Components: app_trace app_update asio bootloader bootloader_support bt cbor cmock coap console cxx driver efuse esp-tls esp32 esp_adc_cal esp_common esp_eth esp_event esp_gdbstub esp_hid esp_http_client esp_http_server esp_https_ota esp_https_server esp_hw_support esp_ipc esp_local_ctrl esp_netif esp_pm esp_ringbuf esp_rom esp_serial_slave_link esp_system esp_timer esp_websocket_client esp_wifi espcoredump esptool_py expat fatfs freemodbus freertos hal heap idf_test jsmn json libsodium log lwip main mbedtls mdns mqtt newlib nghttp nvs_flash openssl partition_table perfmon protobuf-c protocomm pthread sdmmc soc spi_flash spiffs tcp_transport tcpip_adapter tinyusb ulp unity vfs wear_levelling wifi_provisioning wpa_supplicant xtensa
  27. -- Component paths: /home/nik/esp/esp-idf/components/app_trace /home/nik/esp/esp-idf/components/app_update /home/nik/esp/esp-idf/components/asio /home/nik/esp/esp-idf/components/bootloader /home/nik/esp/esp-idf/components/bootloader_support /home/nik/esp/esp-idf/components/bt /home/nik/esp/esp-idf/components/cbor /home/nik/esp/esp-idf/components/cmock /home/nik/esp/esp-idf/components/coap /home/nik/esp/esp-idf/components/console /home/nik/esp/esp-idf/components/cxx /home/nik/esp/esp-idf/components/driver /home/nik/esp/esp-idf/components/efuse /home/nik/esp/esp-idf/components/esp-tls /home/nik/esp/esp-idf/components/esp32 /home/nik/esp/esp-idf/components/esp_adc_cal /home/nik/esp/esp-idf/components/esp_common /home/nik/esp/esp-idf/components/esp_eth /home/nik/esp/esp-idf/components/esp_event /home/nik/esp/esp-idf/components/esp_gdbstub /home/nik/esp/esp-idf/components/esp_hid /home/nik/esp/esp-idf/components/esp_http_client /home/nik/esp/esp-idf/components/esp_http_server /home/nik/esp/esp-idf/components/esp_https_ota /home/nik/esp/esp-idf/components/esp_https_server /home/nik/esp/esp-idf/components/esp_hw_support /home/nik/esp/esp-idf/components/esp_ipc /home/nik/esp/esp-idf/components/esp_local_ctrl /home/nik/esp/esp-idf/components/esp_netif /home/nik/esp/esp-idf/components/esp_pm /home/nik/esp/esp-idf/components/esp_ringbuf /home/nik/esp/esp-idf/components/esp_rom /home/nik/esp/esp-idf/components/esp_serial_slave_link /home/nik/esp/esp-idf/components/esp_system /home/nik/esp/esp-idf/components/esp_timer /home/nik/esp/esp-idf/components/esp_websocket_client /home/nik/esp/esp-idf/components/esp_wifi /home/nik/esp/esp-idf/components/espcoredump /home/nik/esp/esp-idf/components/esptool_py /home/nik/esp/esp-idf/components/expat /home/nik/esp/esp-idf/components/fatfs /home/nik/esp/esp-idf/components/freemodbus /home/nik/esp/esp-idf/components/freertos /home/nik/esp/esp-idf/components/hal /home/nik/esp/esp-idf/components/heap /home/nik/esp/esp-idf/components/idf_test /home/nik/esp/esp-idf/components/jsmn /home/nik/esp/esp-idf/components/json /home/nik/esp/esp-idf/components/libsodium /home/nik/esp/esp-idf/components/log /home/nik/esp/esp-idf/components/lwip /home/nik/Documents/GitHub/swtich_prototype_v2/main /home/nik/esp/esp-idf/components/mbedtls /home/nik/esp/esp-idf/components/mdns /home/nik/esp/esp-idf/components/mqtt /home/nik/esp/esp-idf/components/newlib /home/nik/esp/esp-idf/components/nghttp /home/nik/esp/esp-idf/components/nvs_flash /home/nik/esp/esp-idf/components/openssl /home/nik/esp/esp-idf/components/partition_table /home/nik/esp/esp-idf/components/perfmon /home/nik/esp/esp-idf/components/protobuf-c /home/nik/esp/esp-idf/components/protocomm /home/nik/esp/esp-idf/components/pthread /home/nik/esp/esp-idf/components/sdmmc /home/nik/esp/esp-idf/components/soc /home/nik/esp/esp-idf/components/spi_flash /home/nik/esp/esp-idf/components/spiffs /home/nik/esp/esp-idf/components/tcp_transport /home/nik/esp/esp-idf/components/tcpip_adapter /home/nik/esp/esp-idf/components/tinyusb /home/nik/esp/esp-idf/components/ulp /home/nik/esp/esp-idf/components/unity /home/nik/esp/esp-idf/components/vfs /home/nik/esp/esp-idf/components/wear_levelling /home/nik/esp/esp-idf/components/wifi_provisioning /home/nik/esp/esp-idf/components/wpa_supplicant /home/nik/esp/esp-idf/components/xtensa
  28. -- Configuring done
  29. -- Generating done

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: Cant Compile project with component in Linux environment

Postby ESP_igrr » Mon Jul 12, 2021 4:04 pm

Indeed, it seems that no components other than "main" are included from your project.
What is the project directory structure? Is the "components" directory name lower case? You can get it by running "tree -I build" from the project directory. ("-I build" excludes the build directory from the list)

naitik
Posts: 19
Joined: Thu Apr 22, 2021 2:04 pm

Re: Cant Compile project with component in Linux environment

Postby naitik » Thu Jul 15, 2021 3:46 am

so as you asked if component directory contains lowercase letter it actually wasn't it was like ''Components" when i renamed it to "component" finally idf was looking into components directory and i could compile the program successfully. Thanks for pointing that out.

Who is online

Users browsing this forum: No registered users and 98 guests