如何诊断柯南安装问题

How to diagnose conan install issue

我在安装柯南时遇到了一些问题

在我Ubuntu18.04告诉"Command 'conan' not found"之后,我猜到了Python 版本不对。所以我尝试升级结果

$ sudo apt-get install python
python is already the newest version (2.7.15~rc1-1)

但是

$ locate python
/var/lib/binfmts/python2.7
/var/lib/binfmts/python3.6

在这种状态下我尝试安装柯南

$ pip install conan
Collecting conan
...
Successfully installed Jinja2-2.10.1 MarkupSafe-1.1.1 PyJWT-1.7.1 PyYAML-5.1.2 astroid-1.6.6 attrs-19.1.0 backports.functools-lru-cache-1.5 bottle-0.12.17 certifi-2019.6.16 chardet-3.0.4 colorama-0.4.1 conan-1.18.0 configparser-3.7.4 deprecation-2.0.6 distro-1.1.0 enum34-1.1.6 fasteners-0.15 future-0.16.0 futures-3.3.0 idna-2.8 isort-4.3.21 lazy-object-proxy-1.4.1 mccabe-0.6.1 monotonic-1.5 node-semver-0.6.1 packaging-19.1 patch-1.16 pluginbase-0.7 pygments-2.4.2 pylint-1.9.5 pyparsing-2.4.2 python-dateutil-2.8.0 requests-2.22.0 singledispatch-3.4.0.3 six-1.12.0 tqdm-4.32.2 urllib3-1.25.3 wrapt-1.11.2

然后 'conan' 被列为正在安装,但是

$ conan

Command 'conan' not found, did you mean:

即没有错误消息或警告,只是没有安装。 我发现路径没有列在我的 PATH 中,所以我添加了'~.local/bin'。现在故事继续错误消息

CMake Error at CMakeLists.txt:90 (include):
  include could not find load file:

    Conan

我找到了 https://docs.conan.io/en/latest/howtos/cmake_launch.html。 好的,我在 CMakeLists.txt 文件行

中插入了
# Download automatically, you can also just copy the conan.cmake file

if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
   message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
   file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/master/conan.cmake"
                  "${CMAKE_BINARY_DIR}/conan.cmake")
endif()

include(${CMAKE_BINARY_DIR}/conan.cmake)

conan_cmake_run(REQUIRES Catch2/2.6.0@catchorg/stable
                BASIC_SETUP)

我也被告知,

  Please specify in command line CMAKE_BUILD_TYPE
  (-DCMAKE_BUILD_TYPE=Release)

所以我用

cmake .. -DCMAKE_BUILD_TYPE=Release

而不是

cmake ..

我还是收到了

ERROR: compiler not defined for compiler.libcxx
Please define compiler value first too
FATAL_ERROR;conan install command failed.
STATUS;Conan: Compiler GCC>=5, checking major version 7
STATUS;Conan: Checking correct version: 7

大约两周前,我可以在另一个系统上完美地安装同一个项目。我能以某种方式回到那个状态吗?我希望柯南是稳定的,而不是阿尔法。

编辑 2: 我发

 conan profile new default --detect --force

回复是

Found gcc 7
gcc>=5, using the major as version

************************* WARNING: GCC OLD ABI COMPATIBILITY ***********************

Conan detected a GCC version > 5 but has adjusted the 'compiler.libcxx' setting to
'libstdc++' for backwards compatibility.
Your compiler is likely using the new CXX11 ABI by default (libstdc++11).

(我真的不知道为什么在新项目的情况下我需要向后兼容)之后,

cmake ..

终于可以用了。由于编译器标准,恐怕我会有更多问题。例如,SystemC 默认为 '98,但其他一些库使用需要 '14 的功能,现在柯南强制使用 '11。有没有办法针对我的系统集中处理所有这些问题?

关于两个python版本:我没有手动安装它,只有一些其他安装程序这样做了。我真的不知道为什么以及哪个安装脚本会导致这种加倍。顺便说一句:Ubuntu 说 V2.7 是最新版本,尽管 V3.x 也存在。我对这些版本号有点困惑。 我只是做了一个新安装,并没有特别在 python 第二个版本出现时。我个人甚至不用python,只有一些安装脚本可以安装它。

我的系统是否具体:我不这么认为。我刚刚安装了 Ubuntu 18.04.2,我的主要目标是安装这个 SystemC 相关的东西。我真的只安装了被声明为丢失的东西。 (加上livetex,git等)

同时'cmake ..'终止。显然,柯南的安装终止了。但是,在配置我的项目时,会给出类似

的消息
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
SCV_INCLUDE_DIRS

柯南也安装了丢失的文件,使用

[requires]
SystemC/2.3.3@minres/stable
SystemCVerification/2.0.1@minres/stable
doxygen_installer/1.8.15@bincrafters/stable
qt/5.12.0@bincrafters/stable
gtest/1.8.1@bincrafters/stable
flex/2.6.4@bincrafters/stable

我正在使用完全相同的文件(我的旧磁盘连接到总线或新磁盘,使用相同的电缆)。大约一个月前进行的安装运行良好,新安装的表现与描述的一样。

看起来安装和使用柯南对我来说太复杂了。我想简化安装而不是使其复杂化。

这里列出了一堆与安装相关的案例:
https://docs.conan.io/en/latest/installation.html#known-installation-issues-with-pip

我会说 Conan 已安装但未在您的 PATH 中列出。您可以在 Python 包文件夹中找到 Conan 并使用 conan 路径更新您的 PATH:

python -m site # list your package folder
find <package folder> -name conan
echo PATH=${PATH}:<package folder> >> ~/.bashrc
source ~/.bashrc