Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: DISABLE_CONAN Env Var broken in qiskit-aer v0.7.2 #1079

Closed
drewrisinger opened this issue Dec 11, 2020 · 0 comments · Fixed by #1080
Closed

Build: DISABLE_CONAN Env Var broken in qiskit-aer v0.7.2 #1079

drewrisinger opened this issue Dec 11, 2020 · 0 comments · Fixed by #1080
Labels
bug Something isn't working

Comments

@drewrisinger
Copy link
Contributor

drewrisinger commented Dec 11, 2020

Informations

  • Qiskit Aer version: 0.7.2
  • Python version: 3.7.6
  • Operating system: Linux

What is the current behavior?

DISABLE_CONAN environment variable and CMake flag don't work as they should, and Conan dependencies are still searched.

Steps to reproduce the problem

Build qiskit-aer v0.7.2 with DISABLE_CONAN=1 python setup.py bdist_wheel from environment without conan.

Optional for full reproduction:

  • Install Nix: curl -L https://nixos.org/nix/install | sh
  • nix-build -I nixpkgs=channel:nixos-20.03 -A python3Packages.qiskit-aer https://github.com/drewrisinger/nur-packages/archive/6c2e51c322fab401bbe4c597285710f643830cb3.tar.gz

What is the expected behavior?

This should build a wheel via skbuild/cmake without conan being present.
Instead, it seems the variable DISABLE_CONAN isn't set properly. See following trace:

Grep'd CMake build w/ --trace-expand flag on (note, this was with the partial solution below applied):

/tmp/nix-build-python3.7-qiskit-aer-0.7.2.drv-2/source/CMakeLists.txt(50):  if(DEFINED ENV{DISABLE_CONAN} )
/tmp/nix-build-python3.7-qiskit-aer-0.7.2.drv-2/source/CMakeLists.txt(51):  set(_DISABLE_CONAN_DEFAULT {DISABLE_CONAN} )
/tmp/nix-build-python3.7-qiskit-aer-0.7.2.drv-2/source/CMakeLists.txt(55):  option(DISABLE_CONAN Disable Conan package manager to find dependencies. If disabled, you must have all dependencies present on your system. {DISABLE_CONAN} )
/tmp/nix-build-python3.7-qiskit-aer-0.7.2.drv-2/source/CMakeLists.txt(57):  include(CTest )
/tmp/nix-build-python3.7-qiskit-aer-0.7.2.drv-2/source/.eggs/cmake-3.18.4.post1-py3.7-linux-x86_64.egg/cmake/data/share/cmake-3.18/Modules/CTest.cmake(50):  option(BUILD_TESTING Build the testing tree. ON )
/tmp/nix-build-python3.7-qiskit-aer-0.7.2.drv-2/source/.eggs/cmake-3.18.4.post1-py3.7-linux-x86_64.egg/cmake/data/share/cmake-3.18/Modules/CTest.cmake(54):  function(GET_VS_VERSION_STRING generator var )
--
/tmp/nix-build-python3.7-qiskit-aer-0.7.2.drv-2/source/CMakeLists.txt(139):  if(STATIC_LINKING )
/tmp/nix-build-python3.7-qiskit-aer-0.7.2.drv-2/source/CMakeLists.txt(149):  set(BACKEND_REDIST_DEPS  )
/tmp/nix-build-python3.7-qiskit-aer-0.7.2.drv-2/source/CMakeLists.txt(150):  setup_dependencies()
/tmp/nix-build-python3.7-qiskit-aer-0.7.2.drv-2/source/cmake/dependency_utils.cmake(16):  if(DISABLE_CONAN )
/tmp/nix-build-python3.7-qiskit-aer-0.7.2.drv-2/source/cmake/dependency_utils.cmake(18):  else()
/tmp/nix-build-python3.7-qiskit-aer-0.7.2.drv-2/source/cmake/dependency_utils.cmake(19):  include(conan_utils )
/tmp/nix-build-python3.7-qiskit-aer-0.7.2.drv-2/source/cmake/conan_utils.cmake(1):  include(conan )

Full build log: https://gist.github.com/drewrisinger/de63a783861c28d14186714938e7029f

Suggested solutions

Partial solution:

  • Replace ENV{DISABLE_CONAN} variable read in CMakeLists.txt with proper syntax: $ENV{DISABLE_CONAN}. Tested with this patch and it still didn't fix it. Ref (only second instance should be replaced):
    if(DEFINED ENV{DISABLE_CONAN})
    set(_DISABLE_CONAN_DEFAULT ENV{DISABLE_CONAN})
    else()
    set(_DISABLE_CONAN_DEFAULT OFF)
    endif()

Relevant issues:

#999, #1069 , #757, #877

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant