Why do my Conan packages appear to be getting corrupted? - conan

Background
I have a project which was using boost/1.71.0#conan/stable, and was giving me a compile-time error. I decided to try boost/1.72.0 just on the off chance that it might fix it. When I did, I got this:
1> [CMake] ERROR: boost/1.72.0: Error in source() method, line 151
1> [CMake] tools.get(**self.conan_data["sources"][self.version])
1> [CMake] AttributeError: 'NoneType' object has no attribute 'token'
1> [CMake] CMake Error at out/build/x64-Debug/conan.cmake:402 (message):
1> [CMake] Conan install failed='1'
1> [CMake] Call Stack (most recent call first):
1> [CMake] out/build/x64-Debug/conan.cmake:497 (conan_cmake_install)
1> [CMake] CMakeLists.txt:41 (conan_cmake_run)
which references the conan_cmake_run() call in my CMakeLists.txt:
if(CONAN_EXPORTED) # in conan local cache
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
else() # in user space
include(${CMAKE_BINARY_DIR}/conan.cmake)
conan_cmake_run(CONANFILE conanfile.txt
BASIC_SETUP
BUILD missing)
endif()
and line 151 in the boost conanfile.py:
if tools.os_info.is_windows:
sha256 = "85a94ac71c28e59cf97a96714e4c58a18550c227ac8b0388c260d6c717e47a69"
extension = ".zip"
else:
sha256 = "d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee"
extension = ".tar.bz2"
zip_name = "%s%s" % (self.folder_name, extension)
url = "https://dl.bintray.com/boostorg/release/%s/source/%s" % (self.version, zip_name)
151: tools.get(url, sha256=sha256)
...
My conanfile.txt:
[requires]
boost/1.72.0
...some of my own packages...
[generators]
cmake
[options]
boost:shared=True
What I've Tried
Upgrading Conan from 1.21 to 1.23. That gave me a different error ("Forbidden" something or other), so after trying to get rid of that for a while, I reverted. I also updated Pip somewhere in here.
Removing boost packages using conan remove boost/*
Other boost versions... I've tried boost/1.71.0, boost/1.72.0, and boost/1.71.0#conan/stable. The latter, which worked initially, no longer works after removing all boost packages. Related to that, when I generate the CMake cache for a second time (i.e. the boost package is already in the local cache), I get these warnings:
1> [CMake] boost/1.72.0: Configuring sources in C:\.conan\133b85\1
1> [CMake] boost/1.72.0: WARN: Package is corrupted, removing folder: C:\.conan\854baa\1
1> [CMake] boost/1.72.0: WARN: Build folder is dirty, removing it: C:\.conan\34c708\1
1> [CMake] boost/1.72.0: WARN: Trying to remove corrupted source folder
1> [CMake] boost/1.72.0: WARN: This can take a while for big packages
1> [CMake] ERROR: boost/1.72.0: Error in source() method, line 151]
... snip: the additional errors already copied at the beginning of the post ...
So, my suspicion is that even the formerly working boost/1.71.0#conan/stable is being corrupted upon a fresh pull.
Note: This happens when instructing Visual Studio to generate the CMake cache.

The URL used in the package recipe: https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.bz2, is not working. It seems the download URL has some issues, you can try downloading in your browser. So not Conan related, not an issue of the recipe.

Related

Unknown CMake command "tablegen"

I'm trying to compile MLIR with the command:
cmake -G "Unix Makefiles" -DLLVM_ENABLE_PROJECTS=“mlir” ../mlir
Then came the CMake Error:
...
CMake Error at CMakeLists.txt:10 (tablegen):
Unknown CMake command "tablegen".
Call Stack (most recent call first):
include/mlir/Analysis/CMakeLists.txt:2 (mlir_tablegen)
...
I can't figure out what went wrong, how can I fix it?
Whichever llvm project you want to build, you still need to run cmake for the source directory corresponding to top-level llvm directory, not for its subdirectory.
Top-level directory is where you clone the project https://github.com/llvm/llvm-project.

Build project from ExternalProject_Add using dockcross

I am trying to build tinyxml2 using ExternalProject_Add. It works fine on my main system (Arch Linux), but I have some issues when running it inside dockcross (more specifically, dockcross/linux-armv6).
The following minimal CMakeLists.txt works (configure and build) from dockcross:
cmake_minimum_required(VERSION 3.1)
project(external-tinyxml2)
include(ExternalProject)
ExternalProject_add(
tinyxml2
URL https://github.com/leethomason/tinyxml2/archive/7.0.1.tar.gz
PREFIX tinyxml2
)
But the following doesn't (note the added line: CONFIGURE_COMMAND ${CMAKE_COMMAND} -S<SOURCE_DIR>):
cmake_minimum_required(VERSION 3.1)
project(external-tinyxml2)
include(ExternalProject)
ExternalProject_add(
tinyxml2
URL https://github.com/leethomason/tinyxml2/archive/7.0.1.tar.gz
PREFIX tinyxml2
CONFIGURE_COMMAND ${CMAKE_COMMAND} -S<SOURCE_DIR>
)
It actually results in the following error output:
[ 25%] No patch step for 'tinyxml2'
[ 37%] No update step for 'tinyxml2'
[ 50%] Performing configure step for 'tinyxml2'
CMake Deprecation Warning at CMakeLists.txt:11 (cmake_policy):
The OLD behavior for policy CMP0063 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
CMake Error at /usr/share/cmake-3.13/Modules/CMakeDetermineCompilerId.cmake:161 (file):
file problem creating directory: /CMakeFiles/3.13.2/CompilerIdC
Call Stack (most recent call first):
/usr/share/cmake-3.13/Modules/CMakeDetermineCompilerId.cmake:31 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
/usr/share/cmake-3.13/Modules/CMakeDetermineCCompiler.cmake:112 (CMAKE_DETERMINE_COMPILER_ID)
CMakeLists.txt:14 (project)
[... other similar errors ...]
CMake Error at /usr/share/cmake-3.13/Modules/CMakeTestCCompiler.cmake:37 (try_compile):
Failed to set working directory to /CMakeFiles/CMakeTmp/testCCompiler.c :
No such file or directory
Call Stack (most recent call first):
CMakeLists.txt:14 (project)
-- Configuring incomplete, errors occurred!
CMake Error: Cannot open file for write: /CMakeCache.txt.tmp
CMake Error: : System Error: Permission denied
CMake Error: Unable to open cache file for save. /CMakeCache.txt
CMake Error: : System Error: Permission denied
CMakeFiles/tinyxml2.dir/build.make:108: recipe for target 'tinyxml2/src/tinyxml2-stamp/tinyxml2-configure' failed
make[2]: *** [tinyxml2/src/tinyxml2-stamp/tinyxml2-configure] Error 1
make[2]: Leaving directory '/work/build'
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/tinyxml2.dir/all' failed
make[1]: *** [CMakeFiles/tinyxml2.dir/all] Error 2
make[1]: Leaving directory '/work/build'
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
make: Leaving directory '/work/build
Building tinyxml2 directly from dockcross (i.e. without using ExternalProject_Add) works well.
What could be going wrong there?
That is actually a bug in CMake, as reported (and fixed) here.
The workaround, for CMake versions that have the bug, is to run it like so (note that -S<SOURCE_DIR> becomes <SOURCE_DIR>):
ExternalProject_add(
tinyxml2
URL https://github.com/leethomason/tinyxml2/archive/7.0.1.tar.gz
PREFIX tinyxml2
CONFIGURE_COMMAND ${CMAKE_COMMAND} <SOURCE_DIR>
)

cmake error with catkin_make, ROS installation

I have created a workspace as catkin_ws. Then, catkin_make was run successful.
After I type catkin_create_pkg ros_basics_tutorials std_msgs rospy roscpp and then the all folders and files created in ros_basics_tutorials folder.
However After this command, I type cd catkin_ws
and then catkin_make
Below error is shown Cmake Error, Could NOT find cpp (missing: cpp_DIR), cmake_check_build_system' failed
Base path: /home/selcuk/catkin_ws
Source space: /home/selcuk/catkin_ws/src
Build space: /home/selcuk/catkin_ws/build
Devel space: /home/selcuk/catkin_ws/devel
Install space: /home/selcuk/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/selcuk/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/selcuk/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/selcuk/catkin_ws/devel;/opt/ros/melodic
-- This workspace overlays: /home/selcuk/catkin_ws/devel;/opt/ros/melodic
-- Using PYTHON_EXECUTABLE: /home/selcuk/python/anaconda2/bin/python2
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/selcuk/catkin_ws/build/test_results
CMake Error: Target gtest has dependency information when it shouldn't.
Your cache is probably stale. Please remove the entry
gtest_LIB_DEPENDS
from the cache.
CMake Error: Target gtest_main has dependency information when it shouldn't.
Your cache is probably stale. Please remove the entry
gtest_main_LIB_DEPENDS
from the cache.
CMake Error: Target gmock has dependency information when it shouldn't.
Your cache is probably stale. Please remove the entry
gmock_LIB_DEPENDS
from the cache.
CMake Error: Target gmock_main has dependency information when it shouldn't.
Your cache is probably stale. Please remove the entry
gmock_main_LIB_DEPENDS
from the cache.
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.14
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 2 packages in topological order:
-- ~~ - ros_basics_tutorials
-- ~~ - naoqi_driver
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'ros_basics_tutorials'
-- ==> add_subdirectory(ros_basics_tutorials)
-- Could NOT find cpp (missing: cpp_DIR)
-- Could not find the required component 'cpp'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "cpp" with any of
the following names:
cppConfig.cmake
cpp-config.cmake
Add the installation prefix of "cpp" to CMAKE_PREFIX_PATH or set "cpp_DIR"
to a directory containing one of the above files. If "cpp" provides a
separate development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
ros_basics_tutorials/CMakeLists.txt:10 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/selcuk/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/selcuk/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:320: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
I couldn't solve? How can solve it?
The error was due to anathor project folder which i canceled under the catkin_ws. I deleted it and complied again. The error solved.

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.

Unknown CMake command "CHECK_INCLUDE_FILE_CXX"

I tried running cmake to generate the build tools for linux on vmime with the latest source from git hub, it generated the following errors. Thoughts??
vmime$ /usr/local/bin/cmake -G "Unix Makefiles"
CMake Error at CMakeLists.txt:20 (INCLUDE):
include could not find load file:
CheckIncludeFileCxx
-- Build type: Debug
CMake Error at CMakeLists.txt:452 (CHECK_INCLUDE_FILE_CXX):
Unknown CMake command "CHECK_INCLUDE_FILE_CXX".
-- Configuring incomplete, errors occurred!
In your CMakeLists.txt at line 20, you have
include(CheckIncludeFileCxx)
This should be
include(CheckIncludeFileCXX)
^^--- Uppercase
Once CheckIncludeFileCXX is properly included, the error on line 452 should also disappear, since the file defines the function CHECK_INCLUDE_FILE_CXX.
It has probably only been tested on Windows; since Windows filenames are case-insensitive this would have worked.