Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to diagnose conan install issue

I have some installation issues with conan

After my Ubuntu 18.04 told "Command 'conan' not found", I guessed the Python version is wrong. So I attempted to upgrade with the result

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

However

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

When in this state I attempted to install conan

$ 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

then 'conan' is listed as being installed but

$ conan

Command 'conan' not found, did you mean:

I.e, no error message or warning, just does not install. I could find out that the path was not listed in my PATH, so I added '~.local/bin'. Now the story goes on with the error message

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

    Conan

I found https://docs.conan.io/en/latest/howtos/cmake_launch.html. OK, I inserted in my CMakeLists.txt file line

# 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)

I was also advised,

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

So I use

cmake .. -DCMAKE_BUILD_TYPE=Release

rather than

cmake ..

Still, I receive

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

About two weeks ago I could install on another system the same project flawlessly. Can I go back somehow to that state? I expected conan to be stable, rather than alpha.

Edit 2: I issued

 conan profile new default --detect --force

The reply is

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).

(I do not really know why in the case of a new project I need backward compatibility) After that,

cmake ..

finally seems to work. I am afraid I will have further issues due to the compiler standards. For example, SystemC defaults to '98, but some other library uses feature needing '14, and now conan forces to use '11. Is there a way to handle all this centrally, specific to MY system?

Concerning the two python versions: I did not install this manually, only some other install programs did so. I do not really know why and which install script causes such doubling. BTW: Ubuntu said that V2.7 is the newest version, although V3.x is also present. I am a bit confused about these version numbers. I simply made a new install, and did not especially very WHEN the second version of python appeared. I personally do not even use python, only some install scripts could install it.

Whether my system is specific: I do not think so. I just installed Ubuntu 18.04.2, and my primary goal was to install this SystemC related stuff. I really installed ONLY what was declared as missing. (plus livetex, git, etc.)

In the meantime 'cmake ..' terminated. Appearently, the installation by conan terminated OK. However, when configuring my project, gives messages like

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

The missing files are installed also by conan, using

[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

I am using literally the same files (either my old disk connected to the bus or the new one, using the same cable). The installation made about a month ago runs fine, the new one behaves as described.

It looks like installing and using conan is too complicated for me. I wanted to simplify installation rather than complicate it.

like image 568
katang Avatar asked Nov 23 '25 02:11

katang


2 Answers

There is a bunch of cases related to installation listed here:
https://docs.conan.io/en/latest/installation.html#known-installation-issues-with-pip

I would say Conan is installed but is not listed in your PATH. You could find Conan in your Python package folder and update your PATH with conan path:

python -m site # list your package folder
find <package folder> -name conan
echo PATH=${PATH}:<package folder> >> ~/.bashrc
source ~/.bashrc
like image 161
uilianries Avatar answered Nov 25 '25 14:11

uilianries


in my case (Ubuntu 22.04), run the following just work

source ~/.profile

Note: this is a known issue by conan official, find more details here: https://docs.conan.io/1/installation.html

like image 36
Jess C Avatar answered Nov 25 '25 15:11

Jess C