espidf COMPONENT_DIR - cmake

I'm trying to compile a simple Hello_world example using the Smooth component (https://github.com/PerMalmberg/Smooth), and get error: include could not find load file:
../lib/compiler_options.cmake.
It seems that COMPONENT_DIR is not set, but I'm not aware whether/where to set this, or where this should have been set.
I've been staring at this too long, and am not finding the (apparently) obvious problem. Anyone any thoughts?
ERROR
Note: You are using Python 3.8.0. Python 3 support is new, please report any problems you encounter. Search for 'Setting
the Python Interpreter' in the ESP-IDF docs if you want to use Python 2.7.
Checking Python dependencies...
Python requirements from C:\Esp32_tools\esp-idf-v3.3\requirements.txt are satisfied.
Running cmake in directory C:\Temp\esp\testCPP\build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 --warn-uninitialized C:\Temp\esp\testCPP"...
Warn about uninitialized values.
-- Building for target esp32
-- ccache will be used for faster builds
CMake Error at C:/Temp/esp/testCPP/externals/smooth/smooth_component/CMakeLists.txt:21 (include):
include could not find load file:
../lib/compiler_options.cmake
Call Stack (most recent call first):
C:/Esp32_tools/esp-idf-v3.3/tools/cmake/scripts/expand_requirements.cmake:107 (include)
C:/Esp32_tools/esp-idf-v3.3/tools/cmake/scripts/expand_requirements.cmake:217 (expand_component_requirements)`
CMake Error at C:/Esp32_tools/esp-idf-v3.3/CMakeLists.txt:39 (message):
Failed to expand component requirements
VERSION
C:\Temp\esp\testCPP>cmake --version
cmake version 3.13.4
CMake suite maintained and supported by Kitware (kitware.com/cmake).
CMakeLists.txt
set(CMAKE_CXX_STANDARD 17)
if(${ESP_PLATFORM})
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
# Include Smooth as a component
set(EXTRA_COMPONENT_DIRS
externals/smooth/smooth_component)
project(name_of_your_project)
else()
# Empty project when not building for ESP (i.e. when loading the project into an IDE with already configured tool chains for native Linux)
endif()```

CMake Error at C:/Esp32_tools/esp-idf-v3.3/CMakeLists.txt:39 (message):
Failed to expand component requirements
You are missing this line in CMakeLists.txt
https://github.com/espressif/esp-idf/blob/master/examples/get-started/hello_world/CMakeLists.txt#L3

Related

Cross-compile tensorflow c library for mips64 failed

I found a problem when trying to cross-compile tensorflow c library for mips64 with mips64 cross-compile toolchains using cmake way. I want to deploy a small speech model on the mips64 board.
My steps:
I clone docker env and crooss compile using cmake way.
docker run -d -v /home/hart/Desktop/workspace/toolchains:/toochains --name=cmake_tflite tensorflow/tensorflow:latest-devel tail -f /dev/null
cmake cmds: `ARMCC_FLAGS="-Wall -O3"
ARMCC_PREFIX=/toochains/t31a/mips-gcc472-glibc216-64bit/bin/mips-linux-gnu-
cmake -DCMAKE_C_COMPILER=${ARMCC_PREFIX}gcc
-DCMAKE_CXX_COMPILER=${ARMCC_PREFIX}g++
-DCMAKE_C_FLAGS="${ARMCC_FLAGS}"
-DCMAKE_CXX_FLAGS="${ARMCC_FLAGS}"
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
-DCMAKE_SYSTEM_NAME=Linux
../tensorflow_src/tensorflow/lite/c
Error found when running CMake cmds above:
Setting build type to Release, for debug builds use'-DCMAKE_BUILD_TYPE=Debug'.
CMake Warning at /build_t31a/abseil-cpp/absl/copts/AbseilConfigureCopts.cmake:30 (message):
Value of CMAKE_SYSTEM_PROCESSOR (mips) is unknown and cannot be used to set
ABSL_RANDOM_RANDEN_COPTS
Call Stack (most recent call first):
/build_t31a/abseil-cpp/CMake/AbseilHelpers.cmake:18 (include)
/build_t31a/abseil-cpp/CMakeLists.txt:85 (include)
CMake Error at /build_t31a/eigen/CMakeLists.txt:119 (message):
Can't link to the standard math library. Please report to the Eigen
developers, telling them about your platform.
-- Configuring incomplete, errors occurred!
See also "/build_t31a/CMakeFiles/CMakeOutput.log".
See also "/build_t31a/CMakeFiles/CMakeError.log".
What's wrong with my cross-compile steps? Is MIPS64 not supported?
I also leave this message on tensorflow github.
I will appreciate any reply.
enter link description here

Errors during installing Geant4 in CentOS7

I'm trying to install Geant4 (version is 4.10.07.p01) and I got error refering to expat library priorities. I find a similar problem here Geant4 does not find Expat library and I followed the advice given. Since it's the first time I get into non-Windows OS, it is hard for me to understand some things. I changed the value to OFF but now I get the errors:
CMake Error at analysis/g4tools/CMakeLists.txt:36 (install):
install FILES given no DESTINATION
#but there is no CMakeLists.txt file in analysis/g4tools
CMake Error at analysis/CMakeLists.txt:36 (include):
include could not find load file:
Geant4MacroLibraryTargets
#but there is no CMakeLists.txt file in analysis
CMake Error at analysis/CMakeLists.txt:51 (GEANT_GLOBAL_LIBRARY_TARGET):
Unknown CMake command "GEANT4_GLOBAL_LIBRARY_TARGET"
#but there is no CMakeLists.txt file in analysis
Any help is welcome

Cmake when building LLVM

Trying to build llvm project LLVM Project with CMake, it gives me an error that I can't solve by my own.
For doing this, I am using an Ubuntu Virtual Machine (version 18.04) and I am trying to build the project with "ninja".
I have tried to build this with the following commands (which the LLVM Builder Guide says to use, https://llvm.org/docs/GettingStarted.html)
git clone https://github.com/llvm/llvm-project.git
cd llvm-project/
mkdir build && cd build
cmake -DLLVM_ENABLE_PROJECTS='all' -DCMAKE_BUILD_TYPE=Release -G 'Ninja' ../llvm
At the last command, I use the first flag to download all the projects and the second because I do not need the Debug tools.
The last command gives me the following error several times with different targets:
CMake Error at /usr/share/cmake-3.10/Modules/ExternalProject.cmake:2759 (get_property):
get_property could not find TARGET llgo. Perhaps it has not yet been
created.
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/ExternalProject.cmake:3032 (_ep_add_configure_command)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:200 (externalproject_add)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:219 (add_libgo_variant)
And this library error:
-- LLD version: 10.0.0
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find LibEdit (missing: libedit_INCLUDE_DIRS libedit_LIBRARIES)
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/home/enrique/Escritorio/llvm-project/lldb/cmake/modules/FindLibEdit.cmake:54 (find_package_handle_standard_args)
/home/enrique/Escritorio/llvm-project/lldb/cmake/modules/LLDBConfig.cmake:104 (find_package)
/home/enrique/Escritorio/llvm-project/lldb/CMakeLists.txt:21 (include)
-- Configuring incomplete, errors occurred!
See also "/home/enrique/Escritorio/llvm-project/build/CMakeFiles/CMakeOutput.log".
See also "/home/enrique/Escritorio/llvm-project/build/CMakeFiles/CMakeError.log".
I had the same issue, tried uninstalling the golang compiler (because I don't need llvm support for go); to no avail. I'm not an LLVM expert so this might not be the canonical solution but here's how I solved it:
I replaced
-DLLVM_ENABLE_PROJECTS='all'
by
-DLLVM_ENABLE_PROJECTS="proj1;proj2;proj3"
where I built the list "proj1;proj2;proj3" by grepping project is enabled$ in cmake output and removed the llgo project. I got a list like:
-- clang project is enabled
-- clang-tools-extra project is enabled
-- compiler-rt project is enabled
-- debuginfo-tests project is enabled
-- libclc project is enabled
-- libcxx project is enabled
-- libcxxabi project is enabled
-- libunwind project is enabled
-- lld project is enabled
-- lldb project is enabled
-- llgo project is enabled
-- openmp project is enabled
-- parallel-libs project is enabled
-- polly project is enabled
-- pstl project is enabled
and then built the following list with some vim macros/whatever you master (note: no llgo in there):
clang;clang-tools-extra;compiler-rt;debuginfo-tests;libclc;libcxx;libcxxabi;libunwind;lld;lldb;openmp;parallel-libs;polly;pstl
Then compiling llvm succeeded \o/

Catkin cannot find gtest

Since yesterday none of my packages containing tests build. Catkin complains it cannot find gtest when using catkin_add_gtests(), since GTEST_FOUND is FALSE. You can see this in the error msg below, with the custom output I added to my CMakeLists. Up to yesterday, GTEST_FOUND was TRUE when catkin_add_gtests() was called.
This is the error I always get. In this case I'm trying to build a mockup package on a clean catkin workspace:
Errors << silly_pkg:cmake /home/paco/catkin_ws2/logs/silly_pkg/build.cmake.002.log
Not searching for unused variables given on the command line.
Re-run cmake no build system arguments
-- Using CATKIN_DEVEL_PREFIX: /home/paco/catkin_ws2/devel/.private/silly_pkg
-- Using CMAKE_PREFIX_PATH: /home/paco/catkin_ws2/devel;/opt/ros/kinetic
-- This workspace overlays: /home/paco/catkin_ws2/devel;/opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/paco/catkin_ws2/build/silly_pkg/test_results
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.11
-- GTEST_FOUND: FALSE
CMake Warning at /opt/ros/kinetic/share/catkin/cmake/test/gtest.cmake:149 (message):
skipping gtest 'test_silly_pkg' in project 'silly_pkg' because gtest was
not found
Call Stack (most recent call first):
/opt/ros/kinetic/share/catkin/cmake/test/gtest.cmake:79 (_catkin_add_executable_with_google_test)
/opt/ros/kinetic/share/catkin/cmake/test/gtest.cmake:28 (_catkin_add_google_test)
CMakeLists.txt:28 (catkin_add_gtest)
CMake Error at /home/paco/catkin_ws2/src/silly_pkg/CMakeLists.txt:33 (target_link_libraries):
Cannot specify link libraries for target "test_silly_pkg" which is not
built by this project.
-- Configuring incomplete, errors occurred!
See also "/home/paco/catkin_ws2/build/silly_pkg/CMakeFiles/CMakeOutput.log".
See also "/home/paco/catkin_ws2/build/silly_pkg/CMakeFiles/CMakeError.log".
cd /home/paco/catkin_ws2/build/silly_pkg; catkin build --get-env silly_pkg | catkin env -si /usr/bin/cmake /home/paco/catkin_ws2/src/silly_pkg --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/home/paco/catkin_ws2/devel/.private/silly_pkg -DCMAKE_INSTALL_PREFIX=/home/paco/catkin_ws2/install; cd -
I am using catkin 0.7.11, libgtest-dev 1.7.0 and cmake 3.5.1. I use ROS Kinetic with Ubuntu 16.04. The only thing I did yesterday was reinstalling ROS Kinetic, but the package versions are exactly the same. Did anybody have this problem? Do you have any ideas on what could be happening?
EDIT 3/09/18:
By comparing with a functional catkin+gtest workspace in a different computer, I found out that the main difference is in the results of /opt/ros/kinetic/share/catkin/cmake/test/gtest.cmake. In the functional workspace, line 292 evaluates to TRUE (gtest/gmock is not a target) while in my workspace it evaluates to FALSE. This is because in my workspace running find_package(GMock QUIET) (line 287) sets gmock and gtest as imported targets, which does not happen in the other computer. Why is this different?
Thanks TikO for your help!
Since you wrote that cmake does not find the libraries and that you have reinstalled Kinetic, I assume that you have a freshly installed machine or wiped out gtest libraries by accident.
If you install libgtest-dev, you only get the sources which you need to build and install like this:
sudo apt-get install libgtest-dev
mkdir /tmp/gtest_build && cd /tmp/gtest_build
cmake /usr/src/gtest
make
#copy or symlink libgtest.a and ligtest_main.a to /usr/lib folder
sudo cp *.a /usr/lib
After this routine, you should be able to build again without cmake complaining.
Optional
If you have limited rights on your machine and you are not allowed to install the libraries in that way, just copy them into some home folder like
mkdir ~/lib && cp *.a ~/lib
But be aware of the fact, that you have to call catkin in the following way:
LIBRARY_PATH=~/lib GTEST_ROOT=~/lib catkin_make
LIBRARY_PATH tells the linker where to find the libraries, while GTEST_ROOT gives cmake the location hints for it's checks.
Reference: https://github.com/tik0/gtest_ros_example
SOLUTION FOUND
gmock and gtest were being set to imported target because the suggested manual compilation of libgtest had created a FindGMock.cmake file inside /usr/share/cmake-3.5/Modules. This file was being called by the find(GMock QUIET)
in catkin_add_gtests(), therefore setting the imported target. Just deleting FindGMock.cmake solved the issue.

Where is ITKConfig.cmake on Fedora?

My program uses
FIND_PACKAGE(ITK REQUIRED)
it gives me the error message
Could not find a package configuration file provided by "ITK" with any of
the following names:
ITKConfig.cmake
itk-config.cmake
I've installed the packages itk and itk-devel but none of them has any CMake module. The module from CMake itself is deprecated.
I am using Fedora 23 and CMake 3.4.1
edit:
After downloading ITK 4.9.1 and trying to build it with
cmake ../
I get the following error:
Performing Test C_HAS_WARNING-Wformat=2
Performing Test C_HAS_WARNING-Wformat=2 - Success
Performing Test CXX_HAS_WARNING-Wformat=2
Performing Test CXX_HAS_WARNING-Wformat=2 - Success
CMake Error at CMakeLists.txt:243 (include):
include could not find load file:
/home/.../InsightToolkit/InsightToolkit-4.9.1/Utilities/KWStyle/KWStyle.cmake
CMake Error at CMake/ITKModuleEnablement.cmake:43 (message):
No such module "ITKKWIML" needed by "ITKCommon"
Call Stack (most recent call first):
CMake/ITKModuleEnablement.cmake:59 (itk_module_check)
CMake/ITKModuleEnablement.cmake:59 (itk_module_check)
CMake/ITKModuleEnablement.cmake:66 (itk_module_check)
CMakeLists.txt:345 (include)
You need to build and install ITK from source. There is a detailed explanation here.
Once you have finished installing ITK, CMake will be able to find it.